From 816812673ad4d214aaaf5054eaf7bcd383eeaece Mon Sep 17 00:00:00 2001 From: doyupK Date: Mon, 18 Sep 2023 22:15:41 +0900 Subject: [PATCH] fix. toast editor css bug & add editor toolbarItems --- .../components/communityEditor.tsx | 17 ++++++++++------- apps/web/src/styles/globalStyles.ts | 4 +--- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/apps/web/src/components/community/communityForm/components/communityEditor.tsx b/apps/web/src/components/community/communityForm/components/communityEditor.tsx index b6317bd3..f610aaad 100644 --- a/apps/web/src/components/community/communityForm/components/communityEditor.tsx +++ b/apps/web/src/components/community/communityForm/components/communityEditor.tsx @@ -1,6 +1,5 @@ import '@toast-ui/editor/dist/toastui-editor.css'; import '@toast-ui/editor/dist/i18n/ko-kr'; - import { Editor } from '@toast-ui/react-editor'; import type { EditorProps } from '@toast-ui/react-editor'; import * as React from 'react'; @@ -14,6 +13,15 @@ interface CommunityEditorProps { const CommunityEditor = (props: CommunityEditorProps) => { const { editor, plugins, init } = props; + const toolbarItems = [ + ['heading', 'bold', 'italic', 'strike'], + ['hr'], + ['ul', 'ol', 'task'], + ['table', 'link'], + ['image'], + ['code'], + ['scrollSync'], + ]; React.useEffect(() => { if (init) init(); }, []); @@ -27,12 +35,7 @@ const CommunityEditor = (props: CommunityEditorProps) => { initialEditType="wysiwyg" initialValue=" " language="ko-KR" - toolbarItems={[ - ['bold', 'strike'], - ['hr'], - ['image', 'link'], - ['code', 'codeblock'], - ]} + toolbarItems={toolbarItems} plugins={plugins} hideModeSwitch /> diff --git a/apps/web/src/styles/globalStyles.ts b/apps/web/src/styles/globalStyles.ts index 2069c52b..5218acb5 100644 --- a/apps/web/src/styles/globalStyles.ts +++ b/apps/web/src/styles/globalStyles.ts @@ -32,12 +32,10 @@ const GlobalStyle = createGlobalStyle` cursor: pointer; } - .toastui-editor-contents *{ + .toastui-editor-contents { display: flex; flex-direction: column; - justify-content: center; align-items: center; - align-content: center; } .toastui-editor-contents img{