Skip to content

Commit 8812a69

Browse files
zel-kassgithub-actions[bot]gamegeeCopilot
authored
[M]DLS-535-feat(ui-rnative): add MediaCard component (#571)
* feat(MediaCard): add MediaCard component with leading and trailing content support - Introduced MediaCard component to display images with customizable content. - Added MediaCardLeadingContent and MediaCardTrailingContent for flexible layouts. - Updated App.tsx to include MediaCards in the sandbox. - Enhanced internationalization files with new close button labels in multiple languages. - Added tests and documentation for MediaCard component functionality. * feat(ui-rnative): implement MediaCard component with customizable content slots * refactor(MediaCard): simplify component structure by removing leading and trailing content slots * nx release plan * chore(dependencies): bump @ledgerhq/lumen-design-core to 0.1.5 and @ledgerhq/lumen-ui-rnative to 0.1.11 * refactor(MediaCard): replace RadialGradient with LinearGradient and adjust gradient colors for design fidelity * 💄 (figma): Sync Figma Design Tokens & Symbols (#579) * 💄 (figma): Sync Figma Design Tokens & Symbols * fix: remove is-utility: dark Signed-off-by: Simon Bruneaud <simon.bruneaud@ledger.fr> --------- Signed-off-by: Simon Bruneaud <simon.bruneaud@ledger.fr> Co-authored-by: gamegee <15988848+gamegee@users.noreply.github.com> Co-authored-by: Simon Bruneaud <simon.bruneaud@ledger.fr> * test/add test for themeprovider (#576) * chore: update app-sandbox-rnative versions Signed-off-by: Simon Bruneaud <simon.bruneaud@ledger.fr> * test(ui-rnative): make sure to test the ThemeProvider with real components that consume the theme Signed-off-by: Simon Bruneaud <simon.bruneaud@ledger.fr> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Signed-off-by: Simon Bruneaud <simon.bruneaud@ledger.fr> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * feat(design-core): add whiteHover et whitePressed semantic tokens for theme JS (rn) (#580) Signed-off-by: Simon Bruneaud <simon.bruneaud@ledger.fr> * feat(InteractiveIcon): add appearance prop for customizable icon colors and replace Pressable in MediaCard with new InteractiveIcon * feat(MediaCard): spread props in MediaCardTitle for enhanced flexibility * feat(MediaCard): add interactive close functionality to MediaCard story * refactor(MediaCard): replace ReactNode import with type import for improved type clarity * Dls 634/fix amount display (#584) * fix(amount-display): fix ui-react AmountDisplay baseline issue + add 0.5px more width for each char Signed-off-by: Simon Bruneaud <simon.bruneaud@ledger.fr> * nx plan Signed-off-by: Simon Bruneaud <simon.bruneaud@ledger.fr> * fix(ui-react): fix amountdisplay failing test Signed-off-by: Simon Bruneaud <simon.bruneaud@ledger.fr> --------- Signed-off-by: Simon Bruneaud <simon.bruneaud@ledger.fr> * feat(MediaCard): enhance documentation and update styles for improved layout * feat(MediaCard): update close button behavior and enhance accessibility features * refactor(MediaCard): update image rendering logic and enhance component structure * refactor(MediaCard): streamline component structure and update props handling --------- Signed-off-by: Simon Bruneaud <simon.bruneaud@ledger.fr> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: gamegee <15988848+gamegee@users.noreply.github.com> Co-authored-by: Simon Bruneaud <simon.bruneaud@ledger.fr> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 5a164b3 commit 8812a69

File tree

24 files changed

+786
-4
lines changed

24 files changed

+786
-4
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@ledgerhq/lumen-ui-rnative': patch
3+
---
4+
5+
feat(MediaCard): introduce MediaCard component with docs, tests, and figma code connect.

apps/app-sandbox-rnative/src/app/App.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import {
4646
Banners,
4747
CardButtons,
4848
ContentBanners,
49+
MediaCards,
4950
Tooltips,
5051
ListItems,
5152
Gradients,
@@ -181,6 +182,9 @@ const AppContent = ({
181182
<SandboxBlock title='ListItems'>
182183
<ListItems />
183184
</SandboxBlock>
185+
<SandboxBlock title='MediaCards'>
186+
<MediaCards />
187+
</SandboxBlock>
184188
<SandboxBlock title='NavBars'>
185189
<NavBars />
186190
</SandboxBlock>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import {
2+
Box,
3+
Text,
4+
MediaCard,
5+
MediaCardTitle,
6+
Tag,
7+
} from '@ledgerhq/lumen-ui-rnative';
8+
9+
const EXAMPLE_SRC =
10+
'https://ledger-wp-website-s3-prd.ledger.com/uploads/2026/03/hero_visual-1.webp';
11+
12+
export const MediaCards = () => {
13+
return (
14+
<Box lx={{ flexDirection: 'column', gap: 's12', width: 'full' }}>
15+
<MediaCard
16+
imageUrl={EXAMPLE_SRC}
17+
onPress={() => ({})}
18+
onClose={() => ({})}
19+
>
20+
<Tag label='Promo' size='md' />
21+
<MediaCardTitle>
22+
Black Friday sale. 3 days with no fees on your transactions.
23+
</MediaCardTitle>
24+
</MediaCard>
25+
26+
<MediaCard
27+
imageUrl={EXAMPLE_SRC}
28+
onPress={() => ({})}
29+
onClose={() => ({})}
30+
>
31+
<MediaCardTitle>Secure your crypto assets</MediaCardTitle>
32+
<Text typography='body2' lx={{ color: 'white' }}>
33+
Get started with Ledger and protect your digital assets today.
34+
</Text>
35+
</MediaCard>
36+
</Box>
37+
);
38+
};

apps/app-sandbox-rnative/src/app/blocks/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ export * from './InteractiveIcons';
2929
export * from './Banners';
3030
export * from './CardButtons';
3131
export * from './ContentBanners';
32+
export * from './MediaCards';
3233
export * from './Tooltips';
3334
export * from './Gradients';

libs/ui-rnative/src/i18n/locales/de.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"common": {
3+
"closeAriaLabel": "Schließen"
4+
},
25
"components": {
36
"addressInput": {
47
"qrCodeAriaLabel": "QR-Code scannen"

libs/ui-rnative/src/i18n/locales/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"common": {
3+
"closeAriaLabel": "Close"
4+
},
25
"components": {
36
"addressInput": {
47
"qrCodeAriaLabel": "Scan QR code"

libs/ui-rnative/src/i18n/locales/es.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"common": {
3+
"closeAriaLabel": "Cerrar"
4+
},
25
"components": {
36
"addressInput": {
47
"qrCodeAriaLabel": "Escanear código QR"

libs/ui-rnative/src/i18n/locales/fr.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"common": {
3+
"closeAriaLabel": "Fermer"
4+
},
25
"components": {
36
"addressInput": {
47
"qrCodeAriaLabel": "Scanner le code QR"

libs/ui-rnative/src/i18n/locales/ja.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"common": {
3+
"closeAriaLabel": "閉じる"
4+
},
25
"components": {
36
"addressInput": {
47
"qrCodeAriaLabel": "QRコードをスキャン"

libs/ui-rnative/src/i18n/locales/ko.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"common": {
3+
"closeAriaLabel": "닫기"
4+
},
25
"components": {
36
"addressInput": {
47
"qrCodeAriaLabel": "QR 코드 스캔"

0 commit comments

Comments
 (0)