diff --git a/apps/ledger-live-desktop/src/renderer/hooks/usePortfolioCards.tsx b/apps/ledger-live-desktop/src/renderer/hooks/usePortfolioCards.tsx index 60a462ef180c..c89b90d9326a 100644 --- a/apps/ledger-live-desktop/src/renderer/hooks/usePortfolioCards.tsx +++ b/apps/ledger-live-desktop/src/renderer/hooks/usePortfolioCards.tsx @@ -7,14 +7,9 @@ import { setPortfolioCards } from "~/renderer/actions/dynamicContent"; const usePortfolioCards = () => { const dispatch = useDispatch(); - const [cachedContentCards, setCachedContentCards] = useState([]); + const [cachedContentCards, setCachedContentCards] = useState(braze.getCachedContentCards().cards); const portfolioCards = useSelector(portfolioContentCardSelector); - useEffect(() => { - const cards = braze.getCachedContentCards().cards; - setCachedContentCards(cards); - }, []); - const findCard = (cardId: string) => cachedContentCards.find(card => card.id === cardId); const onImpression = (cardId: string) => { @@ -36,11 +31,6 @@ const usePortfolioCards = () => { const currentCard = findCard(cardId); if (currentCard) { - // For some reason braze won't log the click event if the card url is empty - // Setting it as the card id just to have a dummy non empty value - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - currentCard.url = currentCard.id; braze.logContentCardClick(currentCard); } }; diff --git a/apps/ledger-live-desktop/src/renderer/screens/dashboard/PortfolioContentCards.tsx b/apps/ledger-live-desktop/src/renderer/screens/dashboard/PortfolioContentCards.tsx index 358c8905d986..82696d32ab91 100644 --- a/apps/ledger-live-desktop/src/renderer/screens/dashboard/PortfolioContentCards.tsx +++ b/apps/ledger-live-desktop/src/renderer/screens/dashboard/PortfolioContentCards.tsx @@ -5,11 +5,12 @@ import React, { PropsWithChildren } from "react"; import { useSelector } from "react-redux"; import styled from "styled-components"; import { useRefreshAccountsOrderingEffect } from "~/renderer/actions/general"; +import { Card } from "~/renderer/components/Box"; import usePortfolioCards from "~/renderer/hooks/usePortfolioCards"; import { accountsSelector } from "~/renderer/reducers/accounts"; import { hasInstalledAppsSelector } from "~/renderer/reducers/settings"; -const PortfolioVariantA = styled.div` +const PortfolioVariantA = styled(Card)` background-color: ${p => p.theme.colors.opacityPurple.c10}; `;