chore: use new c-sharp help category (#51417)

Co-authored-by: mot01 <tmondloch01@gmail.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
Naomi Carrigan
2023-09-11 10:46:51 -07:00
committed by GitHub
co-authored by mot01 Oliver Eyton-Williams
parent 3c6189ace0
commit e32a88a6db
13 changed files with 86 additions and 17 deletions
@@ -17,6 +17,7 @@ import ChallengeDescription from '../components/challenge-description';
import Hotkeys from '../components/hotkeys';
import ChallengeTitle from '../components/challenge-title';
import CompletionModal from '../components/completion-modal';
import HelpModal from '../components/help-modal';
import {
challengeMounted,
updateChallengeMeta,
@@ -55,6 +56,7 @@ const mapDispatchToProps = (dispatch: Dispatch) =>
challengeMounted,
updateSolutionFormValues,
openCompletionModal: () => openModal('completion'),
openHelpModal: () => openModal('help'),
setIsProcessing,
submitChallenge
},
@@ -70,6 +72,7 @@ interface MsTrophyProps {
setIsProcessing: (arg0: boolean) => void;
msUsername: string | undefined | null;
openCompletionModal: () => void;
openHelpModal: () => void;
pageContext: {
challengeMeta: ChallengeMeta;
};
@@ -92,7 +95,7 @@ class MsTrophy extends Component<MsTrophyProps> {
challengeMounted,
data: {
challengeNode: {
challenge: { title, challengeType }
challenge: { title, challengeType, helpCategory }
}
},
pageContext: { challengeMeta },
@@ -101,7 +104,8 @@ class MsTrophy extends Component<MsTrophyProps> {
updateChallengeMeta({
...challengeMeta,
title,
challengeType
challengeType,
helpCategory
});
challengeMounted(challengeMeta.id);
this._container?.focus();
@@ -119,7 +123,7 @@ class MsTrophy extends Component<MsTrophyProps> {
challengeMounted,
data: {
challengeNode: {
challenge: { title: currentTitle, challengeType }
challenge: { title: currentTitle, challengeType, helpCategory }
}
},
pageContext: { challengeMeta },
@@ -129,7 +133,8 @@ class MsTrophy extends Component<MsTrophyProps> {
updateChallengeMeta({
...challengeMeta,
title: currentTitle,
challengeType
challengeType,
helpCategory
});
challengeMounted(challengeMeta.id);
}
@@ -152,13 +157,15 @@ class MsTrophy extends Component<MsTrophyProps> {
instructions,
superBlock,
block,
translationPending
translationPending,
fields: { blockName }
}
}
},
isChallengeCompleted,
isProcessing,
msUsername,
openHelpModal,
pageContext: {
challengeMeta: { nextChallengePath, prevChallengePath }
},
@@ -204,10 +211,19 @@ class MsTrophy extends Component<MsTrophyProps> {
>
{t('buttons.verify-trophy')}
</Button>
<Button
block={true}
bsStyle='primary'
className='btn-invert'
onClick={openHelpModal}
>
{t('buttons.ask-for-help')}
</Button>
<br />
<Spacer size='medium' />
</Col>
<CompletionModal />
<HelpModal challengeTitle={title} challengeBlock={blockName} />
</Row>
</Container>
</LearnLayout>
@@ -231,9 +247,13 @@ export const query = graphql`
description
instructions
challengeType
helpCategory
superBlock
block
translationPending
fields {
blockName
}
}
}
}
+16 -2
View File
@@ -23,6 +23,7 @@ import Hotkeys from '../components/hotkeys';
import VideoPlayer from '../components/video-player';
import ChallengeTitle from '../components/challenge-title';
import CompletionModal from '../components/completion-modal';
import HelpModal from '../components/help-modal';
import PrismFormatted from '../components/prism-formatted';
import {
challengeMounted,
@@ -48,7 +49,8 @@ const mapDispatchToProps = (dispatch: Dispatch) =>
updateChallengeMeta,
challengeMounted,
updateSolutionFormValues,
openCompletionModal: () => openModal('completion')
openCompletionModal: () => openModal('completion'),
openHelpModal: () => openModal('help')
},
dispatch
);
@@ -60,6 +62,7 @@ interface ShowVideoProps {
description: string;
isChallengeCompleted: boolean;
openCompletionModal: () => void;
openHelpModal: () => void;
pageContext: {
challengeMeta: ChallengeMeta;
};
@@ -188,11 +191,13 @@ class ShowVideo extends Component<ShowVideoProps, ShowVideoState> {
videoId,
videoLocaleIds,
bilibiliIds,
fields: { blockName },
question: { text, answers, solution }
}
}
},
openCompletionModal,
openHelpModal,
pageContext: {
challengeMeta: { nextChallengePath, prevChallengePath }
},
@@ -293,7 +298,6 @@ class ShowVideo extends Component<ShowVideoProps, ShowVideoState> {
<Spacer size='medium' />
<Button
block={true}
bsSize='large'
bsStyle='primary'
onClick={() =>
this.handleSubmit(solution, openCompletionModal)
@@ -301,9 +305,18 @@ class ShowVideo extends Component<ShowVideoProps, ShowVideoState> {
>
{t('buttons.check-answer')}
</Button>
<Button
block={true}
bsStyle='primary'
className='btn-invert'
onClick={openHelpModal}
>
{t('buttons.ask-for-help')}
</Button>
<Spacer size='large' />
</Col>
<CompletionModal />
<HelpModal challengeTitle={title} challengeBlock={blockName} />
</Row>
</Container>
</LearnLayout>
@@ -341,6 +354,7 @@ export const query = graphql`
superBlock
block
fields {
blockName
slug
}
question {