정의왕

Board UI ver1.0(Board + BoardModal)

1 +const express = require("express");
2 +const bodyParser = require("body-parser");
3 +const router = express.Router();
4 +
5 +const {User}=require('../models');
6 +
7 +router.get('/',(req,res)=>{
8 +
9 +});
10 +
11 +//로그아웃
12 +router.post('/',(req,res)=>{
13 + req.session.id = null;
14 + req.session.name = null;
15 + req.session.personality = null;
16 + req.session.status = null;
17 + req.session.isAuthorized = null;
18 + console.log("Logout");
19 + res.sendStatus(200);
20 +})
21 +
22 +module.exports = router;
...\ No newline at end of file ...\ No newline at end of file
1 -import React, {useCallback, useState} from 'react'; 1 +import React, { useState} from 'react';
2 import '../style/Board.scss' 2 import '../style/Board.scss'
3 -import {CKEditor} from "@ckeditor/ckeditor5-react";
4 -import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
5 -import {Button} from "semantic-ui-react";
6 import ReactHtmlParser from 'react-html-parser'; 3 import ReactHtmlParser from 'react-html-parser';
7 import BoardModal from "../Modal/BoardModal"; 4 import BoardModal from "../Modal/BoardModal";
8 5
...@@ -13,19 +10,17 @@ function Board() { ...@@ -13,19 +10,17 @@ function Board() {
13 } 10 }
14 return ( 11 return (
15 <div className="Board"> 12 <div className="Board">
16 - <div className="contents-container"> 13 + <div className="write-button">
17 - {viewContent.map(element => 14 + <BoardModal onViewContentHandler={onViewContentHandler}/>
18 - <div className="contents" > 15 + </div>
16 + {viewContent.map(element =>
17 + <div class="ui segment">
19 <h2>{element.title}</h2> 18 <h2>{element.title}</h2>
20 <div> 19 <div>
21 {ReactHtmlParser(element.content)} 20 {ReactHtmlParser(element.content)}
22 </div> 21 </div>
23 </div> 22 </div>
24 )} 23 )}
25 - </div>
26 - <div className="write-button">
27 - <BoardModal viewContent = {viewContent} onViewContentHandler={onViewContentHandler}/>
28 - </div>
29 </div> 24 </div>
30 25
31 ); 26 );
......
...@@ -13,7 +13,7 @@ function MainPage() { ...@@ -13,7 +13,7 @@ function MainPage() {
13 <div id="Main"> 13 <div id="Main">
14 <div className="Main-header"> 14 <div className="Main-header">
15 <div className="title"> 15 <div className="title">
16 - <h1>Tunnel</h1> 16 + <h1>"말하기 어려운 고민 여기에 털어놓으세요 :)"</h1>
17 </div> 17 </div>
18 <div className="None-title"> 18 <div className="None-title">
19 <Button className="ui right floated button" onClick={()=>goToLogin()}> 19 <Button className="ui right floated button" onClick={()=>goToLogin()}>
...@@ -23,7 +23,7 @@ function MainPage() { ...@@ -23,7 +23,7 @@ function MainPage() {
23 </div> 23 </div>
24 <div className="Main-body"> 24 <div className="Main-body">
25 <Board/> 25 <Board/>
26 - <div className="user-container"> 26 + {/* <div className="user-container">
27 <div className="userInfo"> 27 <div className="userInfo">
28 <h1>User ID</h1> 28 <h1>User ID</h1>
29 </div> 29 </div>
...@@ -49,7 +49,7 @@ function MainPage() { ...@@ -49,7 +49,7 @@ function MainPage() {
49 </div> 49 </div>
50 </div> 50 </div>
51 </div> 51 </div>
52 - </div> 52 + </div> */}
53 </div> 53 </div>
54 </div> 54 </div>
55 ); 55 );
......
...@@ -3,7 +3,7 @@ import { Button, Header, Image, Modal } from 'semantic-ui-react' ...@@ -3,7 +3,7 @@ import { Button, Header, Image, Modal } from 'semantic-ui-react'
3 import {CKEditor} from "@ckeditor/ckeditor5-react"; 3 import {CKEditor} from "@ckeditor/ckeditor5-react";
4 import ClassicEditor from "@ckeditor/ckeditor5-build-classic"; 4 import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
5 5
6 -function BoardModal({viewContent, onViewContentHandler}) { 6 +function BoardModal({onViewContentHandler}) {
7 const handleClose = (event) => { 7 const handleClose = (event) => {
8 event.preventDefault(); 8 event.preventDefault();
9 setOpen(false); 9 setOpen(false);
...@@ -57,7 +57,6 @@ function BoardModal({viewContent, onViewContentHandler}) { ...@@ -57,7 +57,6 @@ function BoardModal({viewContent, onViewContentHandler}) {
57 ...BoardContent, 57 ...BoardContent,
58 content: data, 58 content: data,
59 }) 59 })
60 -
61 console.log(BoardContent); 60 console.log(BoardContent);
62 }} 61 }}
63 onBlur={(event, editor) => { 62 onBlur={(event, editor) => {
......
...@@ -3,9 +3,7 @@ ...@@ -3,9 +3,7 @@
3 flex-direction: column; 3 flex-direction: column;
4 justify-content: center; 4 justify-content: center;
5 align-items: center; 5 align-items: center;
6 - border: 2px solid #333;
7 padding: 10px 0 30px 0; 6 padding: 10px 0 30px 0;
8 - border-radius: 30px;
9 } 7 }
10 .title-input{ 8 .title-input{
11 width: 500px; 9 width: 500px;
......
1 #Main{ 1 #Main{
2 - margin-top: 30px; 2 + background-color: beige;
3 display: flex; 3 display: flex;
4 flex-direction: column; 4 flex-direction: column;
5 .Main-header{ 5 .Main-header{
6 display: flex; 6 display: flex;
7 flex-direction: row; 7 flex-direction: row;
8 + height: 70px;
8 .title{ 9 .title{
9 display: flex; 10 display: flex;
10 justify-content: center; 11 justify-content: center;
12 + align-items: center;
11 width: 90%; 13 width: 90%;
12 - height: 60px;
13 .h1{ 14 .h1{
15 + font-family:Arial, Helvetica, sans-serif;
14 font-size: 60px; 16 font-size: 60px;
15 font-weight: bold; 17 font-weight: bold;
16 } 18 }
17 } 19 }
18 .None-title{ 20 .None-title{
21 + display: flex;
22 + justify-content: center;
23 + align-items: center;
19 width: 10%; 24 width: 10%;
20 .ui button{ 25 .ui button{
21 height: 40px; 26 height: 40px;
...@@ -32,7 +37,7 @@ ...@@ -32,7 +37,7 @@
32 display: flex; 37 display: flex;
33 justify-content: flex-start; 38 justify-content: flex-start;
34 flex-direction: column; 39 flex-direction: column;
35 - width: 75%; 40 + width: 100%;
36 height: 100%; 41 height: 100%;
37 } 42 }
38 .user-container{ 43 .user-container{
......