-
Notifications
You must be signed in to change notification settings - Fork 58
feat: MediaCard #242
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
base: adrien/card-refactor-base
Are you sure you want to change the base?
feat: MediaCard #242
Conversation
ec9c499 to
a6cb94a
Compare
2974a71 to
776916b
Compare
a6cb94a to
be85bd4
Compare
776916b to
7292037
Compare
830443f to
e3d6651
Compare
7292037 to
b677667
Compare
e3d6651 to
67a0cf5
Compare
b677667 to
0bfc676
Compare
67a0cf5 to
634007d
Compare
b8ba62a to
a1c36fd
Compare
634007d to
d4869f5
Compare
a1c36fd to
a242eaa
Compare
| export type MediaCardBaseProps = MediaCardLayoutProps; | ||
|
|
||
| export type MediaCardProps = Omit<CardRootProps, 'children'> & | ||
| MediaCardBaseProps & { |
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.
nit: full types before others
|
|
||
| export type MediaCardBaseProps = MediaCardLayoutProps; | ||
|
|
||
| export type MediaCardProps = Omit<CardRootProps, 'children'> & |
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 you are composing the RootProps and not the RootBaseProps on the base props type? I trust your decision, I'm just trying to strengthen my own understanding of the distinction when I can. The benefit I see of doing it this way is you now make MediaCard polymorphic the same way as the CardRoot component
| media, | ||
| mediaPlacement = 'end', | ||
| style, | ||
| styles: { root: rootStyle, ...layoutStyles } = {}, |
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.
nice way to separate out the layout styles into their own component!
| import { Text } from '../../typography/Text'; | ||
|
|
||
| export type MediaCardLayoutBaseProps = { | ||
| /** Text or React node to display as the card title. When a string is provided, it will be rendered in a CardTitle component. */ |
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.
nit: CardTitle doesn't really exist from the customer's perspective. I would mention the font instead
| styles?: { | ||
| layoutContainer?: StyleProp<ViewStyle>; | ||
| contentContainer?: StyleProp<ViewStyle>; | ||
| textContainer?: StyleProp<ViewStyle>; |
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.
sometimes it feels unnecessary to have 2 levels deep of custom CSS - how does it feel to you? Imo they could always provide more targetted CSS or a ReactNode to customize further if needed (latter for mobile as no CSS there)
| } | ||
| >; | ||
|
|
||
| export type MediaCardProps<AsComponent extends React.ElementType = 'article'> = Polymorphic.Props< |
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 commented on the wrong package's MediaCard - but touching on it here again. If you assign the MediaCard props to CardRootProps won't you get to share the polymorphism?
| import { Text } from '../../typography/Text'; | ||
|
|
||
| export type MediaCardLayoutBaseProps = { | ||
| /** Text or React node to display as the card title. When a string is provided, it will be rendered in a CardTitle component. */ |
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.
nit: same thing about referencing components that don't exist
What changed? Why?
Root cause (required for bugfixes)
UI changes
docs
storybook
Testing
How has it been tested?
Testing instructions
Illustrations/Icons Checklist
Required if this PR changes files under
packages/illustrations/**orpackages/icons/**Change management
type=routine
risk=low
impact=sev5
automerge=false