@@ -11,17 +11,18 @@ import {
1111 Progress ,
1212 Stack ,
1313 Text ,
14+ Textarea ,
1415 useToast ,
1516 VStack ,
1617} from "@chakra-ui/react" ;
17- import { useWeb3React } from "@web3-react/core" ;
18+
1819import CodeEditorPreview from "components/custom/CodeEditorPreview" ;
1920import ImageDropzone from "components/custom/ImageDropzone" ;
2021import { REQUIRED_FIELD_LABEL } from "core/constants" ;
2122import { blobToDataURL } from "core/helpers" ;
2223import useCustomColor from "core/hooks/useCustomColor" ;
2324import { GET_APP_DID } from "graphql/app" ;
24- import dynamic from "next/dynamic" ;
25+ // import dynamic from "next/dynamic";
2526import { useContext , useState } from "react" ;
2627import { useForm } from "react-hook-form" ;
2728import { Web3Context } from "../../../../contexts/Web3Context" ;
@@ -31,9 +32,9 @@ import {
3132 SUBMIT_QUEST_SOLUTION_MUTATION ,
3233} from "../../../../graphql/quests" ;
3334
34- const CodeEditor = dynamic ( ( ) => import ( "@uiw/react-textarea-code-editor" ) , {
35- ssr : false ,
36- } ) ;
35+ // const CodeEditor = dynamic(() => import("@uiw/react-textarea-code-editor"), {
36+ // ssr: false,
37+ // });
3738
3839function BountyForm ( { questId, pathwayId, successCallback } : any ) {
3940 const toast = useToast ( ) ;
@@ -46,7 +47,7 @@ function BountyForm({ questId, pathwayId, successCallback }: any) {
4647 const { self } = useContext ( Web3Context ) ;
4748
4849 const [ code , setCode ] = useState < string > ( ) ;
49- const { codeEditorScheme } = useCustomColor ( ) ;
50+ // const { codeEditorScheme } = useCustomColor();
5051
5152 const [ isLoading , setIsLoading ] = useState ( false ) ;
5253
@@ -179,7 +180,18 @@ function BountyForm({ questId, pathwayId, successCallback }: any) {
179180 < VStack as = "form" >
180181 < FormControl isInvalid = { errors . solution } >
181182 < FormLabel htmlFor = "solution" > Your Solution</ FormLabel >
182- < CodeEditor
183+ < Textarea
184+ placeholder = "Quest solution"
185+ { ...register ( "solution" , {
186+ required : REQUIRED_FIELD_LABEL ,
187+ } ) }
188+ onChange = { ( e ) => {
189+ const { name } = e . target ;
190+ setCode ( e . target . value ) ;
191+ setValue ( name , e . target . value ) ;
192+ } }
193+ />
194+ { /* <CodeEditor
183195 value={code}
184196 language="markdown"
185197 placeholder="Quest solution (markdown)"
@@ -196,7 +208,7 @@ function BountyForm({ questId, pathwayId, successCallback }: any) {
196208 }}
197209 className={codeEditorScheme}
198210 padding={15}
199- />
211+ /> */ }
200212 < FormErrorMessage >
201213 { errors . solution && errors . solution . message }
202214 </ FormErrorMessage >
0 commit comments