정의왕

Set reducer & Modify user-action

This diff is collapsed. Click to expand it.
......@@ -3,6 +3,8 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@ckeditor/ckeditor5-build-classic": "^31.0.0",
"@ckeditor/ckeditor5-react": "^3.0.3",
"@testing-library/jest-dom": "^5.15.0",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
......
import {Button} from "semantic-ui-react"
import "../style/MainPage.scss";
import { useNavigate } from "react-router-dom";
import { CKEditor } from '@ckeditor/ckeditor5-react';
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
function MainPage() {
const navigate = useNavigate();
......@@ -32,7 +34,24 @@ function MainPage() {
</div>
<div className="contents">
<div className="ui segment">
<p>a</p>
<CKEditor
editor={ClassicEditor}
data="<p>Hello from CKEditor 5!</p>"
onReady={editor => {
// You can store the "editor" and use when it is needed.
console.log('Editor is ready to use!', editor);
}}
onChange={(event, editor) => {
const data = editor.getData();
console.log({ event, editor, data });
}}
onBlur={(event, editor) => {
console.log('Blur.', editor);
}}
onFocus={(event, editor) => {
console.log('Focus.', editor);
}}
/>
</div>
<div className="ui segment">
<p>a</p>
......@@ -51,7 +70,7 @@ function MainPage() {
tabIndex="0">
<div className="visible content">도착한 </div>
<div className="hidden content">
<i className="pencil alternate icon"></i>
<i className="paper plane ic on"></i>
</div>
</Button>
</div>
......
......@@ -39,7 +39,7 @@ function RegisterPage(props) {
}
dispatch(registerUser(body))
.then(response => {
if (response.payload.success) {
if (response.payload.registerSuccess) {
props.history.push('/login')
} else {
alert('Failed to sign up')
......