From d1272f91eba21238a6a18fde56edd59003a1bde8 Mon Sep 17 00:00:00 2001 From: SalmanAd01 Date: Thu, 9 Feb 2023 23:44:40 +0530 Subject: [PATCH] fix the test solution language select menu --- .../admin/testProblem/TestProblem.jsx | 27 ++++++++----------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/Components/admin/testProblem/TestProblem.jsx b/src/Components/admin/testProblem/TestProblem.jsx index e670fde3e..250e3a7ed 100644 --- a/src/Components/admin/testProblem/TestProblem.jsx +++ b/src/Components/admin/testProblem/TestProblem.jsx @@ -1,12 +1,13 @@ import React, { useState } from 'react'; import { useParams } from 'react-router-dom'; -import Select, { Option } from '@material/react-select'; +import Select from '@material/react-select'; import { Headline4, Body2 } from '@material/react-typography'; import Button from '@material/react-button'; import MessageCard from '../../common/MessageCard/index'; import FileUpload from '../../common/FileUpload/index'; import useSessionExpired from '../../../customHooks/useSessionExpired'; import useSentry from '../../../customHooks/useSentry'; +import { languageOptions } from '../../drawer/contests/status/options'; const TestProblem = () => { const [language, setLanguage] = useState('C'); @@ -16,7 +17,6 @@ const TestProblem = () => { const [messageType, setMessageType] = useState(''); const { redirectOnSessionExpiredAfterRender, isSessionExpired } = useSessionExpired(); const [solutionFile, setSolutionFile] = useState({}); - const onLanguageChange = (index, item) => setLanguage(item.getAttribute('data-value')); const onFileChange = (event) => { setSolutionFile(event.target.files[0]); }; @@ -61,22 +61,17 @@ const TestProblem = () => { {problemId} + options={languageOptions} + onChange={(e) => { + setLanguage(e.target.value); + }} + />