From 186e6b94132a1c84420fd046438f110b310268f4 Mon Sep 17 00:00:00 2001 From: hwinkr Date: Sat, 12 Aug 2023 16:43:52 +0900 Subject: [PATCH 1/6] =?UTF-8?q?Chore:=20=EC=84=9C=EB=B2=84=EC=99=80=20?= =?UTF-8?q?=EC=A1=B8=EC=97=85=EC=9A=94=EA=B1=B4=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=EC=8A=A4=ED=82=A4=EB=A7=88=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mocks/handlers/graudationHandler.ts | 41 +++++++++++++++---------- src/pages/Home/index.tsx | 20 ++++++++---- 2 files changed, 38 insertions(+), 23 deletions(-) diff --git a/src/mocks/handlers/graudationHandler.ts b/src/mocks/handlers/graudationHandler.ts index 01c71ae4..26b7229b 100644 --- a/src/mocks/handlers/graudationHandler.ts +++ b/src/mocks/handlers/graudationHandler.ts @@ -1,26 +1,29 @@ import { SERVER_URL } from '@config/index'; import { RequestHandler, rest } from 'msw'; -type GRADUATION_LINK = { - [key in string]: { - link: string; - }; -}; +interface GraduationLink { + department: string; + link: string; +} -const MOCK_GRDUATION_LINK: GRADUATION_LINK = { - 컴퓨터인공지능학부: { - link: 'https://ce.pknu.ac.kr/ce/2889', +const MOCK_GRDUATION_LINK: GraduationLink[] = [ + { + department: '데이터정보과학부', + link: 'https://archieng.pknu.ac.kr/archieng/1423?action=view&no=9911252', }, - 데이터정보과학부: { - link: 'https://www.youtube.com', + { + department: '미디어커뮤니케이션학부', + link: 'https://masscom.pknu.ac.kr/comm/3128?action=view&no=9916308', }, - '조형학부 건축학전공': { - link: 'https://www.naver.com', + { + department: '컴퓨터인공지능학부', + link: 'https://ce.pknu.ac.kr/ce/2889', }, - 미디어커뮤니케이션학부: { - link: 'https://www.google.com', + { + department: '조형학부 건축학전공', + link: 'https://pknuarchi.pknu.ac.kr/pknuarchi/969?action=view&no=9933526', }, -}; +]; export const graduationHandler: RequestHandler[] = [ rest.get(`${SERVER_URL}/api/graduation`, (req, res, ctx) => { @@ -30,8 +33,12 @@ export const graduationHandler: RequestHandler[] = [ return res( ctx.status(200), ctx.json({ - major: major, - graduationLink: MOCK_GRDUATION_LINK[major].link, + department: major, + link: MOCK_GRDUATION_LINK[ + MOCK_GRDUATION_LINK.findIndex( + (graduationLink) => graduationLink.department === major, + ) + ].link, }), ); } diff --git a/src/pages/Home/index.tsx b/src/pages/Home/index.tsx index b0658636..8eef5897 100644 --- a/src/pages/Home/index.tsx +++ b/src/pages/Home/index.tsx @@ -3,22 +3,25 @@ import InformCard from '@components/Card/InformCard'; import { css } from '@emotion/react'; import useMajor from '@hooks/useMajor'; import useRouter from '@hooks/useRouter'; +import { AxiosResponse } from 'axios'; import { useEffect, useState } from 'react'; const Home = () => { - const [graduationLink, setGraduationLink] = useState(''); + const [graduationLink, setGraduationLink] = useState(''); const { routerTo } = useRouter(); const { major } = useMajor(); - const routerToGraduationRequired = () => { - window.location.href = graduationLink; + const routerToGraduationRequiredPage = (graduationLink: string | null) => { + graduationLink && window.open(graduationLink, '_blank'); }; useEffect(() => { if (!major) return; const getGraduationLink = async () => { - const response = await http.get(`/api/graduation?major=${major}`); - setGraduationLink(response.data.graduationLink); + const response: AxiosResponse = await http.get( + `/api/graduation?major=${major}`, + ); + setGraduationLink(response.data.link); }; getGraduationLink(); }, [major]); @@ -41,7 +44,7 @@ const Home = () => { icon="school" title="졸업요건" majorRequired={true} - onClick={() => routerToGraduationRequired()} + onClick={() => routerToGraduationRequiredPage(graduationLink)} /> @@ -49,3 +52,8 @@ const Home = () => { }; export default Home; + +interface GraduationLink { + department: string; + link: string | null; +} From ea3170dabfbde8579120439708d67523d8da8da7 Mon Sep 17 00:00:00 2001 From: Lee sang Yeop Date: Mon, 14 Aug 2023 23:57:38 +0900 Subject: [PATCH 2/6] =?UTF-8?q?Fix:=20Body=EC=9D=98=20=EB=86=92=EC=9D=B4?= =?UTF-8?q?=20=EC=84=A4=EC=A0=95=20=EC=95=88=ED=95=98=EB=8A=94=EA=B1=B8?= =?UTF-8?q?=EB=A1=9C=20=EB=A1=A4=EB=B0=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 8e9b765c..814cfa40 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -29,6 +29,5 @@ const App = () => { export default App; const Body = styled.div` - height: calc(100vh - 16vh); - padding: 8vh 0 8vh 0; + padding: 8.5vh 0 8.5vh 0; `; From 224aac606d2aca7f98831da9dafda62109a968d3 Mon Sep 17 00:00:00 2001 From: Lee sang Yeop Date: Tue, 15 Aug 2023 01:08:12 +0900 Subject: [PATCH 3/6] =?UTF-8?q?Refactor:=20=EC=B9=B4=EB=93=9C=20=EB=AA=A8?= =?UTF-8?q?=EC=96=91=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Card/InformCard/index.tsx | 32 +++++++++++------ src/pages/Home/index.tsx | 45 ++++++++++++------------ 2 files changed, 44 insertions(+), 33 deletions(-) diff --git a/src/components/Card/InformCard/index.tsx b/src/components/Card/InformCard/index.tsx index af68990b..ac298949 100644 --- a/src/components/Card/InformCard/index.tsx +++ b/src/components/Card/InformCard/index.tsx @@ -8,7 +8,6 @@ import useModals from '@hooks/useModals'; import useRouter from '@hooks/useRouter'; import { THEME } from '@styles/ThemeProvider/theme'; import { IconKind } from '@type/styles/icon'; -import { setSize } from '@utils/styles/size'; // TODO: InformCard 컴포넌트 Props 및 로직 수정 @@ -50,18 +49,26 @@ const InformCard = ({ return ( <> - - - {title} - + + + {title} + + (({ icon }) => { display: 'flex', flexDirection: 'column', padding: '15px', + marginBottom: '5%', borderRadius: '15px', backgroundColor: icon === 'school' ? THEME.BACKGROUND : THEME.PRIMARY, color: icon === 'school' ? THEME.TEXT.GRAY : THEME.TEXT.WHITE, + boxShadow: 'rgba(149, 157, 165, 0.2) 0px 8px 24px', + + height: '90px', '& > svg': { margin: '10px 0', }, - ...setSize(200, 150), cursor: 'pointer', }; }); diff --git a/src/pages/Home/index.tsx b/src/pages/Home/index.tsx index b0658636..b6f25e89 100644 --- a/src/pages/Home/index.tsx +++ b/src/pages/Home/index.tsx @@ -1,6 +1,6 @@ import http from '@apis/http'; import InformCard from '@components/Card/InformCard'; -import { css } from '@emotion/react'; +import styled from '@emotion/styled'; import useMajor from '@hooks/useMajor'; import useRouter from '@hooks/useRouter'; import { useEffect, useState } from 'react'; @@ -24,28 +24,29 @@ const Home = () => { }, [major]); return ( - <> -
- routerTo('/announcement')} - /> - routerToGraduationRequired()} - /> -
- + + routerTo('/announcement')} + /> + routerToGraduationRequired()} + /> + ); }; export default Home; + +const Container = styled.div` + display: flex; + flex-direction: column; + width: 85%; + text-aligb: center; + margin: 0 auto; +`; From 1906b7931b4e592b5942924ae128d0b222191ec2 Mon Sep 17 00:00:00 2001 From: Lee sang Yeop Date: Tue, 15 Aug 2023 01:33:36 +0900 Subject: [PATCH 4/6] =?UTF-8?q?Style:=20=ED=97=A4=EB=8D=94,=20=ED=91=B8?= =?UTF-8?q?=ED=84=B0=20=EA=B7=B8=EB=A6=BC=EC=9E=90=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FooterTab/index.tsx | 1 + src/components/Header/index.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/src/components/FooterTab/index.tsx b/src/components/FooterTab/index.tsx index 7eb3c09b..f2b7fc55 100644 --- a/src/components/FooterTab/index.tsx +++ b/src/components/FooterTab/index.tsx @@ -56,6 +56,7 @@ const Footer = styled.div` align-items: center; z-index: 2; background-color: ${THEME.TEXT.WHITE}; + box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px; `; const IconContainer = styled.div` diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index f1a16c44..278a5885 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -37,6 +37,7 @@ const HeaderContainer = styled.div` height: 8vh; background-color: ${THEME.TEXT.WHITE}; z-index: 2; + box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px; `; const HeaderWrapper = styled.div` From 91aadebde6aca4aaaa6feba38944f8e1ff1f25b5 Mon Sep 17 00:00:00 2001 From: Lee sang Yeop Date: Tue, 15 Aug 2023 01:39:16 +0900 Subject: [PATCH 5/6] =?UTF-8?q?Design:=20=EA=B8=B0=EB=B3=B8=20=EB=B0=B0?= =?UTF-8?q?=EA=B2=BD=EC=83=89=EC=9D=84=20=EC=99=84=EC=A0=84=20=ED=9D=B0?= =?UTF-8?q?=EC=83=89=EC=9D=B4=20=EC=95=84=EB=8B=8C=20=EB=88=84=EB=9F=B0=20?= =?UTF-8?q?=ED=9D=B0=EC=83=89=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/styles/Global/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/styles/Global/index.tsx b/src/styles/Global/index.tsx index a73b4f1b..ce77205a 100644 --- a/src/styles/Global/index.tsx +++ b/src/styles/Global/index.tsx @@ -108,6 +108,7 @@ const resetCss = css` max-width: 480px; margin: 0 auto; min-height: 100vh; + background-color: #fffef9; } ol, ul { From bfffad11326fd8dacc4918e05aa72bcdaaf92b8d Mon Sep 17 00:00:00 2001 From: Lee sang Yeop Date: Wed, 16 Aug 2023 20:30:39 +0900 Subject: [PATCH 6/6] =?UTF-8?q?Fix:=20=EC=9E=98=EB=AA=BB=EB=90=9C=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Home/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/Home/index.tsx b/src/pages/Home/index.tsx index c4cadfe4..6d4ba6d3 100644 --- a/src/pages/Home/index.tsx +++ b/src/pages/Home/index.tsx @@ -38,7 +38,7 @@ const Home = () => { icon="school" title="졸업요건" majorRequired={true} - onClick={() => routerToGraduationRequired()} + onClick={() => routerToGraduationRequiredPage(graduationLink)} /> ); @@ -53,3 +53,8 @@ const Container = styled.div` text-aligb: center; margin: 0 auto; `; + +interface GraduationLink { + department: string; + link: string | null; +}