diff --git a/src/create/createQuestion.tsx b/src/create/createQuestion.tsx
index b93c5f4a..98355571 100644
--- a/src/create/createQuestion.tsx
+++ b/src/create/createQuestion.tsx
@@ -6,6 +6,7 @@ import {
import 'suneditor/dist/css/suneditor.min.css'; // Import Sun Editor's CSS File
import Description from "./description";
import Settings from "./settings";
+import Types from "./types";
//Значения, собираемые для отправки на бэк
interface Values {
@@ -30,8 +31,7 @@ const types = [
{desc:"кнопка", value:"button"},
{desc:"ничего", value:"none"}
]
-
-const TextField = (props: any) => {
+export const TextField = (props: any) => {
const [field, meta, helpers] = useField(props);
@@ -217,45 +217,11 @@ export default () => {
- {
- type === 0 ? //Тип вопроса - текст?
-
- :
- type === 3 ? //Тип вопроса - файл?
-
- :
- stockroom.length === 0 ? //В поле для юзерских данных есть что-то?
- null //Ничего не внесено
- :
- type === 1 ? //Тип вопроса - селект?
-
- :
- type === 2 ? //Тип вопроса - чекбокс?
- stockroom.map((e:any, i:number) => {
- return {e.text}
- })
- :
- type === 4 ? //Тип вопроса - кнопка?
- stockroom.map((e:any, i:number) => {
- return
- })
- :
- null //Тип вопроса - ничего
- }
+
{
diff --git a/src/create/tools/list.tsx b/src/create/tools/list.tsx
deleted file mode 100644
index 6965db45..00000000
--- a/src/create/tools/list.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import React from 'react';
-import {Button, VStack, HStack, Textarea, Container, Text, CloseButton} from "@chakra-ui/react";
-
-
-
-export default ({stockroom}: {stockroom: any,}) => {
- const [color, setColor] = React.useState("#fff")
-
- return(
-
-
-
-
-
-
- {
- stockroom.map((e:any, i:number) => {
- return(
-
- {e.text}
-
- )
- })
- }
-
-
- )
-}
\ No newline at end of file
diff --git a/src/create/types.tsx b/src/create/types.tsx
new file mode 100644
index 00000000..33608f52
--- /dev/null
+++ b/src/create/types.tsx
@@ -0,0 +1,58 @@
+import React from 'react';
+import {
+ Select, Checkbox, Button,
+} from '@chakra-ui/react'
+import {TextField} from "./createQuestion";
+
+export default (props:any) => {
+ switch(props.type) {
+ case 0://Тип вопроса - текст?
+ return ()
+ break;
+ case 1://Тип вопроса - селект?
+ return (
+
+ )
+ break;
+ case 2://Тип вопроса - чекбокс?
+ return(
+ <>
+ {
+ props.stockroom.map((e:any, i:number) => {
+ return {e.text}
+ })
+ }
+ >
+ )
+ break;
+ case 3://Тип вопроса - файл?
+ return ()
+ break;
+ case 4://Тип вопроса - кнопка?
+ return(
+ <>
+ {
+ props.stockroom.map((e:any, i:number) => {
+ return
+ })
+ }
+ >
+ )
+ break;
+ default:
+ return <>>
+ }
+}
\ No newline at end of file
diff --git a/src/index.tsx b/src/index.tsx
index 1dd16339..d8f8504f 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -13,7 +13,7 @@ const root = ReactDOM.createRoot(
);
root.render(
- //
+
@@ -26,5 +26,5 @@ root.render(
- //
+
);
\ No newline at end of file