Skip to content

Commit

Permalink
fix: step instructions, exit-without-save, margins
Browse files Browse the repository at this point in the history
* fix: default instructions to use view step

* chore: add margin to info popover button

* fix: exit without saving button message
  • Loading branch information
muselesscreator authored Dec 11, 2023
1 parent 78cbb8f commit 34bf14e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/components/InfoPopover/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const InfoPopover = ({ onClick, children }) => {
)}
>
<IconButton
className="ml-2 esg-help-icon"
className="ml-2 mb-2 esg-help-icon"
src={InfoOutline}
alt={formatMessage(messages.altText)}
iconAs={Icon}
Expand Down
7 changes: 5 additions & 2 deletions src/components/Instructions/useInstructionsMessage.jsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import { useIntl } from '@edx/frontend-platform/i18n';

import { useGlobalState } from 'hooks/app';
import { stepNames, stepStates } from 'constants';

import { useGlobalState } from 'hooks/app';
import { useViewStep } from 'hooks/routing';

import messages from './messages';

const useInstructionsMessage = (step = null) => {
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;
}
Expand Down
7 changes: 2 additions & 5 deletions src/hooks/actions/useExitWithoutSavingAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
});
Expand Down

0 comments on commit 34bf14e

Please sign in to comment.