feat(client): ts-migrate Challenges/components/ (#42582)
Co-authored-by: Parth Parth <thecodingaviator@users.noreply.github.com>
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
ea4eeee49e
commit
1e86063f04
@ -16,7 +16,7 @@ import LearnLayout from '../../../components/layouts/Learn';
|
|||||||
import MultifileEditor from './MultifileEditor';
|
import MultifileEditor from './MultifileEditor';
|
||||||
import Preview from '../components/Preview';
|
import Preview from '../components/Preview';
|
||||||
import SidePanel from '../components/Side-Panel';
|
import SidePanel from '../components/Side-Panel';
|
||||||
import Output from '../components/Output';
|
import Output from '../components/output';
|
||||||
import CompletionModal from '../components/completion-modal';
|
import CompletionModal from '../components/completion-modal';
|
||||||
import HelpModal from '../components/HelpModal';
|
import HelpModal from '../components/HelpModal';
|
||||||
import VideoModal from '../components/VideoModal';
|
import VideoModal from '../components/VideoModal';
|
||||||
@ -290,6 +290,7 @@ class ShowClassic extends Component<ShowClassicProps, ShowClassicState> {
|
|||||||
renderEditor() {
|
renderEditor() {
|
||||||
const { files } = this.props;
|
const { files } = this.props;
|
||||||
const { description } = this.getChallenge();
|
const { description } = this.getChallenge();
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
||||||
return (
|
return (
|
||||||
files && (
|
files && (
|
||||||
<MultifileEditor
|
<MultifileEditor
|
||||||
|
@ -1,17 +1,16 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import sanitizeHtml from 'sanitize-html';
|
import sanitizeHtml from 'sanitize-html';
|
||||||
|
|
||||||
import './output.css';
|
import './output.css';
|
||||||
import { isEmpty } from 'lodash-es';
|
import { isEmpty } from 'lodash-es';
|
||||||
|
|
||||||
const propTypes = {
|
interface OutputProps {
|
||||||
defaultOutput: PropTypes.string,
|
defaultOutput: string;
|
||||||
output: PropTypes.arrayOf(PropTypes.string)
|
output: string[];
|
||||||
};
|
}
|
||||||
|
|
||||||
class Output extends Component {
|
class Output extends Component<OutputProps> {
|
||||||
render() {
|
render(): JSX.Element {
|
||||||
const { output, defaultOutput } = this.props;
|
const { output, defaultOutput } = this.props;
|
||||||
const message = sanitizeHtml(
|
const message = sanitizeHtml(
|
||||||
!isEmpty(output) ? output.join('\n') : defaultOutput,
|
!isEmpty(output) ? output.join('\n') : defaultOutput,
|
||||||
@ -28,7 +27,4 @@ class Output extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Output.displayName = 'Output';
|
|
||||||
Output.propTypes = propTypes;
|
|
||||||
|
|
||||||
export default Output;
|
export default Output;
|
@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||||
// Package Utilities
|
// Package Utilities
|
||||||
@ -26,7 +27,7 @@ import LearnLayout from '../../../../components/layouts/Learn';
|
|||||||
import ChallengeTitle from '../../components/challenge-title';
|
import ChallengeTitle from '../../components/challenge-title';
|
||||||
import ChallengeDescription from '../../components/Challenge-Description';
|
import ChallengeDescription from '../../components/Challenge-Description';
|
||||||
import TestSuite from '../../components/Test-Suite';
|
import TestSuite from '../../components/Test-Suite';
|
||||||
import Output from '../../components/Output';
|
import Output from '../../components/output';
|
||||||
import CompletionModal from '../../components/completion-modal';
|
import CompletionModal from '../../components/completion-modal';
|
||||||
import HelpModal from '../../components/HelpModal';
|
import HelpModal from '../../components/HelpModal';
|
||||||
import ProjectToolPanel from '../Tool-Panel';
|
import ProjectToolPanel from '../Tool-Panel';
|
||||||
@ -249,8 +250,6 @@ class BackEnd extends Component<BackEndProps> {
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/`}
|
*/`}
|
||||||
dimensions={this.state}
|
|
||||||
height={150}
|
|
||||||
output={output}
|
output={output}
|
||||||
/>
|
/>
|
||||||
<TestSuite tests={tests} />
|
<TestSuite tests={tests} />
|
||||||
|
Reference in New Issue
Block a user