diff --git a/web/modals/unsaved-changes-modal.css b/web/modals/unsaved-changes-modal.css --- a/web/modals/unsaved-changes-modal.css +++ b/web/modals/unsaved-changes-modal.css @@ -4,17 +4,7 @@ display: flex; align-items: center; justify-content: center; - margin: 0 50px; -} - -.unsavedChangesModalButtons { - width: 100%; - display: flex; - flex-direction: row; - justify-content: flex-end; - align-self: center; - align-items: stretch; - margin: 16px 64px 16px 0; + margin-bottom: 16px; } .unsavedChangesCloseModalButton { diff --git a/web/modals/unsaved-changes-modal.react.js b/web/modals/unsaved-changes-modal.react.js --- a/web/modals/unsaved-changes-modal.react.js +++ b/web/modals/unsaved-changes-modal.react.js @@ -9,7 +9,6 @@ import Button, { buttonThemes } from '../components/button.react.js'; function UnsavedChangesModal(): React.Node { - const modalName = ''; const { popModal } = useModalContext(); const onCloseModalClick = React.useCallback(() => { @@ -18,36 +17,52 @@ popModal(); }, [popModal]); - return ( - - - You have unsaved changes, are you sure you want to close the modal? You - will lose all your progress. - - - - Back - - - Close Modal - - - + const primaryButton = React.useMemo( + () => ( + + Close Modal + + ), + [onCloseModalClick], ); + + const secondaryButton = React.useMemo( + () => ( + + Back + + ), + [popModal], + ); + + const unsavedChangesModal = React.useMemo( + () => ( + + + You have unsaved changes. Are you sure you want to close the modal? + You will lose all your progress. + + + ), + [popModal, primaryButton, secondaryButton], + ); + + return unsavedChangesModal; } export default UnsavedChangesModal;