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; `; 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/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` 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..6d4ba6d3 100644 --- a/src/pages/Home/index.tsx +++ b/src/pages/Home/index.tsx @@ -1,51 +1,60 @@ 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 { 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]); return ( - <> -
- routerTo('/announcement')} - /> - routerToGraduationRequired()} - /> -
- + + routerTo('/announcement')} + /> + routerToGraduationRequiredPage(graduationLink)} + /> + ); }; export default Home; + +const Container = styled.div` + display: flex; + flex-direction: column; + width: 85%; + text-aligb: center; + margin: 0 auto; +`; + +interface GraduationLink { + department: string; + link: string | null; +} 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 {