Skip to content

Commit

Permalink
fix. toast editor css bug & add editor toolbarItems
Browse files Browse the repository at this point in the history
  • Loading branch information
doyupK committed Sep 18, 2023
1 parent 3fd5d14 commit 8168126
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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();
}, []);
Expand All @@ -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
/>
Expand Down
4 changes: 1 addition & 3 deletions apps/web/src/styles/globalStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 8168126

Please sign in to comment.