feat(ModalTopActions): top actions component for internal use#2415
Merged
YossiSaadi merged 3 commits intofeat/yossi/new-modal-building-blocks-7359960492from Sep 24, 2024
Conversation
YossiSaadi
commented
Sep 5, 2024
| | ButtonColor.ON_INVERTED_BACKGROUND; | ||
|
|
||
| export interface ModalTopActionsProps { | ||
| renderAction?: (color?: ModalTopActionsButtonColor) => React.ReactElement<typeof MenuButton | typeof IconButton>; |
Contributor
Author
There was a problem hiding this comment.
@shlomitc suggests for it to be
Suggested change
| 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"} />
Member
There was a problem hiding this comment.
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
talkor
approved these changes
Sep 24, 2024
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>; |
Member
There was a problem hiding this comment.
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
YossiSaadi
added a commit
that referenced
this pull request
Oct 14, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ModalTopActions 🔒
Which shows next to the Header, at the top of the modal
onClosethat was assigned by consumer to theonCloseof theModal.Modal.Props:
Usage example:
https://monday.monday.com/boards/3532715121/pulses/7360589183