From 1b75eb44b4a6f4a074d61b7f154f89ec7543c0a2 Mon Sep 17 00:00:00 2001 From: rktguswjd <010_cm@naver.com> Date: Fri, 2 Jul 2021 16:54:38 +0900 Subject: [PATCH 1/8] =?UTF-8?q?[feat]=20Card.jsx=20->=20=EB=A7=8C=EB=93=A0?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8=20onClick=20=EC=9D=B4=EB=B2=A4?= =?UTF-8?q?=ED=8A=B8=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=9D=B4=EB=8F=99=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Feed/Card.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/Feed/Card.jsx b/src/components/Feed/Card.jsx index 792aa4b3..d8805c43 100644 --- a/src/components/Feed/Card.jsx +++ b/src/components/Feed/Card.jsx @@ -16,6 +16,7 @@ const Card = ({ sharedCnt, participatedCnt, testLink, + result = false, }) => { const { goPage } = usePage(); // const [bookMark, setBookMark] = useState(false); @@ -28,7 +29,11 @@ const Card = ({ const onClickTest = useCallback( (e) => { const testid = testLink.split("?")[1]; - goPage(`/testing/welcome`, testid); + if (result) { + goPage(`/result`, testid); + } else { + goPage(`/testing/welcome`, testid); + } }, [goPage, testLink] ); From 071d0a3130c737787e68836ee6ae6583b83949ea Mon Sep 17 00:00:00 2001 From: rktguswjd <010_cm@naver.com> Date: Fri, 2 Jul 2021 16:55:48 +0900 Subject: [PATCH 2/8] =?UTF-8?q?[feat]=20TabTests.jsx=20->=20=EB=A7=8C?= =?UTF-8?q?=EB=93=A0=ED=85=8C=EC=8A=A4=ED=8A=B8=EC=9D=BC=20=EA=B2=BD?= =?UTF-8?q?=EC=9A=B0=20result=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=20=ED=8C=90=EB=8B=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MyPage/TabTests.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/MyPage/TabTests.jsx b/src/components/MyPage/TabTests.jsx index ed09d93d..eb955ea3 100644 --- a/src/components/MyPage/TabTests.jsx +++ b/src/components/MyPage/TabTests.jsx @@ -65,6 +65,7 @@ const TabTests = (props) => { sharedCnt={test.sharedCnt} participatedCnt={test.participantsCnt} testLink={test.testLink} + result={selectedTab === MADETEST && true} /> ))} From 0c93e7ddaecca4a35d6797d9ce1aea61a79983a8 Mon Sep 17 00:00:00 2001 From: rktguswjd <010_cm@naver.com> Date: Fri, 2 Jul 2021 16:56:11 +0900 Subject: [PATCH 3/8] =?UTF-8?q?[feat]=20result=20=EB=9D=BC=EC=9A=B0?= =?UTF-8?q?=ED=84=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/App.js b/src/App.js index ce59cfd5..2ce72bea 100644 --- a/src/App.js +++ b/src/App.js @@ -25,6 +25,7 @@ import "swiper/swiper.min.css"; import "swiper/components/pagination/pagination.min.css"; import "swiper/components/navigation/navigation.min.css"; import initialize from "./utils/initialize"; +import Result from "./components/frame/Result"; const App = () => { const { checkLogIn, status } = useUser(); @@ -56,7 +57,10 @@ const App = () => { {/* Testing */} + {/* mypage */} + {/* result */} + From 51314f52413b18f803bf17c4c6491dd796a5bc14 Mon Sep 17 00:00:00 2001 From: rktguswjd <010_cm@naver.com> Date: Fri, 2 Jul 2021 16:56:49 +0900 Subject: [PATCH 4/8] =?UTF-8?q?[feat]=20result=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20header=EC=A0=95=EB=B3=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/constants/headerInfo.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/constants/headerInfo.js b/src/constants/headerInfo.js index 32530a07..0757cb7c 100644 --- a/src/constants/headerInfo.js +++ b/src/constants/headerInfo.js @@ -83,15 +83,22 @@ const headerInfo = { background: "#fff", }, - "mypage/main": { + "/mypage/main": { leftType: BACK, title: { type: TITLE, title: "마이페이지" }, }, - "mypage/manage": { + "/mypage/manage": { leftType: BACK, title: { type: TITLE, title: "계정 관리" }, }, + + "/result": { + leftType: BACK, + title: { type: NOTHING }, + rightType: NOTHING, + background: theme.colors.lightblue, + }, }; export default headerInfo; From 55b2c944822bd9eb734d17b91c4a873b70a8b8f9 Mon Sep 17 00:00:00 2001 From: rktguswjd <010_cm@naver.com> Date: Fri, 2 Jul 2021 16:57:54 +0900 Subject: [PATCH 5/8] =?UTF-8?q?[feat]=20frame=20=ED=8F=B4=EB=8D=94=20->=20?= =?UTF-8?q?Result.jsx=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/frame/Result.jsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/components/frame/Result.jsx diff --git a/src/components/frame/Result.jsx b/src/components/frame/Result.jsx new file mode 100644 index 00000000..4e06ad68 --- /dev/null +++ b/src/components/frame/Result.jsx @@ -0,0 +1,15 @@ +import React from "react"; +import queryString from "query-string"; +import Error from "../../view/Error"; +import InquireResult from "../../view/testresult/InquireResult"; + +const Result = ({ location }) => { + const { testid } = queryString.parse(location.search); + + if (testid) { + return ; + } + return ; +}; + +export default Result; From eed9cd5dca943434d76cda9eac734e47b0e1ce57 Mon Sep 17 00:00:00 2001 From: rktguswjd <010_cm@naver.com> Date: Fri, 2 Jul 2021 16:58:41 +0900 Subject: [PATCH 6/8] =?UTF-8?q?[feat]=20ToggleSwitch=20=EC=BB=B4=ED=8F=AC?= =?UTF-8?q?=EB=84=8C=ED=8A=B8=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Result/ToggleSwitch.jsx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/components/Result/ToggleSwitch.jsx diff --git a/src/components/Result/ToggleSwitch.jsx b/src/components/Result/ToggleSwitch.jsx new file mode 100644 index 00000000..873ab303 --- /dev/null +++ b/src/components/Result/ToggleSwitch.jsx @@ -0,0 +1,21 @@ +import React, { useState } from "react"; +import Switch from "react-switch"; + +const ToggleSwitch = () => { + const [checked, setChecked] = useState(false); + const handleChange = (checked) => { + setChecked(checked); + }; + return ( + + ); +}; + +export default ToggleSwitch; From f0109f29d92c058d3aac5f3f94a5f3e63675565d Mon Sep 17 00:00:00 2001 From: rktguswjd <010_cm@naver.com> Date: Fri, 2 Jul 2021 16:59:32 +0900 Subject: [PATCH 7/8] =?UTF-8?q?[feat]=20InquireResult=20view=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/view/testresult/InquireResult.jsx | 103 ++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 src/view/testresult/InquireResult.jsx diff --git a/src/view/testresult/InquireResult.jsx b/src/view/testresult/InquireResult.jsx new file mode 100644 index 00000000..99df524e --- /dev/null +++ b/src/view/testresult/InquireResult.jsx @@ -0,0 +1,103 @@ +import React from "react"; +import styled from "styled-components"; +import { SVG } from "../../components/common"; +import RoundContiner from "../testing/SubComponents/RoundContainer"; +import ENUM from "../../constants/Enum"; +import ToggleSwitch from "../../components/Result/ToggleSwitch"; + +const InquireResult = () => { + return ( + + + 참여인원 3,258명 + + 디프만 우정 테스트 + + +
4,473
+
+
+ + +
이 테스트를 피드에 공개하기
+
+ +
+
+ +
테스트 링크 비활성화하기
+
+ +
+
+
+
+ + +
+ ); +}; + +export default InquireResult; + +const Continer = styled.div` + display: flex; + flex-direction: column; +`; +const TopContiner = styled.div` + padding: 0 2rem 1.5rem 2rem; +`; +const PartNumber = styled.div` + padding-bottom: 0.3rem; + font-weight: normal; + font-size: 1.3rem; + line-height: 19px; + letter-spacing: -0.3px; + color: #b7bdcb; +`; +const Info = styled.div` + display: flex; + justify-content: space-between; + padding-bottom: ${({ theme: { fontSizes } }) => fontSizes.lg}rem; +`; +const TestName = styled.div` + font-weight: bold; + font-size: ${({ theme: { fontSizes } }) => fontSizes.xxl}rem; + line-height: 35px; + letter-spacing: -1px; + color: ${({ theme: { colors } }) => colors.bodyGray}; +`; +const ShareBox = styled.div` + font-weight: normal; + font-size: ${({ theme: { fontSizes } }) => fontSizes.xs}rem; + line-height: 21px; + letter-spacing: -0.3px; + color: ${({ theme: { colors } }) => colors.body}; + align-items: center; + display: flex; + .share-number { + margin-left: 5px; + } +`; +const ToggleArea = styled.div` + flex-direction: column; +`; +const ToggleBox = styled.div` + display: flex; + justify-content: space-between; + font-weight: normal; + font-size: 1.5rem; + line-height: 24px; + letter-spacing: -0.5px; + color: ${({ theme: { colors } }) => colors.darker}; + .toggle { + align-items: center; + display: flex; + } +`; From 295dae3af158d3976d9ec83453134a20be01812b Mon Sep 17 00:00:00 2001 From: rktguswjd <010_cm@naver.com> Date: Fri, 2 Jul 2021 17:00:21 +0900 Subject: [PATCH 8/8] =?UTF-8?q?[chore]=20react-switch=20=EC=84=A4=EC=B9=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 6b70e5dc..ed00c51e 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "react-router": "^5.2.0", "react-router-dom": "^5.2.0", "react-scripts": "4.0.3", + "react-switch": "^6.0.0", "redux": "^4.0.5", "redux-saga": "^1.1.3", "styled-components": "^5.2.3",