diff --git a/client/i18n/locales/english/translations.json b/client/i18n/locales/english/translations.json index b5fca7e722b..7197490b091 100644 --- a/client/i18n/locales/english/translations.json +++ b/client/i18n/locales/english/translations.json @@ -9,6 +9,7 @@ "edit": "Edit", "copy": "Copy", "view": "View", + "submit-continue": "Submit and continue", "view-code": "View Code", "view-project": "View Project", "view-cert-title": "View {{certTitle}}", @@ -60,6 +61,8 @@ "check-code": "Check Your Code", "check-code-ctrl": "Check Your Code (Ctrl + Enter)", "check-code-cmd": "Check Your Code (Command + Enter)", + "command-enter": "⌘ + Enter", + "ctrl-enter": "Ctrl + Enter", "reset": "Reset", "reset-step": "Reset This Step", "help": "Help", @@ -427,6 +430,7 @@ "ms-link": "Microsoft Link", "submit-and-go": "Submit and go to my next challenge", "congratulations": "Congratulations, your code passes. Submit your code to continue.", + "congratulations-code-passes": "✔ Congratulations. Your code passes.", "i-completed": "I've completed this challenge", "example-code": "Example Code", "test-output": "Your test output will go here", diff --git a/client/src/templates/Challenges/classic/action-row.tsx b/client/src/templates/Challenges/classic/action-row.tsx index 34893d4ceb8..23889729e34 100644 --- a/client/src/templates/Challenges/classic/action-row.tsx +++ b/client/src/templates/Challenges/classic/action-row.tsx @@ -7,7 +7,7 @@ import EditorTabs from './editor-tabs'; interface ActionRowProps { hasNotes: boolean; hasPreview: boolean; - isProjectBasedChallenge: boolean; + areInstructionsDisplayable: boolean; showConsole: boolean; showNotes: boolean; showInstructions: boolean; @@ -25,7 +25,7 @@ const ActionRow = ({ showPreviewPortal, showConsole, showInstructions, - isProjectBasedChallenge + areInstructionsDisplayable }: ActionRowProps): JSX.Element => { const { t } = useTranslation(); @@ -54,7 +54,7 @@ const ActionRow = ({ return (
- {!isProjectBasedChallenge && ( + {areInstructionsDisplayable && ( +
+ )} + {isChallengeComplete && showSubmissionHint && ( +
+
+

{t('learn.congratulations-code-passes')}

+ {!isSignedIn && ( + { + callGA({ + event: 'sign_in' + }); + }} + > + {t('learn.sign-in-save')} + + )} +
+ +
+ )} + +
+
+ {isChallengeComplete ? ( + + ) : ( + + )} +
+
+ + +
+
+
+ ); +} + +IndependentLowerJaw.displayName = 'IndependentLowerJaw'; + +export default connect( + mapStateToProps, + mapDispatchToProps +)(IndependentLowerJaw); diff --git a/client/src/templates/Challenges/components/side-panel.tsx b/client/src/templates/Challenges/components/side-panel.tsx index dbf8680e3c8..a52b7043dab 100644 --- a/client/src/templates/Challenges/components/side-panel.tsx +++ b/client/src/templates/Challenges/components/side-panel.tsx @@ -8,6 +8,7 @@ import { Test } from '../../../redux/prop-types'; import { challengeTestsSelector } from '../redux/selectors'; import { openModal } from '../redux/actions'; import TestSuite from './test-suite'; +import IndependentLowerJaw from './independent-lower-jaw'; import './side-panel.css'; @@ -34,6 +35,7 @@ interface SidePanelProps extends DispatchProps, StateProps { hasDemo: boolean; toolPanel: ReactNode; tests: Test[]; + showIndependentLowerJaw: boolean; } export function SidePanel({ @@ -43,37 +45,45 @@ export function SidePanel({ hasDemo, toolPanel, tests, - openModal + openModal, + showIndependentLowerJaw }: SidePanelProps): JSX.Element { return ( -
- {challengeTitle} - {hasDemo && ( -

- - openModal('projectPreview')} - role='button' - tabIndex={0} - onKeyDown={e => { - if (e.key === 'Enter' || e.key === ' ') { - openModal('projectPreview'); - } - }} - > - -

- )} - {challengeDescription} - - {toolPanel} - -
+ <> +
+ {challengeTitle} + {hasDemo && ( +

+ + openModal('projectPreview')} + role='button' + tabIndex={0} + onKeyDown={e => { + if (e.key === 'Enter' || e.key === ' ') { + openModal('projectPreview'); + } + }} + > + +

+ )}{' '} + {challengeDescription} + {!showIndependentLowerJaw && ( + <> + + {toolPanel} + + + )} +
+ {showIndependentLowerJaw && } + ); }