Skip to content

PROD-2585 - Fix issue with fcc reserved & get help link #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions client/src/templates/Challenges/classic/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ interface EditorProps {
usesMultifileEditor: boolean;
isChallengeCompleted: boolean;
testsRunning: boolean;
showRightsReserved?: boolean;
}

// TODO: this is grab bag of unrelated properties. There's no need for them to
Expand Down Expand Up @@ -1128,16 +1129,18 @@ const Editor = (props: EditorProps): JSX.Element => {
theme={editorTheme}
/>
</span>
<div className='all-rights-link'>
<a
href='https://www.freecodecamp.org/'
target='_blank'
rel='noreferrer'
>
© {currentYear}, freeCodeCamp. All rights reserved.
<ExternalLink />
</a>
</div>
{props.showRightsReserved && (
<div className='all-rights-link'>
<a
href='https://www.freecodecamp.org/'
target='_blank'
rel='noreferrer'
>
© {currentYear}, freeCodeCamp. All rights reserved.
<ExternalLink />
</a>
</div>
)}
</Suspense>
);
};
Expand Down
4 changes: 3 additions & 1 deletion client/src/templates/Challenges/classic/multifile-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ interface MultifileEditorProps {
resizeProps: ResizeProps;
title: string;
showProjectPreview: boolean;
showRightsReserved?: boolean;
usesMultifileEditor: boolean;
visibleEditors: {
indexhtml?: boolean;
Expand Down Expand Up @@ -121,7 +122,7 @@ const MultifileEditor = (props: MultifileEditorProps) => {
>
<ReflexElement flex={10} {...reflexProps} {...resizeProps}>
<ReflexContainer orientation='vertical'>
{editorAndSplitterKeys.map(key => {
{editorAndSplitterKeys.map((key, i) => {
const isSplitter = key.endsWith('-splitter');
if (isSplitter) {
return (
Expand All @@ -147,6 +148,7 @@ const MultifileEditor = (props: MultifileEditorProps) => {
title={title}
usesMultifileEditor={usesMultifileEditor}
showProjectPreview={showProjectPreview}
showRightsReserved={props.showRightsReserved && !i}
/>
</ReflexElement>
);
Expand Down
5 changes: 3 additions & 2 deletions client/src/templates/Challenges/classic/show.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ class ShowClassic extends Component<ShowClassicProps, ShowClassicState> {
);
}

renderEditor() {
renderEditor(hasEditableBoundaries?: boolean) {
const {
pageContext: {
projectPreview: { showProjectPreview }
Expand Down Expand Up @@ -376,6 +376,7 @@ class ShowClassic extends Component<ShowClassicProps, ShowClassicState> {
title={title}
usesMultifileEditor={usesMultifileEditor}
showProjectPreview={showProjectPreview}
showRightsReserved={hasEditableBoundaries}
/>
)
);
Expand Down Expand Up @@ -465,7 +466,7 @@ class ShowClassic extends Component<ShowClassicProps, ShowClassicState> {
block={block}
challengeFiles={challengeFiles}
challengeType={challengeType}
editor={this.renderEditor()}
editor={this.renderEditor(hasEditableBoundaries)}
hasEditableBoundaries={hasEditableBoundaries}
hasNotes={!!notes}
hasPreview={this.hasPreview()}
Expand Down
40 changes: 0 additions & 40 deletions client/src/templates/Challenges/components/tool-panel.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {
Button,
DropdownButton,
MenuItem
} from '@freecodecamp/react-bootstrap';
import React from 'react';
import { useTranslation } from 'react-i18next';
Expand Down Expand Up @@ -68,11 +66,7 @@ function ToolPanel({
isMobile,
isSignedIn,
isRunningTests,
openHelpModal,
openVideoModal,
openResetModal,
guideUrl,
videoUrl,
challengeIsCompleted,
submitChallenge
}: ToolPanelProps) {
Expand Down Expand Up @@ -121,40 +115,6 @@ function ToolPanel({
{isMobile ? t('buttons.reset') : t('buttons.reset-code')}
</Button>
)}
<DropdownButton
bsStyle='link'
block={false}
className='btn-invert'
id='get-help-dropdown'
title={isMobile ? t('buttons.help') : t('buttons.get-help')}
>
{guideUrl ? (
<MenuItem
bsStyle='primary'
className='btn-invert'
href={guideUrl}
target='_blank'
>
{t('buttons.get-hint')}
</MenuItem>
) : null}
{videoUrl ? (
<MenuItem
bsStyle='primary'
className='btn-invert'
onClick={openVideoModal}
>
{t('buttons.watch-video')}
</MenuItem>
) : null}
<MenuItem
bsStyle='primary'
className='btn-invert'
onClick={openHelpModal}
>
{t('buttons.ask-for-help')}
</MenuItem>
</DropdownButton>
</div>
);
}
Expand Down