-
Notifications
You must be signed in to change notification settings - Fork 59
feat: Atomic Components for Card refactor #235
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: master
Are you sure you want to change the base?
Conversation
🟡 Heimdall Review Status
🟡
|
| Code Owner | Status | Calculation | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ui-systems-eng-team |
🟡
0/1
|
Denominator calculation
|
|
|
||
| export type CardRootProps = CardRootBaseProps & PressableProps; | ||
|
|
||
| export const CardRoot = memo( |
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.
Component that handles the interactive layer of card
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.
@adrienzheng-cb do you mind adding some js docs to this (and other component s where helpful) to add context around usage?
Additionally, are we expecting customers to ever use this directly or is it for internal use to share behavior between Card components?
4c49779 to
ec9c499
Compare
a6cb94a to
be85bd4
Compare
be85bd4 to
7134a9f
Compare
7134a9f to
830443f
Compare
830443f to
e3d6651
Compare
e3d6651 to
67a0cf5
Compare
67a0cf5 to
634007d
Compare
634007d to
d4869f5
Compare
cb-ekuersch
left a comment
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.
Few questions I want to get to the bottom of here, but in general the direction looks good!
|
|
||
| import { Pictogram, SpotSquare } from '../illustrations'; | ||
|
|
||
| import { CardRemoteImage } from './CardRemoteImage'; |
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!
| <RemoteImage | ||
| alt={props.alt ?? ''} | ||
| resizeMode="cover" | ||
| source={getSource(props.src)} |
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: curious about the addition of these properties
|
|
||
| export type CardRootProps = CardRootBaseProps & PressableProps; | ||
|
|
||
| export const CardRoot = memo( |
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.
@adrienzheng-cb do you mind adding some js docs to this (and other component s where helpful) to add context around usage?
Additionally, are we expecting customers to ever use this directly or is it for internal use to share behavior between Card components?
| { | ||
| children?: React.ReactNode; | ||
| /** If true, the CardRoot will be rendered as a Pressable component. */ | ||
| renderAsPressable?: boolean; |
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: should we just make this implicit with a onPress prop as the previous cards did?
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 know we discussed this like a month ago, i just need a little help remembering the context around the decision
| if (renderAsPressable) { | ||
| const { as, ...pressableRestProps } = props; | ||
| return ( | ||
| <Pressable ref={ref} as={as ?? 'button'} {...(pressableRestProps as any)}> |
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: is the default as necessary? Pretty sure button is the default for pressable
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.
should we render the pressable if they pass button as the value for as? onClick will be valid prop at that point
| } else { | ||
| const { as, ...hstackRestProps } = props; | ||
| return ( | ||
| <HStack ref={ref} as={as ?? 'article'} {...(hstackRestProps as any)}> |
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: why article?
What changed? Why?
Root cause (required for bugfixes)
UI changes
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