From a273f1a88eea801ea5866c44eb292b45b08f83af Mon Sep 17 00:00:00 2001 From: krokodilka Date: Thu, 14 Jul 2022 20:11:00 +0300 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=B2=D0=B8=D1=82=D1=87=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D1=82=D0=B8=D0=BF=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/create/createQuestion.tsx | 48 +++++------------------------ src/create/settings.tsx | 3 +- src/create/tools/list.tsx | 37 ---------------------- src/create/types.tsx | 58 +++++++++++++++++++++++++++++++++++ src/index.tsx | 4 +-- 5 files changed, 68 insertions(+), 82 deletions(-) delete mode 100644 src/create/tools/list.tsx create mode 100644 src/create/types.tsx 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( - - - -