Skip to content
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(Modal): modal component with basic functionality #2417

Conversation

YossiSaadi
Copy link
Contributor

@YossiSaadi YossiSaadi commented Sep 5, 2024

Modal 🌐

image

This should be a canvas-like component that should only take care of the logic and not what to render inside (except the top actions).

Props:

Name Type Default Description
show* boolean    
size 🌐 ModalSize: "small" | "medium" | "large" "medium"  
closeButtonTheme ModalTopActionsProps["color"]: "light" | "dark"  
closeButtonAriaLabel ModalTopActionsProps["closeButtonAriaLabel"]: string    
onClose ModalTopActionsProps["onClose"]: React.MouseEventHandler    
renderHeaderAction ModalTopActionsProps["renderAction"]: (color?: ModalTopActionsButtonColor) => React.ReactElement<typeof MenuButton | typeof IconButton>    
children React.ReactNode   Can be anything.

Usage example:

<Modal
  show={shouldShowModal}
  size="small"
  closeButtonTheme="light"
  closeButtonAriaLabel="Close"
  onClose={() => console.log("Closing")}
  renderHeaderAction={(color) => <IconButton icon={Feedback} color={color} />}
>
  {/* children */}
</Modal>

https://monday.monday.com/boards/3532715121/pulses/7360583166

@YossiSaadi YossiSaadi force-pushed the feat/yossi/basic-modal-component-to-act-as-modals-canvas-7360583166 branch from 5dc52ba to f100fee Compare September 5, 2024 08:55
export interface ModalProps extends VibeComponentProps {
show: boolean;
size?: ModalSize;
closeButtonTheme?: ModalTopActionsProps["color"];
Copy link
Contributor Author

@YossiSaadi YossiSaadi Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shlomitc suggests deciding on a different structure for this, that we would apply on all our components.
Right now the pattern is also "[prefix]Theme" for Tipseen for example. (also for close button theming).
let's discuss if we want to change it.
Should this also include design?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we discussed it within the team and decided to leave the theme pattern

@YossiSaadi YossiSaadi marked this pull request as ready for review September 8, 2024 10:10
@YossiSaadi YossiSaadi requested a review from a team as a code owner September 8, 2024 10:10
.overlay {
position: fixed;
inset: 0;
background-color: rgba(41, 47, 76, 0.7);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it ok? I think we recently changed it to be more adjustable to the themes, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll create a separate task for it

export interface ModalProps extends VibeComponentProps {
show: boolean;
size?: ModalSize;
closeButtonTheme?: ModalTopActionsProps["color"];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand

Base automatically changed from feat/yossi/modaltopactions-component-to-render-close-extra-optional-7360589183 to feat/yossi/new-modal-building-blocks-7359960492 September 24, 2024 11:35
An error occurred while trying to automatically change base from feat/yossi/modaltopactions-component-to-render-close-extra-optional-7360589183 to feat/yossi/new-modal-building-blocks-7359960492 September 24, 2024 11:35
@YossiSaadi YossiSaadi force-pushed the feat/yossi/basic-modal-component-to-act-as-modals-canvas-7360583166 branch from ab039e7 to 29b4ff9 Compare September 24, 2024 11:37
@YossiSaadi YossiSaadi merged commit 5359a54 into feat/yossi/new-modal-building-blocks-7359960492 Sep 24, 2024
9 of 10 checks passed
@YossiSaadi YossiSaadi deleted the feat/yossi/basic-modal-component-to-act-as-modals-canvas-7360583166 branch September 24, 2024 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants