-
Notifications
You must be signed in to change notification settings - Fork 322
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(ModalTopActions): top actions component for internal use #2415
feat(ModalTopActions): top actions component for internal use #2415
Conversation
| ButtonColor.ON_INVERTED_BACKGROUND; | ||
|
||
export interface ModalTopActionsProps { | ||
renderAction?: (color?: ModalTopActionsButtonColor) => React.ReactElement<typeof MenuButton | typeof IconButton>; |
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.
@shlomitc suggests for it to be
renderAction?: (color?: ModalTopActionsButtonColor) => React.ReactElement<typeof MenuButton | typeof IconButton>; | |
renderAction?: React.ReactElement<typeof MenuButton | typeof IconButton>; |
let's discuss it.
The main motivation for making it a function is the following:
// color on `renderHeaderAction` is "light"
<Modal closeButtonTheme="light" renderHeaderAction={(color) => <IconButton ...props color={color} />
vs
// force the user to type it twice - leaves a place for a mistake
<Modal closeButtonTheme="light" renderHeaderAction={<IconButton ...props color={"light"} />
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 think we can support both, if you want the color you can use a function and use it in your component, otherwise you can control it yourself with just passing a component
packages/core/src/components/ModalNew/ModalTopActions/ModalTopActions.tsx
Outdated
Show resolved
Hide resolved
packages/core/src/components/ModalNew/ModalTopActions/ModalTopActions.tsx
Outdated
Show resolved
Hide resolved
packages/core/src/components/ModalNew/ModalTopActions/ModalTopActions.tsx
Show resolved
Hide resolved
| ButtonColor.ON_INVERTED_BACKGROUND; | ||
|
||
export interface ModalTopActionsProps { | ||
renderAction?: (color?: ModalTopActionsButtonColor) => React.ReactElement<typeof MenuButton | typeof IconButton>; |
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 think we can support both, if you want the color you can use a function and use it in your component, otherwise you can control it yourself with just passing a component
4999a84
into
feat/yossi/new-modal-building-blocks-7359960492
ModalTopActions 🔒
Which shows next to the Header, at the top of the modal
onClose
that was assigned by consumer to theonClose
of theModal
.Modal
.Props:
Usage example:
https://monday.monday.com/boards/3532715121/pulses/7360589183