From 8ae2dc02f0d84e9f75b3b50e51808aab6abd45d0 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Fri, 26 Feb 2021 16:47:38 +0700 Subject: [PATCH 1/9] #34 added LocalCommentForm --- package.json | 5 +- src/components/comment/CommentForm/index.tsx | 99 ++++++++++--------- .../comment/LocalCommentForm/index.tsx | 25 +++++ .../LocalCommentFormTextarea/index.tsx | 36 +++++++ src/utils/hooks/useCommentFormFormik.ts | 35 +++++++ yarn.lock | 75 +++++++++++++- 6 files changed, 226 insertions(+), 49 deletions(-) create mode 100644 src/components/comment/LocalCommentForm/index.tsx create mode 100644 src/components/comment/LocalCommentFormTextarea/index.tsx create mode 100644 src/utils/hooks/useCommentFormFormik.ts diff --git a/package.json b/package.json index 7d948d3e..9faa2025 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "connected-react-router": "^6.5.2", "date-fns": "^2.4.1", "flexbin": "^0.2.0", + "formik": "^2.2.6", "insane": "^2.6.2", "marked": "^2.0.0", "node-sass": "4.14.1", @@ -36,7 +37,8 @@ "throttle-debounce": "^2.1.0", "typescript": "^4.0.5", "uuid4": "^1.1.4", - "web-vitals": "^0.2.4" + "web-vitals": "^0.2.4", + "yup": "^0.32.9" }, "scripts": { "start": "craco start", @@ -68,6 +70,7 @@ "@types/node": "^11.13.22", "@types/ramda": "^0.26.33", "@types/react-redux": "^7.1.11", + "@types/yup": "^0.29.11", "craco-alias": "^2.1.1", "craco-fast-refresh": "^1.0.2", "prettier": "^1.18.2" diff --git a/src/components/comment/CommentForm/index.tsx b/src/components/comment/CommentForm/index.tsx index 22613f08..559b7cea 100644 --- a/src/components/comment/CommentForm/index.tsx +++ b/src/components/comment/CommentForm/index.tsx @@ -30,6 +30,7 @@ import { CommentFormAttaches } from '~/components/comment/CommentFormAttaches'; import { CommentFormAttachButtons } from '~/components/comment/CommentFormAttachButtons'; import { CommentFormDropzone } from '~/components/comment/CommentFormDropzone'; import { CommentFormFormatButtons } from '~/components/comment/CommentFormFormatButtons'; +import { LocalCommentForm } from '~/components/comment/LocalCommentForm'; const mapStateToProps = (state: IState) => ({ node: selectNode(state), @@ -180,61 +181,65 @@ const CommentFormUnconnected: FC = memo( ); return ( - -
-
-