Skip to content

Commit fe6e875

Browse files
committed
hot fix for CodeEditor
1 parent 4a53866 commit fe6e875

8 files changed

Lines changed: 73 additions & 48 deletions

File tree

packages/dapp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"react-icons": "^4.3.1",
8989
"react-markdown": "^7.0.0",
9090
"react-parallax-tilt": "^1.5.73",
91-
"siwe": "^2.0.1",
91+
"siwe": "^1.1.6",
9292
"states-cities-db": "^1.4.1",
9393
"tiny-invariant": "^1.2.0",
9494
"uint8arrays": "^3.0.0",

packages/dapp/src/components/projects/CreateProjectForm.tsx

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ import {
1414
InputGroup,
1515
InputLeftAddon,
1616
Text,
17+
Textarea,
1718
} from "@chakra-ui/react";
1819
import CodeEditorPreview from "components/custom/CodeEditorPreview";
19-
import useCustomColor from "core/hooks/useCustomColor";
20-
import dynamic from "next/dynamic";
20+
// import useCustomColor from "core/hooks/useCustomColor";
21+
// import dynamic from "next/dynamic";
2122
import { useEffect, useState } from "react";
2223
import { useFormContext } from "react-hook-form";
2324

@@ -29,12 +30,12 @@ import ControlledSelect from "../Inputs/ControlledSelect";
2930

3031
import LogoDropzone from "./LogoDropzone";
3132

32-
const CodeEditor = dynamic(() => import("@uiw/react-textarea-code-editor"), {
33-
ssr: false,
34-
});
33+
// const CodeEditor = dynamic(() => import("@uiw/react-textarea-code-editor"), {
34+
// ssr: false,
35+
// });
3536
const CreateProjectForm = () => {
3637
const [code, setCode] = useState<string>();
37-
const { codeEditorScheme } = useCustomColor();
38+
// const { codeEditorScheme } = useCustomColor();
3839
const { data, loading, error } = useQuery(ALL_TAGS_QUERY);
3940
const {
4041
register,
@@ -106,7 +107,8 @@ const CreateProjectForm = () => {
106107

107108
<FormControl isInvalid={errors.description}>
108109
<FormLabel htmlFor="description">Markdown Description</FormLabel>
109-
<CodeEditor
110+
{/* TODO: fix types for CodeEditor
111+
<CodeEditor
110112
value={code}
111113
language="markdown"
112114
placeholder="Project description"
@@ -123,6 +125,13 @@ const CreateProjectForm = () => {
123125
}}
124126
className={codeEditorScheme}
125127
padding={15}
128+
/>
129+
*/}
130+
<Textarea
131+
placeholder="Project description"
132+
{...register("description", {
133+
required: REQUIRED_FIELD_LABEL,
134+
})}
126135
/>
127136
<FormErrorMessage>
128137
{errors.description && errors.description.message}

packages/dapp/src/components/projects/EditProjectForm.tsx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,27 @@ import {
1111
AlertIcon,
1212
AlertTitle,
1313
Spinner,
14+
Textarea,
1415
} from "@chakra-ui/react";
1516
import { useFormContext } from "react-hook-form";
16-
import dynamic from "next/dynamic";
17+
// import dynamic from "next/dynamic";
18+
// import useCustomColor from "core/hooks/useCustomColor";
1719
import { useState, useEffect } from "react";
1820

1921
import CodeEditorPreview from "components/custom/CodeEditorPreview";
20-
import useCustomColor from "core/hooks/useCustomColor";
2122
import { Tag } from "../../core/types";
2223
import { ALL_TAGS_QUERY } from "../../graphql/tags";
2324
import IconWithState from "../custom/IconWithState";
2425
import ControlledSelect from "../Inputs/ControlledSelect";
2526

2627
import LogoDropzone from "./LogoDropzone";
2728

28-
const CodeEditor = dynamic(() => import("@uiw/react-textarea-code-editor"), {
29-
ssr: false,
30-
});
29+
// const CodeEditor = dynamic(() => import("@uiw/react-textarea-code-editor"), {
30+
// ssr: false,
31+
// });
3132
const EditProjectForm: React.FunctionComponent = () => {
3233
const [code, setCode] = useState<string>();
33-
const { codeEditorScheme } = useCustomColor();
34+
// const { codeEditorScheme } = useCustomColor();
3435
const {
3536
register,
3637
setValue,
@@ -83,7 +84,11 @@ const EditProjectForm: React.FunctionComponent = () => {
8384

8485
<FormControl isInvalid={errors.description}>
8586
<FormLabel htmlFor="description">Description</FormLabel>
86-
<CodeEditor
87+
<Textarea
88+
placeholder="Project description"
89+
{...register("description")}
90+
/>
91+
{/* <CodeEditor
8792
value={code}
8893
language="markdown"
8994
placeholder="Project description"
@@ -103,7 +108,7 @@ const EditProjectForm: React.FunctionComponent = () => {
103108
}}
104109
className={codeEditorScheme}
105110
padding={15}
106-
/>
111+
/> */}
107112
<FormErrorMessage>
108113
{errors.description && errors.description.message}
109114
</FormErrorMessage>

packages/dapp/src/components/projects/pathways/PathwayForm.tsx

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ import {
1818
NumberInputStepper,
1919
Tag,
2020
Text,
21+
Textarea,
2122
VStack,
2223
} from "@chakra-ui/react";
2324
import { useWeb3React } from "@web3-react/core";
2425
import CodeEditorPreview from "components/custom/CodeEditorPreview";
25-
import useCustomColor from "core/hooks/useCustomColor";
26-
import dynamic from "next/dynamic";
26+
// import useCustomColor from "core/hooks/useCustomColor";
27+
// import dynamic from "next/dynamic";
2728
import { useEffect, useMemo, useState } from "react";
2829
import { useFormContext } from "react-hook-form";
2930
import {
@@ -34,13 +35,13 @@ import useTokenList from "../../../core/hooks/useTokenList";
3435
import ImageDropzone from "../../custom/ImageDropzone";
3536
import ControlledSelect from "../../Inputs/ControlledSelect";
3637

37-
const CodeEditor = dynamic(() => import("@uiw/react-textarea-code-editor"), {
38-
ssr: false,
39-
});
38+
// const CodeEditor = dynamic(() => import("@uiw/react-textarea-code-editor"), {
39+
// ssr: false,
40+
// });
4041

4142
export default function PathwayForm({ isWithRewards, withRewards }: any) {
4243
const [code, setCode] = useState<string>();
43-
const { codeEditorScheme } = useCustomColor();
44+
// const { codeEditorScheme } = useCustomColor();
4445

4546
const { chainId } = useWeb3React();
4647
const { tokens } = useTokenList();
@@ -161,7 +162,13 @@ export default function PathwayForm({ isWithRewards, withRewards }: any) {
161162

162163
<FormControl isInvalid={errors.description}>
163164
<FormLabel htmlFor="description">Description</FormLabel>
164-
<CodeEditor
165+
<Textarea
166+
placeholder="Pathway description"
167+
{...register("description", {
168+
required: REQUIRED_FIELD_LABEL,
169+
})}
170+
/>
171+
{/* <CodeEditor
165172
value={code}
166173
language="markdown"
167174
placeholder="Pathway description (markdown)"
@@ -178,7 +185,7 @@ export default function PathwayForm({ isWithRewards, withRewards }: any) {
178185
}}
179186
className={codeEditorScheme}
180187
padding={15}
181-
/>
188+
/> */}
182189
<FormErrorMessage>
183190
{errors.description && errors.description.message}
184191
</FormErrorMessage>

packages/dapp/src/components/projects/quests/QuestForm.tsx

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ import {
2323
useToast,
2424
VStack,
2525
Checkbox,
26+
Textarea,
2627
} from "@chakra-ui/react";
2728
import { useWeb3React } from "@web3-react/core";
2829
import CodeEditorPreview from "components/custom/CodeEditorPreview";
29-
import useCustomColor from "core/hooks/useCustomColor";
3030
import { Contract, ethers } from "ethers";
31-
import dynamic from "next/dynamic";
31+
// import useCustomColor from "core/hooks/useCustomColor";
32+
// import dynamic from "next/dynamic";
3233
import { useRouter } from "next/router";
3334
import { ChangeEvent, useContext, useEffect, useMemo, useState } from "react";
3435
import { useFormContext } from "react-hook-form";
@@ -92,17 +93,17 @@ const questTypeOptions = [
9293
},
9394
];
9495

95-
const CodeEditor = dynamic(() => import("@uiw/react-textarea-code-editor"), {
96-
ssr: false,
97-
});
96+
// const CodeEditor = dynamic(() => import("@uiw/react-textarea-code-editor"), {
97+
// ssr: false,
98+
// });
9899

99100
const CreateQuestForm: React.FunctionComponent = () => {
100101
const router = useRouter();
101102
const toast = useToast();
102103
const [code, setCode] = useState<string>();
103104
const [isWithRewards, setIsWithRewards] = useState<boolean>();
104105
const [submitStatus, setSubmitStatus] = useState<string>("Creating quest");
105-
const { codeEditorScheme } = useCustomColor();
106+
// const { codeEditorScheme } = useCustomColor();
106107
const { tokens } = useTokenList();
107108
const { library, chainId } = useWeb3React();
108109
const { self, account, contracts } = useContext(Web3Context);
@@ -498,7 +499,13 @@ const CreateQuestForm: React.FunctionComponent = () => {
498499

499500
<FormControl isInvalid={errors.description}>
500501
<FormLabel htmlFor="description">Description</FormLabel>
501-
<CodeEditor
502+
<Textarea
503+
placeholder="Quest description"
504+
{...register("description", {
505+
required: REQUIRED_FIELD_LABEL,
506+
})}
507+
/>
508+
{/* <CodeEditor
502509
value={code}
503510
language="markdown"
504511
placeholder="Quest description (markdown)"
@@ -515,7 +522,7 @@ const CreateQuestForm: React.FunctionComponent = () => {
515522
}}
516523
className={codeEditorScheme}
517524
padding={15}
518-
/>
525+
/> */}
519526
<FormErrorMessage>
520527
{errors.description && errors.description.message}
521528
</FormErrorMessage>

packages/dapp/src/pages/projects/create-project/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ function CreateProjectStepper() {
296296
{activeStep === 2 && (
297297
<Button
298298
ml="0.5rem"
299-
// colorScheme="accent"
299+
// colorScheme="accentDark"
300300
isLoading={methods.formState.isSubmitting}
301301
type="submit"
302302
px="1.25rem"

packages/server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"reflect-metadata": "^0.1.13",
6464
"rimraf": "^3.0.2",
6565
"rxjs": "^7.2.0",
66-
"siwe": "^2.0.1",
66+
"siwe": "^1.1.6",
6767
"subscriptions-transport-ws": "^0.9.19",
6868
"swagger-ui-express": "^4.1.6",
6969
"uint8arrays": "^2.1.10",

yarn.lock

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6494,14 +6494,12 @@
64946494
dependencies:
64956495
antlr4ts "^0.5.0-alpha.4"
64966496

6497-
"@spruceid/siwe-parser@2.0.0":
6498-
version "2.0.0"
6499-
resolved "https://registry.yarnpkg.com/@spruceid/siwe-parser/-/siwe-parser-2.0.0.tgz#fb316b9115e9116bac528c5cbfed18787119bede"
6500-
integrity sha512-zXlPBRKaT9ecxhhLQqn/StAWlXvQBlFDFnIAlM7ceMVx/1NVZZ65GdW9A28tYGbhpesYxNYpsqegGsBcrWuASg==
6497+
"@spruceid/siwe-parser@^1.1.3":
6498+
version "1.1.3"
6499+
resolved "https://registry.yarnpkg.com/@spruceid/siwe-parser/-/siwe-parser-1.1.3.tgz#0eebe8bbd63c6de89cb44c06b6329b00b305df65"
6500+
integrity sha512-oQ8PcwDqjGWJvLmvAF2yzd6iniiWxK0Qtz+Dw+gLD/W5zOQJiKIUXwslHOm8VB8OOOKW9vfR3dnPBhHaZDvRsw==
65016501
dependencies:
65026502
apg-js "^4.1.1"
6503-
uri-js "^4.4.1"
6504-
valid-url "^1.0.9"
65056503

65066504
"@stablelib/aead@^1.0.1":
65076505
version "1.0.1"
@@ -31238,15 +31236,14 @@ sisteransi@^1.0.5:
3123831236
resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed"
3123931237
integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==
3124031238

31241-
siwe@^2.0.1:
31242-
version "2.0.1"
31243-
resolved "https://registry.yarnpkg.com/siwe/-/siwe-2.0.1.tgz#4c1c6762bf39a3100fee882c59a2114c525adc47"
31244-
integrity sha512-4zMQZSR9pp3BR7w8c8N/ofGI71QIVK2a1+cyBzkPNWr0/DV9APmRFdZtg0lkiEemGCFtFyTy/h6f90tG/GFH5w==
31239+
siwe@^1.1.6:
31240+
version "1.1.6"
31241+
resolved "https://registry.yarnpkg.com/siwe/-/siwe-1.1.6.tgz#b4b4fe7814654d5ea529171b2ede15f7ef7ef1ae"
31242+
integrity sha512-3WRdEil32Tc2vuNzqJ2/Z/MIvsvy0Nkzc2ov+QujmpHO7tM83dgcb47z0Pu236T4JQkOQCqQkq3AJ/rVIezniA==
3124531243
dependencies:
31246-
"@spruceid/siwe-parser" "2.0.0"
31244+
"@spruceid/siwe-parser" "^1.1.3"
3124731245
"@stablelib/random" "^1.0.1"
31248-
uri-js "^4.4.1"
31249-
valid-url "^1.0.9"
31246+
apg-js "^4.1.1"
3125031247

3125131248
size-limit@^6.0.1:
3125231249
version "6.0.4"
@@ -34218,7 +34215,7 @@ upper-case@^2.0.2:
3421834215
dependencies:
3421934216
tslib "^2.0.3"
3422034217

34221-
uri-js@^4.2.2, uri-js@^4.4.1:
34218+
uri-js@^4.2.2:
3422234219
version "4.4.1"
3422334220
resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e"
3422434221
integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==

0 commit comments

Comments
 (0)