Skip to content

Commit

Permalink
Quick function simplification + remove bg color on img
Browse files Browse the repository at this point in the history
  • Loading branch information
sshmaxime committed Feb 1, 2024
1 parent 8b99b94 commit 1dd7bd7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const Header = styled.img`
height: 36px;
width: 36px;
border-radius: 1000px;
background-color: white;
`;

const Body = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ const usePortfolioCards = () => {
setCachedContentCards(cards);
}, []);

const findCard = (cardId: string) => cachedContentCards.find(card => card.id === cardId);

const onImpression = (cardId: string) => {
const currentCard = cachedContentCards.find(card => card.id === cardId);
const currentCard = findCard(cardId);
currentCard && braze.logContentCardImpressions([currentCard]);
};

const onDismiss = (cardId: string) => {
const currentCard = cachedContentCards.find(card => card.id === cardId);
const currentCard = findCard(cardId);

if (currentCard) {
braze.logCardDismissal(currentCard);
Expand All @@ -31,7 +33,7 @@ const usePortfolioCards = () => {
};

const onClick = (cardId: string) => {
const currentCard = cachedContentCards.find(card => card.id === cardId);
const currentCard = findCard(cardId);

if (currentCard) {
// For some reason braze won't log the click event if the card url is empty
Expand Down

0 comments on commit 1dd7bd7

Please sign in to comment.