Skip to content

Commit

Permalink
render challenges in admin panel
Browse files Browse the repository at this point in the history
  • Loading branch information
Aplet123 committed Feb 18, 2024
1 parent bf5dfbf commit 95f503f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions client/src/components/admin/problem.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import Modal from '../../components/modal'
import { updateChallenge, deleteChallenge, uploadFiles } from '../../api/admin/challs'
import { useToast } from '../../components/toast'
import { encodeFile } from '../../util'
import Markdown from '../markdown'

const ExternalLink = (props) => <a {...props} target='_blank' />

const markdownComponents = {
A: ExternalLink
}

const DeleteModal = withStyles({
modalBody: {
Expand Down Expand Up @@ -272,6 +279,11 @@ const Problem = ({ classes, problem, update: updateClient }) => {
/>
</div>

<div>
<p>Rendered:</p>
<Markdown content={description} components={markdownComponents} />
</div>

{
problem.files.length !== 0 &&
<div>
Expand Down

0 comments on commit 95f503f

Please sign in to comment.