정의왕

Set reducer & Modify user-action

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