From 6d9e79b76565c7d0b145d21701cd9faebbc57ecc Mon Sep 17 00:00:00 2001 From: xxxjinn Date: Sun, 4 Aug 2024 01:08:04 +0900 Subject: [PATCH 1/6] =?UTF-8?q?refactor:=20=ED=88=B4=EB=B0=94=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EB=B6=88=ED=95=84=EC=9A=94=ED=95=9C=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EC=A0=9C=EA=B1=B0=ED=95=98=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/editor/toolbar.tsx | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/components/editor/toolbar.tsx b/src/components/editor/toolbar.tsx index 64a7140..7cfdcd2 100644 --- a/src/components/editor/toolbar.tsx +++ b/src/components/editor/toolbar.tsx @@ -89,19 +89,7 @@ export default function Toolbar({ id, isSimple, ...other }: EditorToolbarProps) )}
-
From 95022d48c42007d6a249b031eaf803966d2a5044 Mon Sep 17 00:00:00 2001 From: xxxjinn Date: Mon, 5 Aug 2024 14:28:58 +0900 Subject: [PATCH 3/6] =?UTF-8?q?refactor:=20=EC=BB=B4=ED=8F=AC=EB=84=8C?= =?UTF-8?q?=ED=8A=B8=EB=AA=85=20=EB=B3=80=EA=B2=BD=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=9D=B8=ED=95=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/proceeding/proceeding-upload/index.tsx | 4 ++-- src/pages/rule/rule-upload/index.tsx | 4 ++-- src/pages/transaction/transaction-upload/index.tsx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pages/proceeding/proceeding-upload/index.tsx b/src/pages/proceeding/proceeding-upload/index.tsx index da1edca..4e6290e 100644 --- a/src/pages/proceeding/proceeding-upload/index.tsx +++ b/src/pages/proceeding/proceeding-upload/index.tsx @@ -1,9 +1,9 @@ -import UploadFile from '@/components/upload-file'; +import UploadFileComponent from '@/components/upload-file'; const index = () => { return (
- +
); }; diff --git a/src/pages/rule/rule-upload/index.tsx b/src/pages/rule/rule-upload/index.tsx index 9a98a9a..856717d 100644 --- a/src/pages/rule/rule-upload/index.tsx +++ b/src/pages/rule/rule-upload/index.tsx @@ -1,9 +1,9 @@ -import UploadFile from '@/components/upload-file'; +import UploadFileComponent from '@/components/upload-file'; const index = () => { return (
- +
); }; diff --git a/src/pages/transaction/transaction-upload/index.tsx b/src/pages/transaction/transaction-upload/index.tsx index f448657..a656df5 100644 --- a/src/pages/transaction/transaction-upload/index.tsx +++ b/src/pages/transaction/transaction-upload/index.tsx @@ -1,9 +1,9 @@ -import UploadFile from '@/components/upload-file'; +import UploadFileComponent from '@/components/upload-file'; const index = () => { return (
- +
); }; From 5bac12082ce6d453d3571f7e3ec97edb38524c28 Mon Sep 17 00:00:00 2001 From: xxxjinn Date: Mon, 5 Aug 2024 18:32:39 +0900 Subject: [PATCH 4/6] chore: react-quill-new install --- package.json | 1 + pnpm-lock.yaml | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/package.json b/package.json index 762958f..d7e9375 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "react-organizational-chart": "^2.2.1", "react-pdf": "^9.1.0", "react-quill": "^2.0.0", + "react-quill-new": "^3.2.2", "react-router-dom": "^6.16.0", "react-use": "^17.4.0", "rehype-highlight": "^6.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8216197..cc0016f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -131,6 +131,9 @@ importers: react-quill: specifier: ^2.0.0 version: 2.0.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + react-quill-new: + specifier: ^3.2.2 + version: 3.2.2(quill-delta@5.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) react-router-dom: specifier: ^6.16.0 version: 6.24.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) @@ -3298,6 +3301,12 @@ packages: lodash.camelcase@4.3.0: resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} + lodash.clonedeep@4.5.0: + resolution: {integrity: sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==} + + lodash.isequal@4.5.0: + resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==} + lodash.isfunction@3.0.9: resolution: {integrity: sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==} @@ -3894,6 +3903,9 @@ packages: parchment@1.1.4: resolution: {integrity: sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg==} + parchment@3.0.0: + resolution: {integrity: sha512-HUrJFQ/StvgmXRcQ1ftY6VEZUq3jA2t9ncFN4F84J/vN0/FPpQF+8FKXb3l6fLces6q0uOHj6NJn+2xvZnxO6A==} + parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} @@ -4278,9 +4290,17 @@ packages: resolution: {integrity: sha512-wdIGBlcX13tCHOXGMVnnTVFtGRLoP0imqxM696fIPwIf5ODIYUHIvHbZcyvGlZFiFhK5XzDC2lpjbxRhnM05Tg==} engines: {node: '>=0.10'} + quill-delta@5.1.0: + resolution: {integrity: sha512-X74oCeRI4/p0ucjb5Ma8adTXd9Scumz367kkMK5V/IatcX6A0vlgLgKbzXWy5nZmCGeNJm2oQX0d2Eqj+ZIlCA==} + engines: {node: '>= 12.0.0'} + quill@1.3.7: resolution: {integrity: sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g==} + quill@2.0.2: + resolution: {integrity: sha512-QfazNrhMakEdRG57IoYFwffUIr04LWJxbS/ZkidRFXYCQt63c1gK6Z7IHUXMx/Vh25WgPBU42oBaNzQ0K1R/xw==} + engines: {npm: '>=8.2.3'} + raf-schd@4.0.3: resolution: {integrity: sha512-tQkJl2GRWh83ui2DiPTJz9wEiMN20syf+5oKfB03yYP7ioZcJwsIK8FjrtLwH1m7C7e+Tt2yYBlrOpdT+dyeIQ==} @@ -4596,6 +4616,13 @@ packages: '@types/react': optional: true + react-quill-new@3.2.2: + resolution: {integrity: sha512-pWMfSVAG/ErEh8qjffEp7g8FxRZOcYgTjyi0lp5aLRc/8Ii6u9u95NWu4oeDhFJuZ0NX/h1VnOul8WWKvsl0uQ==} + peerDependencies: + quill-delta: ^5.1.0 + react: ^16 || ^17 || ^18 || ^19 + react-dom: ^16 || ^17 || ^18 || ^19 + react-quill@2.0.0: resolution: {integrity: sha512-4qQtv1FtCfLgoD3PXAur5RyxuUbPXQGOHgTlFie3jtxp43mXDtzCKaOgQ3mLyZfi1PUlyjycfivKelFhy13QUg==} peerDependencies: @@ -9206,6 +9233,10 @@ snapshots: lodash.camelcase@4.3.0: {} + lodash.clonedeep@4.5.0: {} + + lodash.isequal@4.5.0: {} + lodash.isfunction@3.0.9: {} lodash.isplainobject@4.0.6: {} @@ -10029,6 +10060,8 @@ snapshots: parchment@1.1.4: {} + parchment@3.0.0: {} + parent-module@1.0.1: dependencies: callsites: 3.1.0 @@ -10332,6 +10365,12 @@ snapshots: extend: 3.0.2 fast-diff: 1.1.2 + quill-delta@5.1.0: + dependencies: + fast-diff: 1.3.0 + lodash.clonedeep: 4.5.0 + lodash.isequal: 4.5.0 + quill@1.3.7: dependencies: clone: 2.1.2 @@ -10341,6 +10380,13 @@ snapshots: parchment: 1.1.4 quill-delta: 3.6.3 + quill@2.0.2: + dependencies: + eventemitter3: 5.0.1 + lodash-es: 4.17.21 + parchment: 3.0.0 + quill-delta: 5.1.0 + raf-schd@4.0.3: {} ramda@0.29.1: {} @@ -10774,6 +10820,14 @@ snapshots: - encoding - supports-color + react-quill-new@3.2.2(quill-delta@5.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0): + dependencies: + lodash-es: 4.17.21 + quill: 2.0.2 + quill-delta: 5.1.0 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + react-quill@2.0.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): dependencies: '@types/quill': 1.3.10 From f56550d91bae4eede38fa22fb560d63b51a69f38 Mon Sep 17 00:00:00 2001 From: xxxjinn Date: Mon, 5 Aug 2024 18:33:19 +0900 Subject: [PATCH 5/6] =?UTF-8?q?feat:=20reactQuill=20toolbar=20module=20?= =?UTF-8?q?=EC=82=AC=EC=9A=A9=20=EC=95=88=ED=95=98=EB=8A=94=20=EB=B2=84?= =?UTF-8?q?=EC=A0=84=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/editor/index.tsx | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/src/components/editor/index.tsx b/src/components/editor/index.tsx index e79013c..2a131fd 100644 --- a/src/components/editor/index.tsx +++ b/src/components/editor/index.tsx @@ -1,40 +1,27 @@ /* eslint-disable import/order */ import '@/utils/highlight'; -import ReactQuill, { ReactQuillProps } from 'react-quill'; -import Toolbar, { formats } from './toolbar'; +import ReactQuill, { ReactQuillProps } from 'react-quill-new'; import { useSettings } from '@/store/settingStore'; import { useThemeToken } from '@/theme/hooks'; import { StyledEditor } from './styles'; -interface Props extends ReactQuillProps { - sample?: boolean; -} -export default function Editor({ id = 'slash-quill', sample = false, ...other }: Props) { +export default function Editor({ ...other }: ReactQuillProps) { const token = useThemeToken(); const { themeMode } = useSettings(); + const modules = { toolbar: { - container: `#${id}`, - }, - history: { - delay: 500, - maxStack: 100, - userOnly: true, - }, - syntax: true, - clipboard: { - matchVisual: false, + container: [ + [{ header: [1, 2, 3, 4] }], + [{ list: 'ordered' }, { list: 'bullet' }], + ['bold', 'italic', 'underline', 'strike'], + ], }, }; + return ( - - + ); } From fe4bc6b7db7253884f57579fe1bc6069bbebfe00 Mon Sep 17 00:00:00 2001 From: xxxjinn Date: Mon, 5 Aug 2024 18:36:47 +0900 Subject: [PATCH 6/6] =?UTF-8?q?feat:=20=EC=97=85=EB=A1=9C=EB=93=9C=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20(=ED=96=89=EC=82=AC,=20=EA=B3=B5?= =?UTF-8?q?=EC=A7=80=EC=82=AC=ED=95=AD,=20faq)=20title=20=EA=B3=BC=20?= =?UTF-8?q?=EB=82=B4=EC=9A=A9=EC=97=90=20=EB=94=B0=EB=A5=B8=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=ED=99=9C=EC=84=B1=ED=99=94=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/upload-content/index.tsx | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/components/upload-content/index.tsx b/src/components/upload-content/index.tsx index 47410a1..0cf604f 100644 --- a/src/components/upload-content/index.tsx +++ b/src/components/upload-content/index.tsx @@ -5,15 +5,32 @@ import Editor from '../editor'; function UploadContent({ title }: { title: string }) { const [editorValue, setEditorValue] = useState(''); + const [inputValue, setInputValue] = useState(''); + + const isButtonDisabled = inputValue.trim() === '' || editorValue.trim() === ''; + + const handleButtonClick = () => { + if (!isButtonDisabled) { + // upload api자리 + console.log('Title:', inputValue); + console.log('Content:', editorValue); + } + }; return (

{title}

- - + setInputValue(e.target.value)} + /> +
- +
); }