From 34bf14ebae62dde3c8f41732acab9f60cff504d6 Mon Sep 17 00:00:00 2001 From: Ben Warzeski Date: Mon, 11 Dec 2023 14:21:34 -0500 Subject: [PATCH] fix: step instructions, exit-without-save, margins * fix: default instructions to use view step * chore: add margin to info popover button * fix: exit without saving button message --- src/components/InfoPopover/index.jsx | 2 +- src/components/Instructions/useInstructionsMessage.jsx | 7 +++++-- src/hooks/actions/useExitWithoutSavingAction.js | 7 ++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/InfoPopover/index.jsx b/src/components/InfoPopover/index.jsx index 0c309855..5f51b3ea 100644 --- a/src/components/InfoPopover/index.jsx +++ b/src/components/InfoPopover/index.jsx @@ -32,7 +32,7 @@ export const InfoPopover = ({ onClick, children }) => { )} > { const { formatMessage } = useIntl(); + const viewStep = useViewStep(); const { activeStepName, effectiveGrade, stepState, } = useGlobalState(); - const stepName = step || activeStepName; + const stepName = (viewStep === stepNames.xblock) ? activeStepName : viewStep; if (step || stepState !== stepStates.inProgress || stepName === stepNames.staff) { return null; } diff --git a/src/hooks/actions/useExitWithoutSavingAction.js b/src/hooks/actions/useExitWithoutSavingAction.js index c5c7fbfa..26613589 100644 --- a/src/hooks/actions/useExitWithoutSavingAction.js +++ b/src/hooks/actions/useExitWithoutSavingAction.js @@ -7,14 +7,11 @@ import messages, { confirmTitles, confirmDescriptions } from './messages'; const useExitWithoutSavingAction = () => { const { formatMessage } = useIntl(); - const closeAction = useCloseAction(messages.finishLater); + const closeAction = useCloseAction(messages.exitWithoutSaving); const confirmAction = useConfirmAction(); return confirmAction({ - action: { - ...closeAction, - children: formatMessage(messages.exitWithoutSaving), - }, + action: closeAction, title: formatMessage(confirmTitles.exit), description: formatMessage(confirmDescriptions.exit), });