From 1889cb5ed4364f8c8de6c649831427a02916515a Mon Sep 17 00:00:00 2001 From: Lee Naeun Date: Sat, 28 Aug 2021 21:17:36 +0900 Subject: [PATCH 1/7] fix fontsize & width/height size --- client/src/App.js | 4 ++-- client/src/app.css | 9 ++++----- client/src/comp/Nav.js | 24 +++++++++++++++++++++--- client/src/comp/SearchInput.js | 26 +++++++++++++++++++------- client/src/comp/SearchResult.js | 4 ++-- 5 files changed, 48 insertions(+), 19 deletions(-) diff --git a/client/src/App.js b/client/src/App.js index 21f6c4a..90f13fc 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -9,10 +9,10 @@ import WriteModal from "./comp/WriteModal"; function App() { // console.log(dummyData); - const [isLogin, setisLogin] = useState(true); + const [isLogin, setisLogin] = useState(false); const [searched, setSearched] = useState(false); const [onModal, setOnModal] = useState(false); - const [writeModal, setWriteModal] = useState(true); + const [writeModal, setWriteModal] = useState(false); return (
diff --git a/client/src/app.css b/client/src/app.css index f9a7038..44d3e70 100644 --- a/client/src/app.css +++ b/client/src/app.css @@ -112,14 +112,13 @@ nav { } section { - height: 55vh; + height: 60vh; background-color: #ffe65b; } footer { - height: 10vh; - min-height: 67px; - line-height: 10vh; + height: 4.5vh; + line-height: 4.5vh; text-align: center; - font-size: 0.97rem; + font-size: max(0.9vw, 10px); } diff --git a/client/src/comp/Nav.js b/client/src/comp/Nav.js index 12f7edc..e74204b 100644 --- a/client/src/comp/Nav.js +++ b/client/src/comp/Nav.js @@ -19,13 +19,19 @@ function Nav({ isLogin }) { height: 7vh; border: none; border-radius: 40px; - font-size: 0.98rem; + font-size: max(0.85vw, 12px); font-weight: 700; display: block; margin-top: 5vh; + cursor: pointer; + transition: 0.3s; &:nth-child(1) { margin-top: 0; } + :hover { + background-color: black; + color: white; + } `; const Button2 = styled.button` @@ -33,18 +39,25 @@ function Nav({ isLogin }) { height: 7vh; border: none; border-radius: 40px; - font-size: 0.98rem; + font-size: max(0.85vw, 12px); font-weight: 700; display: block; margin: 5vh auto 0; + cursor: pointer; + transition: 0.3s; &:nth-child(1) { margin-top: 0; } + :hover { + background-color: black; + color: white; + } `; const ProfileWrap = styled.div` width: 100%; text-align: center; + cursor: pointer; > img { width: 22vh; height: 22vh; @@ -57,10 +70,15 @@ function Nav({ isLogin }) { height: 7vh; border: none; border-radius: 40px; - font-size: 0.98rem; + font-size: max(0.85vw, 12px); font-weight: 700; display: block; margin: 0 auto; + transition: 0.3s; + } + > button:hover { + background-color: black; + color: white; } `; diff --git a/client/src/comp/SearchInput.js b/client/src/comp/SearchInput.js index 42284c8..0757a9f 100644 --- a/client/src/comp/SearchInput.js +++ b/client/src/comp/SearchInput.js @@ -6,23 +6,35 @@ const SearchWrap = styled.div` margin: 0 auto; padding: 2vh 0vh 4vh; text-align: center; + box-sizing: border-box; > .searchInput { - width: 60%; - height: 40px; + width: 58%; + height: 3.2vw; + min-height: 30px; border: 2px solid #000; - border-radius: 20px; + border-radius: 3vw; margin-right: 10px; outline: none; - padding-left: 20px; + padding-left: max; } > .searchBtn { - width: 90px; - height: 44px; + width: 100px; + height: 3.2vw; + min-height: 30px; background-color: #000; color: #fff; border: none; margin-top: 1vh; - border-radius: 20px; + border-radius: 3.2vw; + font-size: max(0.8vw, 11px); + border: 2px solid black; + cursor: pointer; + transition: 0.3s; + } + > .searchBtn:hover { + background-color: white; + color: black; + border: 2px solid black; } `; function SearchInput() { diff --git a/client/src/comp/SearchResult.js b/client/src/comp/SearchResult.js index b935a3f..c03ad8c 100644 --- a/client/src/comp/SearchResult.js +++ b/client/src/comp/SearchResult.js @@ -26,7 +26,7 @@ function SearchResult({ data }) { background-color: #ffff8d; p { padding: 0 5px; - font-size: 75%; + font-size: max(1vw, 15px); flex: 1 0 auto; overflow: hidden; text-overflow: ellipsis; @@ -63,7 +63,7 @@ function SearchResult({ data }) { border: 2px solid black; background-color: black; color: white; - font-size: 0.8rem; + font-size: max(0.8vw, 11px); transition: 0.2s; :hover { background-color: white; From 8a9cc7b3de4e00ff89d279bfe068ac04a3090813 Mon Sep 17 00:00:00 2001 From: Lee Naeun Date: Sat, 28 Aug 2021 21:25:53 +0900 Subject: [PATCH 2/7] =?UTF-8?q?=EB=B0=98=EC=9D=91=ED=98=95=20=EC=82=AC?= =?UTF-8?q?=EC=9D=B4=EC=A6=88=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/comp/SearchInput.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/client/src/comp/SearchInput.js b/client/src/comp/SearchInput.js index 0757a9f..ee25318 100644 --- a/client/src/comp/SearchInput.js +++ b/client/src/comp/SearchInput.js @@ -10,22 +10,23 @@ const SearchWrap = styled.div` > .searchInput { width: 58%; height: 3.2vw; - min-height: 30px; + min-height: 35px; border: 2px solid #000; - border-radius: 3vw; + border-radius: 30px; margin-right: 10px; outline: none; padding-left: max; } > .searchBtn { - width: 100px; + width: 6vw; height: 3.2vw; - min-height: 30px; + min-height: 35px; + min-width: 50px; background-color: #000; color: #fff; border: none; margin-top: 1vh; - border-radius: 3.2vw; + border-radius: 30px; font-size: max(0.8vw, 11px); border: 2px solid black; cursor: pointer; From 91aa407e51c1dddd72423264710ceda5fb2479b7 Mon Sep 17 00:00:00 2001 From: Lee Naeun Date: Sat, 28 Aug 2021 21:33:45 +0900 Subject: [PATCH 3/7] mypage main complete --- client/src/pages/Mypage.js | 130 +++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 client/src/pages/Mypage.js diff --git a/client/src/pages/Mypage.js b/client/src/pages/Mypage.js new file mode 100644 index 0000000..b1728c0 --- /dev/null +++ b/client/src/pages/Mypage.js @@ -0,0 +1,130 @@ +import React from "react"; +import styled from "styled-components"; + +const MypageWrap = styled.div` + width: 100%; + display: grid; + place-items: center; + font-size: max(16px, 0.8vw); +`; +const MypageContent = styled.div` + width: 75%; + min-width: 200px; + display: flex; + flex-direction: column; + flex-wrap: wrap; +`; +const UserContent = styled.div` + display: flex; + justify-content: space-between; + padding: 1vw 0; + border-bottom: 3px solid #000; + margin-bottom: 2vw; +`; +const ContentList = styled.ul` + display: flex; + flex-direction: column; + margin-bottom: 2vw; + > .content { + display: flex; + justify-content: space-between; + padding: 1vw 0; + border-bottom: 3px solid #000; + > input { + flex: 1 1 auto; + } + > .contentInfo { + flex: 5 1 auto; + display: flex; + justify-content: space-evenly; + } + } +`; +const ContentCheck = styled.div` + display: flex; + justify-content: space-between; + > button { + height: 2vw; + min-height: 25px; + width: 8vw; + min-width: 80px; + border: 2px solid black; + border-radius: 20px; + word-break: keep-all; + } +`; + +function Mypage() { + return ( + + + +

작성하신 글은 0개 이며, 최대 추천수는 0개 입니다

+ +
+ + +
  • + +
    +

    단어

    +

    단어 뜻

    +

    추천 수

    +
    +
  • +
  • + +
    +

    단어

    +

    단어 뜻

    +

    추천 수

    +
    +
  • +
  • + +
    +

    단어

    +

    단어 뜻

    +

    추천 수

    +
    +
  • +
    + + + + + +
    +
    + ); +} +/* +
    +
    +

    작성한 글은 ~~개 이며, 최대 추천수는 ~개 입니다

    + +
    +
      +
    • + +

      단어

      +

      단어 뜻

      +

      추천 수

      +
    • + ... +
    +
    + + +
    +
    + + +*/ +export default Mypage; From 519cf94105b37e04a3b0325f12d38b9247b5e47b Mon Sep 17 00:00:00 2001 From: Lee Naeun Date: Sat, 28 Aug 2021 21:56:28 +0900 Subject: [PATCH 4/7] fix router --- client/package-lock.json | 235 +++++++++++++++++++++++++++++++++++++++ client/package.json | 1 + client/src/App.js | 2 +- 3 files changed, 237 insertions(+), 1 deletion(-) diff --git a/client/package-lock.json b/client/package-lock.json index 869154f..50d4831 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -16,6 +16,7 @@ "@testing-library/user-event": "^12.8.3", "react": "^17.0.2", "react-dom": "^17.0.2", + "react-router-dom": "^5.2.1", "react-scripts": "4.0.3", "styled-components": "^5.3.1", "web-vitals": "^1.1.2" @@ -9917,6 +9918,19 @@ "resolved": "https://registry.npmjs.org/hex-color-regex/-/hex-color-regex-1.1.0.tgz", "integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==" }, + "node_modules/history": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", + "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", + "dependencies": { + "@babel/runtime": "^7.1.2", + "loose-envify": "^1.2.0", + "resolve-pathname": "^3.0.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0", + "value-equal": "^1.0.1" + } + }, "node_modules/hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -13607,6 +13621,19 @@ "node": ">=4" } }, + "node_modules/mini-create-react-context": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/mini-create-react-context/-/mini-create-react-context-0.4.1.tgz", + "integrity": "sha512-YWCYEmd5CQeHGSAKrYvXgmzzkrvssZcuuQDDeqkT+PziKGMgE+0MCCtcKbROzocGBG1meBLl2FotlRwf4gAzbQ==", + "dependencies": { + "@babel/runtime": "^7.12.1", + "tiny-warning": "^1.0.3" + }, + "peerDependencies": { + "prop-types": "^15.0.0", + "react": "^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, "node_modules/mini-css-extract-plugin": { "version": "0.11.3", "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.11.3.tgz", @@ -16648,6 +16675,83 @@ "node": ">=0.10.0" } }, + "node_modules/react-router": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.1.tgz", + "integrity": "sha512-lIboRiOtDLFdg1VTemMwud9vRVuOCZmUIT/7lUoZiSpPODiiH1UQlfXy+vPLC/7IWdFYnhRwAyNqA/+I7wnvKQ==", + "dependencies": { + "@babel/runtime": "^7.12.13", + "history": "^4.9.0", + "hoist-non-react-statics": "^3.1.0", + "loose-envify": "^1.3.1", + "mini-create-react-context": "^0.4.0", + "path-to-regexp": "^1.7.0", + "prop-types": "^15.6.2", + "react-is": "^16.6.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0" + }, + "peerDependencies": { + "react": ">=15" + } + }, + "node_modules/react-router-dom": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.2.1.tgz", + "integrity": "sha512-xhFFkBGVcIVPbWM2KEYzED+nuHQPmulVa7sqIs3ESxzYd1pYg8N8rxPnQ4T2o1zu/2QeDUWcaqST131SO1LR3w==", + "dependencies": { + "@babel/runtime": "^7.12.13", + "history": "^4.9.0", + "loose-envify": "^1.3.1", + "prop-types": "^15.6.2", + "react-router": "5.2.1", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0" + }, + "peerDependencies": { + "react": ">=15" + } + }, + "node_modules/react-router-dom/node_modules/@babel/runtime": { + "version": "7.15.3", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.15.3.tgz", + "integrity": "sha512-OvwMLqNXkCXSz1kSm58sEsNuhqOx/fKpnUnKnFB5v8uDda5bLNEHNgKPvhDN6IU0LDcnHQ90LlJ0Q6jnyBSIBA==", + "dependencies": { + "regenerator-runtime": "^0.13.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/react-router/node_modules/@babel/runtime": { + "version": "7.15.3", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.15.3.tgz", + "integrity": "sha512-OvwMLqNXkCXSz1kSm58sEsNuhqOx/fKpnUnKnFB5v8uDda5bLNEHNgKPvhDN6IU0LDcnHQ90LlJ0Q6jnyBSIBA==", + "dependencies": { + "regenerator-runtime": "^0.13.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/react-router/node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "node_modules/react-router/node_modules/path-to-regexp": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "dependencies": { + "isarray": "0.0.1" + } + }, + "node_modules/react-router/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/react-scripts": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-4.0.3.tgz", @@ -17160,6 +17264,11 @@ "node": ">=8" } }, + "node_modules/resolve-pathname": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", + "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" + }, "node_modules/resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", @@ -19437,6 +19546,16 @@ "resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz", "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=" }, + "node_modules/tiny-invariant": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.1.0.tgz", + "integrity": "sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw==" + }, + "node_modules/tiny-warning": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", + "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" + }, "node_modules/tmpl": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", @@ -20056,6 +20175,11 @@ "spdx-expression-parse": "^3.0.0" } }, + "node_modules/value-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", + "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" + }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -29363,6 +29487,19 @@ "resolved": "https://registry.npmjs.org/hex-color-regex/-/hex-color-regex-1.1.0.tgz", "integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==" }, + "history": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", + "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", + "requires": { + "@babel/runtime": "^7.1.2", + "loose-envify": "^1.2.0", + "resolve-pathname": "^3.0.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0", + "value-equal": "^1.0.1" + } + }, "hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -32115,6 +32252,15 @@ "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==" }, + "mini-create-react-context": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/mini-create-react-context/-/mini-create-react-context-0.4.1.tgz", + "integrity": "sha512-YWCYEmd5CQeHGSAKrYvXgmzzkrvssZcuuQDDeqkT+PziKGMgE+0MCCtcKbROzocGBG1meBLl2FotlRwf4gAzbQ==", + "requires": { + "@babel/runtime": "^7.12.1", + "tiny-warning": "^1.0.3" + } + }, "mini-css-extract-plugin": { "version": "0.11.3", "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.11.3.tgz", @@ -34530,6 +34676,75 @@ "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.8.3.tgz", "integrity": "sha512-X8jZHc7nCMjaCqoU+V2I0cOhNW+QMBwSUkeXnTi8IPe6zaRWfn60ZzvFDZqWPfmSJfjub7dDW1SP0jaHWLu/hg==" }, + "react-router": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.1.tgz", + "integrity": "sha512-lIboRiOtDLFdg1VTemMwud9vRVuOCZmUIT/7lUoZiSpPODiiH1UQlfXy+vPLC/7IWdFYnhRwAyNqA/+I7wnvKQ==", + "requires": { + "@babel/runtime": "^7.12.13", + "history": "^4.9.0", + "hoist-non-react-statics": "^3.1.0", + "loose-envify": "^1.3.1", + "mini-create-react-context": "^0.4.0", + "path-to-regexp": "^1.7.0", + "prop-types": "^15.6.2", + "react-is": "^16.6.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.15.3", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.15.3.tgz", + "integrity": "sha512-OvwMLqNXkCXSz1kSm58sEsNuhqOx/fKpnUnKnFB5v8uDda5bLNEHNgKPvhDN6IU0LDcnHQ90LlJ0Q6jnyBSIBA==", + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "path-to-regexp": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "requires": { + "isarray": "0.0.1" + } + }, + "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==" + } + } + }, + "react-router-dom": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.2.1.tgz", + "integrity": "sha512-xhFFkBGVcIVPbWM2KEYzED+nuHQPmulVa7sqIs3ESxzYd1pYg8N8rxPnQ4T2o1zu/2QeDUWcaqST131SO1LR3w==", + "requires": { + "@babel/runtime": "^7.12.13", + "history": "^4.9.0", + "loose-envify": "^1.3.1", + "prop-types": "^15.6.2", + "react-router": "5.2.1", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.15.3", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.15.3.tgz", + "integrity": "sha512-OvwMLqNXkCXSz1kSm58sEsNuhqOx/fKpnUnKnFB5v8uDda5bLNEHNgKPvhDN6IU0LDcnHQ90LlJ0Q6jnyBSIBA==", + "requires": { + "regenerator-runtime": "^0.13.4" + } + } + } + }, "react-scripts": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-4.0.3.tgz", @@ -34933,6 +35148,11 @@ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==" }, + "resolve-pathname": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", + "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" + }, "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", @@ -36740,6 +36960,16 @@ "resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz", "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=" }, + "tiny-invariant": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.1.0.tgz", + "integrity": "sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw==" + }, + "tiny-warning": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", + "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" + }, "tmpl": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", @@ -37223,6 +37453,11 @@ "spdx-expression-parse": "^3.0.0" } }, + "value-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", + "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" + }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/client/package.json b/client/package.json index fb397ef..67e27d8 100644 --- a/client/package.json +++ b/client/package.json @@ -11,6 +11,7 @@ "@testing-library/user-event": "^12.8.3", "react": "^17.0.2", "react-dom": "^17.0.2", + "react-router-dom": "^5.2.1", "react-scripts": "4.0.3", "styled-components": "^5.3.1", "web-vitals": "^1.1.2" diff --git a/client/src/App.js b/client/src/App.js index 90f13fc..164bdd3 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -9,7 +9,7 @@ import WriteModal from "./comp/WriteModal"; function App() { // console.log(dummyData); - const [isLogin, setisLogin] = useState(false); + const [isLogin, setisLogin] = useState(tru); const [searched, setSearched] = useState(false); const [onModal, setOnModal] = useState(false); const [writeModal, setWriteModal] = useState(false); From ce826a97d86be6789f639bf035263c648ace01f2 Mon Sep 17 00:00:00 2001 From: Lee Naeun Date: Sat, 28 Aug 2021 22:47:37 +0900 Subject: [PATCH 5/7] =?UTF-8?q?:lipstick:=20[Client]=20Mypage.js=20:=20hov?= =?UTF-8?q?er=EC=99=80=20size=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/App.js | 52 ++++----- client/src/app.css | 5 +- client/src/comp/Nav.js | 25 ++++- client/src/comp/SearchInput.js | 25 +++-- client/src/comp/SearchResult.js | 4 +- client/src/pages/Mypage.js | 186 ++++++++++++++++---------------- 6 files changed, 166 insertions(+), 131 deletions(-) diff --git a/client/src/App.js b/client/src/App.js index 968066a..de34844 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -6,7 +6,7 @@ import { useState } from "react"; import Nav from "./comp/Nav"; import Modal from "./comp/Modal"; import Mypage from "./pages/Mypage"; -import {BrowserRouter, Switch, Route, Link} from "react-router-dom" +import { BrowserRouter, Switch, Route, Link } from "react-router-dom"; import WriteModal from "./comp/WriteModal"; function App() { @@ -15,38 +15,40 @@ function App() { const [searched, setSearched] = useState(false); const [onModal, setOnModal] = useState(false); const [writeModal, setWriteModal] = useState(false); - + return (
    {onModal ? : null} {writeModal ? : null}
    ); } diff --git a/client/src/app.css b/client/src/app.css index f9a7038..6c044ce 100644 --- a/client/src/app.css +++ b/client/src/app.css @@ -36,9 +36,6 @@ button { box-sizing: border-box; } /* HTML5 display-role reset for older browsers */ -html { - /* font-size: 16px; */ -} body { line-height: 1; @@ -121,5 +118,5 @@ footer { min-height: 67px; line-height: 10vh; text-align: center; - font-size: 0.97rem; + font-size: max(0.85vw, 11px); } diff --git a/client/src/comp/Nav.js b/client/src/comp/Nav.js index 2e6db35..f3af538 100644 --- a/client/src/comp/Nav.js +++ b/client/src/comp/Nav.js @@ -1,6 +1,6 @@ import React, { useState } from "react"; import styled from "styled-components"; -import {Link} from "react-router-dom" +import { Link } from "react-router-dom"; import profile from "../none_profile.jpeg"; function Nav({ isLogin }) { @@ -24,6 +24,12 @@ function Nav({ isLogin }) { font-weight: 700; display: block; margin-top: 5vh; + cursor: pointer; + transition: 0.3s; + :hover { + background-color: black; + color: white; + } &:nth-child(1) { margin-top: 0; } @@ -38,6 +44,12 @@ function Nav({ isLogin }) { font-weight: 700; display: block; margin: 5vh auto 0; + cursor: pointer; + transition: 0.3s; + :hover { + background-color: black; + color: white; + } &:nth-child(1) { margin-top: 0; } @@ -46,6 +58,7 @@ function Nav({ isLogin }) { const ProfileWrap = styled.div` width: 100%; text-align: center; + cursor: pointer; > img { width: 22vh; height: 22vh; @@ -62,6 +75,12 @@ function Nav({ isLogin }) { font-weight: 700; display: block; margin: 0 auto; + transition: 0.3s; + } + > button:hover { + background-color: black; + color: white; + cursor: pointer; } `; @@ -76,9 +95,7 @@ function Nav({ isLogin }) { LOGOUT - - MYPAGE - + MYPAGE
    diff --git a/client/src/comp/SearchInput.js b/client/src/comp/SearchInput.js index 42284c8..13eac02 100644 --- a/client/src/comp/SearchInput.js +++ b/client/src/comp/SearchInput.js @@ -6,23 +6,36 @@ const SearchWrap = styled.div` margin: 0 auto; padding: 2vh 0vh 4vh; text-align: center; + box-sizing: border-box; > .searchInput { - width: 60%; - height: 40px; + width: 58%; + height: 3.2vw; + min-height: 35px; border: 2px solid #000; - border-radius: 20px; + border-radius: 30px; margin-right: 10px; outline: none; padding-left: 20px; } > .searchBtn { - width: 90px; - height: 44px; + width: 6vw; + height: 3.2vw; + min-height: 35px; + min-width: 50px; background-color: #000; color: #fff; border: none; margin-top: 1vh; - border-radius: 20px; + border-radius: 30px; + font-size: max(0.8vw, 11px); + border: 2px solid black; + cursor: pointer; + transition: 0.3s; + } + > .searchBtn:hover { + background-color: white; + color: black; + border: 2px solid black; } `; function SearchInput() { diff --git a/client/src/comp/SearchResult.js b/client/src/comp/SearchResult.js index b935a3f..108a257 100644 --- a/client/src/comp/SearchResult.js +++ b/client/src/comp/SearchResult.js @@ -26,7 +26,7 @@ function SearchResult({ data }) { background-color: #ffff8d; p { padding: 0 5px; - font-size: 75%; + font-size: max(11px, 0.9vw); flex: 1 0 auto; overflow: hidden; text-overflow: ellipsis; @@ -63,7 +63,7 @@ function SearchResult({ data }) { border: 2px solid black; background-color: black; color: white; - font-size: 0.8rem; + font-size: max(11px, 0.8vw); transition: 0.2s; :hover { background-color: white; diff --git a/client/src/pages/Mypage.js b/client/src/pages/Mypage.js index 3c3c65b..a2fe553 100644 --- a/client/src/pages/Mypage.js +++ b/client/src/pages/Mypage.js @@ -2,104 +2,110 @@ import React from "react"; import styled from "styled-components"; const MypageWrap = styled.div` - width:100%; - display:grid; - place-items:center; - font-size:max(16px, 0.8vw); -` + width: 100%; + height: 55vh; + display: grid; + place-items: center; + font-size: max(16px, 0.8vw); +`; const MypageContent = styled.div` - width:75%; - min-width:200px; - display:flex; - flex-direction:column; - flex-wrap:wrap; -` + width: 75%; + min-width: 200px; + display: flex; + flex-direction: column; + flex-wrap: wrap; +`; const UserContent = styled.div` - display:flex; - justify-content:space-between; + display: flex; + justify-content: space-between; + padding: 1vw 0; + border-bottom: 3px solid #000; + margin-bottom: 2vw; +`; +const ContentList = styled.ul` + display: flex; + flex-direction: column; + margin-bottom: 2vw; + > .content { + display: flex; + justify-content: space-between; padding: 1vw 0; border-bottom: 3px solid #000; - margin-bottom:2vw; -` -const ContentList = styled.ul` - display:flex; - flex-direction:column; - margin-bottom:2vw; - >.content{ - display:flex; - justify-content: space-between; - padding: 1vw 0; - border-bottom: 3px solid #000; - > input{ - flex:1 1 auto; - } - >.contentInfo{ - flex:5 1 auto; - display:flex; - justify-content: space-evenly; - } + > input { + flex: 1 1 auto; } -` -const ContentCheck = styled.div` - display:flex; - justify-content: space-between; - >button{ - height:2vw; - min-height:25px; - width:8vw; - min-width:80px; - border:2px solid black; - border-radius:20px; - word-break:keep-all; + > .contentInfo { + flex: 5 1 auto; + display: flex; + justify-content: space-evenly; } -` + } +`; +const ContentCheck = styled.div` + display: flex; + justify-content: space-between; + > button { + width: 9vw; + min-width: 75px; + height: 5vh; + border: 2px solid black; + border-radius: 5vh; + word-break: keep-all; + cursor: pointer; + transition: 0.3s; + } + > button:hover { + background-color: black; + color: white; + } +`; -function Mypage(){ - return( - - - -

    작성하신 글은 0개 이며, 최대 추천수는 0개 입니다

    - -
    +function Mypage() { + return ( + + + +

    작성하신 글은 0개 이며, 최대 추천수는 0개 입니다

    + +
    - -
  • - -
    -

    단어

    -

    단어 뜻

    -

    추천 수

    -
    -
  • -
  • - -
    -

    단어

    -

    단어 뜻

    -

    추천 수

    -
    -
  • -
  • - -
    -

    단어

    -

    단어 뜻

    -

    추천 수

    -
    -
  • -
    + +
  • + +
    +

    단어

    +

    단어 뜻

    +

    추천 수

    +
    +
  • +
  • + +
    +

    단어

    +

    단어 뜻

    +

    추천 수

    +
    +
  • +
  • + +
    +

    단어

    +

    단어 뜻

    +

    추천 수

    +
    +
  • +
    - - - - -
    -
    - ) + + + + +
    +
    + ); } /*
    @@ -127,4 +133,4 @@ function Mypage(){ */ -export default Mypage \ No newline at end of file +export default Mypage; From 7182c36e5aaf857c467816b6af2fa1ff8fbae129 Mon Sep 17 00:00:00 2001 From: minjman2659 Date: Sun, 29 Aug 2021 13:35:08 +0900 Subject: [PATCH 6/7] =?UTF-8?q?[Server]=20delete.js=20:=20=EC=97=AC?= =?UTF-8?q?=EB=9F=AC=20=EC=BD=98=ED=85=90=EC=B8=A0=20=EC=82=AD=EC=A0=9C=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/controllers/contents/contents.js | 2 +- server/controllers/contents/delete.js | 62 ++++++++++--------------- 2 files changed, 25 insertions(+), 39 deletions(-) diff --git a/server/controllers/contents/contents.js b/server/controllers/contents/contents.js index b24fb01..8525c5b 100644 --- a/server/controllers/contents/contents.js +++ b/server/controllers/contents/contents.js @@ -1,4 +1,4 @@ -const { content, thumbs } = require("../../models"); +const { content } = require("../../models"); const { generateAccessToken, isAuthorized, diff --git a/server/controllers/contents/delete.js b/server/controllers/contents/delete.js index 4150f30..dbb6053 100644 --- a/server/controllers/contents/delete.js +++ b/server/controllers/contents/delete.js @@ -7,29 +7,22 @@ const { refreshAuthorized } = require("../tokenFunction/refreshToken"); const { verify } = require("jsonwebtoken"); module.exports = { - post: (req, res) => { + post: async (req, res) => { if (isAuthorized(req)) { // accessToken이 만료되지 않았을 경우, // => 바로 요청에 대한 응답 제공 - const { contentId } = req.body; - content - .destroy({ - where: { id: contentId }, + const { contentId } = req.body; // 배열 + for (let i = 0; i < contentId.length; i++) { + await content.destroy({ + where: { id: contentId[i] }, + force: true, + }); + await thumbs.destroy({ + where: { content_Id: contentId[i] }, force: true, - }) - .then(() => { - return thumbs.destroy({ - where: { content_Id: contentId }, - force: true, - }); - }) - .then((data) => { - console.log(data); - res.status(200).json({ message: "ok" }); - }) - .catch((err) => { - console.log(err); }); + } + res.status(200).json({ message: "ok" }); } else { // accessToken이 만료되어서 refreshToken을 판별하고, // refreshToken은 만료되지 않았을 경우, @@ -39,28 +32,21 @@ module.exports = { const tokenCheck = verify(token, process.env.REFRESH_SECRET); const accessToken = generateAccessToken(tokenCheck); - const { contentId } = req.body; - content - .destroy({ - where: { id: contentId }, + const { contentId } = req.body; // 배열 + for (let i = 0; i < contentId.length; i++) { + await content.destroy({ + where: { id: contentId[i] }, + force: true, + }); + await thumbs.destroy({ + where: { content_Id: contentId[i] }, force: true, - }) - .then(() => { - return thumbs.destroy({ - where: { content_Id: contentId }, - force: true, - }); - }) - .then((data) => { - console.log(data); - res.status(201).json({ - accessToken: accessToken, - message: "ok", - }); - }) - .catch((err) => { - console.log(err); }); + } + res.status(201).json({ + accessToken: accessToken, + message: "ok", + }); } else { // accessToken이 만료되어서 refreshToken을 판별하고, // refreshToken도 만료되었을 경우, From 92d0fc7e026190a2c57fc44ef08e346daa6010e2 Mon Sep 17 00:00:00 2001 From: Lee Naeun Date: Sun, 29 Aug 2021 13:58:27 +0900 Subject: [PATCH 7/7] :lipstick: [Client] app.css : fix css --- client/src/app.css | 4 ---- 1 file changed, 4 deletions(-) diff --git a/client/src/app.css b/client/src/app.css index e66b2d0..3ad76a5 100644 --- a/client/src/app.css +++ b/client/src/app.css @@ -117,9 +117,5 @@ footer { height: 4.5vh; line-height: 4.5vh; text-align: center; -<<<<<<< HEAD font-size: max(0.85vw, 11px); -======= - font-size: max(0.9vw, 10px); ->>>>>>> 72bef4e71c5f8079159c860dec0c8ffddb357c70 }