diff --git a/web/modals/modal.css b/web/modals/modal.css --- a/web/modals/modal.css +++ b/web/modals/modal.css @@ -83,3 +83,10 @@ .emptyButtonContainerOffset { height: 8px; } + +.primarySecondaryContainer { + display: flex; + justify-content: flex-end; + align-items: center; + column-gap: 16px; +} diff --git a/web/modals/modal.react.js b/web/modals/modal.react.js --- a/web/modals/modal.react.js +++ b/web/modals/modal.react.js @@ -13,6 +13,12 @@ export type ModalSize = 'small' | 'large' | 'fit-content'; +type ModalButtons = + | { + +primaryButton?: React.Node, + } + | { +primaryButton: React.Node, +secondaryButton?: React.Node }; + export type ModalOverridableProps = { +name?: string, +subtitle?: string, @@ -23,7 +29,7 @@ +modalHeaderCentered?: boolean, +secondaryHeaderButton?: React.Node, +subheader?: React.Node, - +primaryButton?: React.Node, + ...ModalButtons, }; type ModalProps = { @@ -44,6 +50,7 @@ secondaryHeaderButton, subheader, primaryButton, + secondaryButton, } = props; const modalContainerClasses = classNames(css.modalContainer, { @@ -107,13 +114,19 @@ return
; } - const className = classNames( - css.buttonContainer, - css.primaryButtonContainer, - ); + const className = classNames({ + [css.buttonContainer]: true, + [css.primaryButtonContainer]: !secondaryButton, + [css.primarySecondaryContainer]: secondaryButton, + }); - return