From 0b84ae6a0f2a2ecc1ad306f8d2f476ddd10e53fe Mon Sep 17 00:00:00 2001 From: hochan Date: Sat, 20 May 2023 12:17:12 +0900 Subject: [PATCH 1/2] added comment components --- src/components/Comment/CommentElement.jsx | 48 ++++++++++++++ src/components/Comment/index.jsx | 79 ++++++++++++++++++++--- src/components/Form/index.jsx | 27 +++++++- src/components/Posts/CommentElement.jsx | 31 --------- src/data/comments.js | 20 ++++-- src/routes/PostDetailPage.jsx | 4 +- 6 files changed, 161 insertions(+), 48 deletions(-) create mode 100644 src/components/Comment/CommentElement.jsx delete mode 100644 src/components/Posts/CommentElement.jsx diff --git a/src/components/Comment/CommentElement.jsx b/src/components/Comment/CommentElement.jsx new file mode 100644 index 0000000..f71e057 --- /dev/null +++ b/src/components/Comment/CommentElement.jsx @@ -0,0 +1,48 @@ +import React, { useState } from "react"; + +const CommentElement = ({comment, handleCommentEdit, handleCommentDelete}) => { + // TODO : props 받기 + // TODO : 수정하는 input 내용 관리 + // comment created_at 전처리 + const date = new Date(comment.created_at); + const year = date.getFullYear(); + let month = date.getMonth() + 1; + month = month < 10 ? `0${month}` : month; + let day = date.getDate(); + day = day < 10 ? `0${day}` : day; + + const [commentInput, setCommentInput] = useState(comment.content); + const [editing, setEditing] = useState(false); + const onclickEdit = (e) => { + e.preventDefault(); + if(editing) + handleCommentEdit(comment.id, commentInput); //will edit comment + setEditing(!editing); + }; + + return ( +
+
+ {/* {수정중 ? :

{내용}

} */} + {editing? + {setCommentInput(e.target.value)}} value={commentInput} className="input"/> + :

{commentInput}

+ } + {editing ? null: + + {year}.{month}.{day} + + } +
+
+ {!editing?:null} + + +
+
+ ); +}; + +export default CommentElement; diff --git a/src/components/Comment/index.jsx b/src/components/Comment/index.jsx index a713ce7..10c6010 100644 --- a/src/components/Comment/index.jsx +++ b/src/components/Comment/index.jsx @@ -1,24 +1,83 @@ -import { useState } from "react"; +import { useEffect, useState } from "react"; import comments from "../../data/comments"; import CommentElement from "./CommentElement"; +import { CommentForm } from "../Form"; -const Comment = () => { +export const Comment = (postId) => { // TODO 1: 가짜 comments 불러와서 관리해야겟즤 - + const [commentList, setCommentList] = useState(); + const [commentIdCounter, setCommentIdCounter] = useState(0); + useEffect(() => { + const filteredComment=comments.filter((c)=>{return c.post===postId;}) + setCommentList(filteredComment); + },[]); // TODO 2: comment추가하는 input 관리해줘야겟지 - + const [commentInput, setCommentInput] = useState(""); + const [formData, setFormData] = useState({ + id: 0, + content: "", + created_at: "", + post: 0, + author: { + id: 0, + username: "" + }}); + // TODO 3: comment Form 제출됐을때 실행되는 함수 만들어줘 + const handleCommentSubmit = () => { + //comment Input을 가지고 comment를 추가 + const newCommentData = { + ...formData, + id : commentIdCounter, + content: commentInput, + created_at: new Date(), + post: postId, + author: { + id: 2, + username: "베이비" + } + }; + setCommentIdCounter(commentIdCounter+1); + setCommentList([...commentList, newCommentData]); + } + + //comment editing + const handleCommentEdit = (commentId, contentEdited) => { + //commentId를 가지고 comment를 찾아서 content를 수정 + const newCommentList = commentList.map((comment) => { + if(comment.id === commentId) { + comment.content = contentEdited; + comment.created_at = new Date(); + } + return comment; + }); + setCommentList(newCommentList); + } + + // TODO 4: commet Delete 하는 함수 만들어죠\ + const handleCommentDelete = (commentId) => { + //commentId를 가지고 comment를 찾아서 삭제 + const newCommentList = commentList.filter((comment) => comment.id !== commentId); + setCommentList(newCommentList); + } - // TODO 4: commet Delete 하는 함수 만들어죠 return (

Comments

- // commentElement - // 가 comment마다 반복시켜야즤 + {commentList && commentList.map((comment) => ( + + ))} + {/* // 가 comment마다 반복시켜야즤 */} -
- // TODO 2-3 : comment 추가하는 comment form 만들어주기 -
+
); }; diff --git a/src/components/Form/index.jsx b/src/components/Form/index.jsx index 31aa8a4..29ba8fb 100644 --- a/src/components/Form/index.jsx +++ b/src/components/Form/index.jsx @@ -260,4 +260,29 @@ export const PostForm = ({ onSubmit, tags, formData, setFormData }) => { ); - }; \ No newline at end of file + }; + +export const CommentForm = ({onSubmit, commentInput, setCommentInput}) => { + const handleChange=(e)=>{ + setCommentInput(e.target.value); + } + const onClickSubmit = (e) => { + e.preventDefault(); + onSubmit(); + setCommentInput(""); + }; + + return ( +
+ + +
+ ); +}; \ No newline at end of file diff --git a/src/components/Posts/CommentElement.jsx b/src/components/Posts/CommentElement.jsx deleted file mode 100644 index 2f1cf0d..0000000 --- a/src/components/Posts/CommentElement.jsx +++ /dev/null @@ -1,31 +0,0 @@ -const CommentElement = (props) => { - // TODO : props 받기 - // TODO : 수정하는 input 내용 관리 - - // comment created_at 전처리 - const date = new Date(comment.created_at); - const year = date.getFullYear(); - let month = date.getMonth() + 1; - month = month < 10 ? `0${month}` : month; - let day = date.getDate(); - day = day < 10 ? `0${day}` : day; - - return ( -
-
- // 수정중일때와 아닐때를 다르게 보여줘야겠지 - {수정중 ? :

{내용}

} - // 날짜 - - {year}.{month}.{day} - - // 수정, 삭제버튼 -
- // delete 버튼은 수정이 아닐때만 보이게 해줘 -
-
-
- ); -}; - -export default CommentElement; diff --git a/src/data/comments.js b/src/data/comments.js index f8ca604..91b6e13 100644 --- a/src/data/comments.js +++ b/src/data/comments.js @@ -1,12 +1,24 @@ -[ +const comments=[ { - "id": 1, + "id": 100, "content": "comment1", "created_at": "2023-04-18T15:09:43Z", - "post": 1, + "post": 2, + "author": { + "id": 2, + "username": "user2" + } + }, + { + "id": 101, + "content": "comment2", + "created_at": "2023-04-18T15:09:43Z", + "post": 2, "author": { "id": 2, "username": "user2" } } -] \ No newline at end of file +] + +export default comments \ No newline at end of file diff --git a/src/routes/PostDetailPage.jsx b/src/routes/PostDetailPage.jsx index c59f0ba..f3e34b6 100644 --- a/src/routes/PostDetailPage.jsx +++ b/src/routes/PostDetailPage.jsx @@ -2,6 +2,7 @@ import { useEffect, useState } from "react"; import { useParams } from "react-router-dom"; import { BigPost } from "../components/Posts"; import { Link } from "react-router-dom"; +import { Comment } from "../components/Comment"; import posts from "../data/posts"; const PostDetailPage = () => { @@ -27,14 +28,13 @@ const onClickDelete = () => {
{/* post detail component */} - +
-
) ); From 480a31e6c8664d9886b3e0c47adc048001513271 Mon Sep 17 00:00:00 2001 From: hochan Date: Sat, 17 Jun 2023 12:36:32 +0900 Subject: [PATCH 2/2] added myinfo page --- package-lock.json | 191 +++++++++++++++++++++ package.json | 3 + src/App.js | 5 +- src/apis/api.js | 197 ++++++++++++++++++++++ src/apis/axios.js | 64 +++++++ src/components/Comment/CommentElement.jsx | 97 +++++++---- src/components/Comment/index.jsx | 86 ++++------ src/components/Form/index.jsx | 14 +- src/components/Header/index.jsx | 33 +++- src/components/ItemEdit/index.jsx | 55 ++++++ src/components/Posts/index.jsx | 43 ++--- src/routes/HomePage.jsx | 78 +++++---- src/routes/MyInfoPage.jsx | 56 ++++++ src/routes/PostCreatePage.jsx | 72 +++----- src/routes/PostDetailPage.jsx | 48 +++++- src/routes/PostEditPage.jsx | 97 +++++------ src/routes/SignInPage.jsx | 9 +- src/routes/SignUpPage.jsx | 8 +- src/utils/cookie.js | 21 +++ 19 files changed, 913 insertions(+), 264 deletions(-) create mode 100644 src/apis/api.js create mode 100644 src/apis/axios.js create mode 100644 src/components/ItemEdit/index.jsx create mode 100644 src/routes/MyInfoPage.jsx create mode 100644 src/utils/cookie.js diff --git a/package-lock.json b/package-lock.json index 56071c4..a7558dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,11 +11,14 @@ "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", + "axios": "^1.4.0", "dotting": "^1.0.13", "react": "^18.2.0", + "react-cookie": "^4.1.1", "react-dom": "^18.2.0", "react-router-dom": "^6.11.1", "react-scripts": "5.0.1", + "styled-components": "^5.3.11", "web-vitals": "^2.1.4" }, "devDependencies": { @@ -2142,6 +2145,29 @@ "postcss-selector-parser": "^6.0.10" } }, + "node_modules/@emotion/is-prop-valid": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.2.1.tgz", + "integrity": "sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==", + "dependencies": { + "@emotion/memoize": "^0.8.1" + } + }, + "node_modules/@emotion/memoize": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.1.tgz", + "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==" + }, + "node_modules/@emotion/stylis": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/@emotion/stylis/-/stylis-0.8.5.tgz", + "integrity": "sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==" + }, + "node_modules/@emotion/unitless": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz", + "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==" + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -3821,6 +3847,11 @@ "@types/node": "*" } }, + "node_modules/@types/cookie": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.3.3.tgz", + "integrity": "sha512-LKVP3cgXBT9RYj+t+9FDKwS5tdI+rPBXaNSkma7hvqy35lc7mAokC2zsqWJH0LaqIt3B962nuYI77hsJoT1gow==" + }, "node_modules/@types/eslint": { "version": "8.37.0", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.37.0.tgz", @@ -3874,6 +3905,15 @@ "@types/node": "*" } }, + "node_modules/@types/hoist-non-react-statics": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz", + "integrity": "sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==", + "dependencies": { + "@types/react": "*", + "hoist-non-react-statics": "^3.3.0" + } + }, "node_modules/@types/html-minifier-terser": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz", @@ -5097,6 +5137,29 @@ "node": ">=4" } }, + "node_modules/axios": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz", + "integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==", + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/axios/node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/axobject-query": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.1.1.tgz", @@ -5320,6 +5383,26 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/babel-plugin-styled-components": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/babel-plugin-styled-components/-/babel-plugin-styled-components-2.1.3.tgz", + "integrity": "sha512-jBioLwBVHpOMU4NsueH/ADcHrjS0Y/WTpt2eGVmmuSFNEv2DF3XhcMncuZlbbjxQ4vzxg+yEr6E6TNjrIQbsJQ==", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.18.6", + "@babel/helper-module-imports": "^7.21.4", + "babel-plugin-syntax-jsx": "^6.18.0", + "lodash": "^4.17.21", + "picomatch": "^2.3.1" + }, + "peerDependencies": { + "styled-components": ">= 2" + } + }, + "node_modules/babel-plugin-syntax-jsx": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", + "integrity": "sha512-qrPaCSo9c8RHNRHIotaufGbuOBN8rtdC4QrrFFc43vyWCCz7Kl7GL1PGaXtMGQZUXrkCjNEgxDfmAuAabr/rlw==" + }, "node_modules/babel-plugin-transform-react-remove-prop-types": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.24.tgz", @@ -5633,6 +5716,14 @@ "node": ">= 6" } }, + "node_modules/camelize": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.1.tgz", + "integrity": "sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/caniuse-api": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-3.0.0.tgz", @@ -6068,6 +6159,14 @@ "postcss": "^8.4" } }, + "node_modules/css-color-keywords": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz", + "integrity": "sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==", + "engines": { + "node": ">=4" + } + }, "node_modules/css-declaration-sorter": { "version": "6.4.0", "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-6.4.0.tgz", @@ -6249,6 +6348,16 @@ "resolved": "https://registry.npmjs.org/css-select-base-adapter/-/css-select-base-adapter-0.1.1.tgz", "integrity": "sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w==" }, + "node_modules/css-to-react-native": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.2.0.tgz", + "integrity": "sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==", + "dependencies": { + "camelize": "^1.0.0", + "css-color-keywords": "^1.0.0", + "postcss-value-parser": "^4.0.2" + } + }, "node_modules/css-tree": { "version": "1.0.0-alpha.37", "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.37.tgz", @@ -8712,6 +8821,19 @@ "he": "bin/he" } }, + "node_modules/hoist-non-react-statics": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", + "dependencies": { + "react-is": "^16.7.0" + } + }, + "node_modules/hoist-non-react-statics/node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + }, "node_modules/hoopy": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/hoopy/-/hoopy-0.1.4.tgz", @@ -14088,6 +14210,11 @@ "node": ">= 0.10" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -14232,6 +14359,19 @@ "node": ">=14" } }, + "node_modules/react-cookie": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/react-cookie/-/react-cookie-4.1.1.tgz", + "integrity": "sha512-ffn7Y7G4bXiFbnE+dKhHhbP+b8I34mH9jqnm8Llhj89zF4nPxPutxHT1suUqMeCEhLDBI7InYwf1tpaSoK5w8A==", + "dependencies": { + "@types/hoist-non-react-statics": "^3.0.1", + "hoist-non-react-statics": "^3.0.0", + "universal-cookie": "^4.0.0" + }, + "peerDependencies": { + "react": ">= 16.3.0" + } + }, "node_modules/react-dev-utils": { "version": "12.0.1", "resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-12.0.1.tgz", @@ -15204,6 +15344,11 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, + "node_modules/shallowequal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", + "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==" + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -15606,6 +15751,35 @@ "webpack": "^5.0.0" } }, + "node_modules/styled-components": { + "version": "5.3.11", + "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-5.3.11.tgz", + "integrity": "sha512-uuzIIfnVkagcVHv9nE0VPlHPSCmXIUGKfJ42LNjxCCTDTL5sgnJ8Z7GZBq0EnLYGln77tPpEpExt2+qa+cZqSw==", + "dependencies": { + "@babel/helper-module-imports": "^7.0.0", + "@babel/traverse": "^7.4.5", + "@emotion/is-prop-valid": "^1.1.0", + "@emotion/stylis": "^0.8.4", + "@emotion/unitless": "^0.7.4", + "babel-plugin-styled-components": ">= 1.12.0", + "css-to-react-native": "^3.0.0", + "hoist-non-react-statics": "^3.0.0", + "shallowequal": "^1.1.0", + "supports-color": "^5.5.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/styled-components" + }, + "peerDependencies": { + "react": ">= 16.8.0", + "react-dom": ">= 16.8.0", + "react-is": ">= 16.8.0" + } + }, "node_modules/stylehacks": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-5.1.1.tgz", @@ -16276,6 +16450,23 @@ "node": ">=8" } }, + "node_modules/universal-cookie": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/universal-cookie/-/universal-cookie-4.0.4.tgz", + "integrity": "sha512-lbRVHoOMtItjWbM7TwDLdl8wug7izB0tq3/YVKhT/ahB4VDvWMyvnADfnJI8y6fSvsjh51Ix7lTGC6Tn4rMPhw==", + "dependencies": { + "@types/cookie": "^0.3.3", + "cookie": "^0.4.0" + } + }, + "node_modules/universal-cookie/node_modules/cookie": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", + "engines": { + "node": ">= 0.6" + } + }, "node_modules/universalify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", diff --git a/package.json b/package.json index ec5e5a9..fabdeef 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,14 @@ "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", + "axios": "^1.4.0", "dotting": "^1.0.13", "react": "^18.2.0", + "react-cookie": "^4.1.1", "react-dom": "^18.2.0", "react-router-dom": "^6.11.1", "react-scripts": "5.0.1", + "styled-components": "^5.3.11", "web-vitals": "^2.1.4" }, "scripts": { diff --git a/src/App.js b/src/App.js index 768e834..719ea4b 100644 --- a/src/App.js +++ b/src/App.js @@ -8,6 +8,7 @@ import PostEditPage from "./routes/PostEditPage"; import SignUpPage from "./routes/SignUpPage"; import PostDetailPage from "./routes/PostDetailPage"; import SignInPage from "./routes/SignInPage"; +import MyInfoPage from "./routes/MyInfoPage"; function App() { return ( @@ -25,8 +26,10 @@ function App() { } /> {/* sign up */} } /> - {/* sign up */} + {/* sign in */} } /> + {/* My Info */} + } />