-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[LLD] - [LIVE-10488] - Add Portfolio Content Card #6032
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Ignored Deployments
|
ef8a42f
to
693030b
Compare
232a01a
to
209779e
Compare
apps/ledger-live-desktop/src/renderer/components/ContentCards/ActionCard/components.tsx
Outdated
Show resolved
Hide resolved
apps/ledger-live-desktop/src/renderer/hooks/usePortfolioCards.tsx
Outdated
Show resolved
Hide resolved
apps/ledger-live-desktop/src/renderer/screens/dashboard/index.tsx
Outdated
Show resolved
Hide resolved
apps/ledger-live-desktop/src/renderer/screens/dashboard/PortfolioContentCards.tsx
Show resolved
Hide resolved
// 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to ban // @ts-ignore
OR any
from our TS usage with new features.
Lately, we had an issue on production with a TS error that we ignored. We need to find why For some reason braze won't log the click
or extend the type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I 100% agree with you, there are a lot of "hidden" issues. This part of code isn't new, it's re-used code from the legacy piece of code that was handling braze before on LLD and left it as is.
I just dug a little and after few tests, all of the cards I receive from Braze have their url
field set. So I'm just removing this part of code but again, I cannot fully know what will be the consequences of this code removal, hence the reason why I kept it in the first place.
FYI, on top that, the SDK we are using is almost 1 year old. We might need some time to get it up to date as well ..
const [cachedContentCards, setCachedContentCards] = useState<braze.Card[]>([]); | ||
const portfolioCards = useSelector(portfolioContentCardSelector); | ||
|
||
useEffect(() => { | ||
const cards = braze.getCachedContentCards().cards; | ||
setCachedContentCards(cards); | ||
}, []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why we don't initiate cachedContentCards with braze.getCachedContentCards().cards
?
This would allow us to remove a useEffect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I re-used part of the old code and that was how it was done and I didn't give it a second thought. Agreed, nice catch, updating it right now.
<Description>{description}</Description> | ||
</Body> | ||
<Actions> | ||
<Link size="small" onClick={() => actions.dismiss.action()}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<Link size="small" onClick={() => actions.dismiss.action()}> | |
<Link size="small" onClick={actions.dismiss.action}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not the same type so I rather keep it that way. But we definitely should have a convention for this kind of things. Another thing to have in mind when re-thinking LLD or else.
</Link> | ||
|
||
{actions.primary.label && ( | ||
<ButtonV3 big variant="main" onClick={() => actions.primary.action()}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<ButtonV3 big variant="main" onClick={() => actions.primary.action()}> | |
<ButtonV3 big variant="main" onClick={ actions.primary.action}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above.
Can you provide a way to test it, please? |
Nice job Maxime ! 💪 |
2ff6a08
5aa7799
to
bc13d63
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0b87428
to
4f1cd07
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well!
Please cleanup your commits if you create a merge commit, otherwise it's all good!
4f1cd07
to
8290979
Compare
8290979
to
3555290
Compare
…for Portfolio ContentCards
… card in Carousel
3555290
to
3ca1477
Compare
[LLD] - [LIVE-10488] - Add Portfolio Content Card
[LLD] - [LIVE-10488] - Add Portfolio Content Card
📝 Description
usePortfolioCards
hooksNOTE:
We currently have some limitations on LLD (due to the fact that each variant has to be displayed in 2 different part of the DOM) that forced me to create a single component displayable in two different place for each variant, VariantA and VariantB.
❓ Context
✅ Checklist
Pull Requests must pass the CI and be code reviewed. Set as Draft if the PR is not ready.
npx changeset
was attached.[ ] Impact of the changes:
🧐 Checklist for the PR Reviewers