diff --git a/client/src/templates/Challenges/components/Challenge-Description.js b/client/src/templates/Challenges/components/Challenge-Description.js deleted file mode 100644 index 36e335a702..0000000000 --- a/client/src/templates/Challenges/components/Challenge-Description.js +++ /dev/null @@ -1,31 +0,0 @@ -import React, { Fragment } from 'react'; -import PropTypes from 'prop-types'; - -import PrismFormatted from './PrismFormatted'; -import './challenge-description.css'; - -const propTypes = { - block: PropTypes.string, - description: PropTypes.string, - instructions: PropTypes.string -}; - -function ChallengeDescription({ description, instructions, block }) { - return ( -
- {description && } - {instructions && ( - -
- -
- )} -
-
- ); -} - -ChallengeDescription.displayName = 'ChallengeDescription'; -ChallengeDescription.propTypes = propTypes; - -export default ChallengeDescription; diff --git a/client/src/templates/Challenges/components/Challenge-Description.tsx b/client/src/templates/Challenges/components/Challenge-Description.tsx new file mode 100644 index 0000000000..6364299769 --- /dev/null +++ b/client/src/templates/Challenges/components/Challenge-Description.tsx @@ -0,0 +1,33 @@ +import React, { Fragment } from 'react'; + +import PrismFormatted from './PrismFormatted'; +import './challenge-description.css'; + +type Challenge = { + block: string; + description: string; + instructions: string; +}; + +function ChallengeDescription(challenge: Challenge): JSX.Element { + return ( +
+ {challenge.description && } + {challenge.instructions && ( + +
+ +
+ )} +
+
+ ); +} + +ChallengeDescription.displayName = 'ChallengeDescription'; + +export default ChallengeDescription;