-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat(MediaCard): add top icon support #824
Changes from 4 commits
ce14917
6b3511d
ebbb6ac
f8e5a89
518abbd
c34aa8d
fb2824c
80be765
f5498ff
02fa71b
1917d9b
b1d3d00
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,6 +147,22 @@ export const mediaCardContent = style([ | |
}, | ||
]); | ||
|
||
export const mediaCardAsset = style([ | ||
{ | ||
position: 'absolute', | ||
zIndex: 1, | ||
}, | ||
{ | ||
'@media': { | ||
[mq.desktopOrBigger]: { | ||
paddingLeft: 24, | ||
paddingTop: 24, | ||
paddingBottom: 32, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @aweell, it's ok to have different paddings in desktop? I don't see this in the specs. If these are needed, we should move them to the Box element instead of creating a new media query here @thiagoaraujo-tlf: <Box paddingLeft={{mobile: 16, desktop: 24}} paddingTop={{mobile: 16, desktop: 24}}> Also, I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the asset has a spacing left and top of 16 in mobile and 24 in desktop. This is intended to align the asset to the content since the padding of the content increases in desktop. The other changes, it seems they're related the content padding? They are already working in the current component. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just added icon padding for when it's on desktop @atabel |
||
}, | ||
}, | ||
}, | ||
]); | ||
|
||
export const dataCard = style([ | ||
sprinkles({ | ||
display: 'flex', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -407,6 +407,7 @@ interface MediaCardBaseProps { | |
subtitle?: string; | ||
subtitleLinesMax?: number; | ||
description?: string; | ||
asset?: React.ReactElement; | ||
descriptionLinesMax?: number; | ||
extra?: React.ReactNode; | ||
actions?: Array<CardAction>; | ||
|
@@ -437,6 +438,7 @@ export const MediaCard = React.forwardRef<HTMLDivElement, MediaCardProps>( | |
title, | ||
titleLinesMax, | ||
description, | ||
asset, | ||
descriptionLinesMax, | ||
extra, | ||
actions, | ||
|
@@ -486,6 +488,13 @@ export const MediaCard = React.forwardRef<HTMLDivElement, MediaCardProps>( | |
buttonLink={buttonLink} | ||
/> | ||
</div> | ||
{asset ? ( | ||
<Box className={styles.mediaCardAsset} paddingX={16} paddingY={16}> | ||
{asset} | ||
</Box> | ||
) : ( | ||
<Box paddingBottom={actions?.length || onClose ? 64 : 0} /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not needed. It's needed in other cards like DisplayMediaCard because the |
||
)} | ||
</div> | ||
</BaseTouchable> | ||
</Boxed> | ||
|
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.
what happened here?
Please review that extra bottom padding