diff --git a/src/components/Instructions/index.jsx b/src/components/Instructions/index.jsx index accd341c..f8617909 100644 --- a/src/components/Instructions/index.jsx +++ b/src/components/Instructions/index.jsx @@ -2,8 +2,11 @@ import React from 'react'; import { useIntl } from '@edx/frontend-platform/i18n'; -import { stepStates } from 'constants/index'; -import { useStepState } from 'hooks/app'; +import { stepNames, stepStates } from 'constants/index'; + +import { useGlobalState } from 'hooks/app'; +import { useViewStep } from 'hooks/routing'; +import { isXblockStep } from 'utils'; import useInstructionsMessage from './useInstructionsMessage'; @@ -12,13 +15,18 @@ import messages from './messages'; const Instructions = () => { const { formatMessage } = useIntl(); const message = useInstructionsMessage(); - const stepState = useStepState({}); - if (stepState !== stepStates.inProgress) { + const viewStep = useViewStep(); + const { activeStepName, stepState } = useGlobalState(); + const stepName = isXblockStep(viewStep) ? activeStepName : viewStep; + if (stepState !== stepStates.inProgress || stepName === stepNames.staff) { return null; } return (
{formatMessage(messages.instructions)}: {message}
++ {formatMessage(messages.instructions)}: + {message} +