Skip to content

Commit 198e3d8

Browse files
added better comments for sparkle selection logic
1 parent bf62e22 commit 198e3d8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

client/src/components/ui/eventHighlightCard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,18 @@ const renderCardHeader = (card: eventHighlightCardType) => {
5050
);
5151
};
5252

53+
// helper to ensure sparkles are different
5354
function getTwoUniqueIndexes(): [number, number] {
5455
const first = Math.floor(Math.random() * 3);
5556
let second = Math.floor(Math.random() * 3);
5657

57-
// if number already chosen, change it
5858
if (second === first) {
5959
second = (first + 1) % 3;
6060
}
6161
return [first, second];
6262
}
6363

64+
// only render sparkles on specific cards
6465
export function renderSparkleOverlay(card: eventHighlightCardType) {
6566
const [i1, i2] = getTwoUniqueIndexes();
6667
switch (card.id) {

0 commit comments

Comments
 (0)