Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] Mobile Nav Menu 추가 #284

Merged
merged 33 commits into from
Sep 23, 2023
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
849d58c
feat: Journey section add
sumi-0011 Sep 17, 2023
0e11548
feat: 여정 합류 PC
sumi-0011 Sep 17, 2023
afaef4a
feat: layout media query add
sumi-0011 Sep 19, 2023
b8cc29f
Merge branch 'feat/journey' into feat/journey-media
sumi-0011 Sep 19, 2023
5da8b92
feat: journey mobile
sumi-0011 Sep 19, 2023
2965fb1
feat: 모집안내 바로가기 생성
sumi-0011 Sep 19, 2023
c3fb6da
refactor: css 분리
sumi-0011 Sep 20, 2023
f477c33
Merge branch 'develop' into feat/recruit-entrance
sumi-0011 Sep 20, 2023
3b7cac8
fix: build error fix
sumi-0011 Sep 20, 2023
6de0437
feat: schedule 상수로 분리, main 에 추가
sumi-0011 Sep 20, 2023
25dda3f
style: 14기 일정 추가
sumi-0011 Sep 20, 2023
71d067b
style: SectionTitle 반응형 추가
sumi-0011 Sep 20, 2023
90a304c
Merge branch 'develop' into feat/main-schedule
Sep 21, 2023
5d03de8
feat: faq main component 추가
Sep 21, 2023
bc314e0
feat: main sign image 추가
Sep 21, 2023
873f125
fix: optional desc 적용
Sep 21, 2023
b0ebb49
fix: 설명 있을때만 돔 생성
Sep 21, 2023
3edeef6
Merge branch 'fix/schedule-title-style' into feat/main-bottom
Sep 21, 2023
91ec204
refactor: main에만 종속되어있는 컴포넌트 구조 변경
Sep 21, 2023
f808af7
feat: 14기 지원 버튼 추가 (메인 마지막)
Sep 21, 2023
3d0d2f6
style: gnb pc design 수정
Sep 21, 2023
7d87478
feat: mobile menu icon 추가
Sep 21, 2023
d7717e9
refactor: pc footer theme 적용
Sep 21, 2023
8239df7
style: footer 모바일 반응형 추가
Sep 21, 2023
b9f7c94
feat: mobile menu icon 추가
sumi-0011 Sep 22, 2023
6746f50
feat: mobile nav 추가
sumi-0011 Sep 22, 2023
46bdf63
Merge branch 'develop' into feat/main-bottom
sumi-0011 Sep 22, 2023
1306b5d
[Style] GNB, Footer 반응형 작업 (#283)
sumi-0011 Sep 22, 2023
1bbf8a5
Merge branch 'develop' into feat/main-bottom
sumi-0011 Sep 22, 2023
953927d
Merge branch 'feat/main-bottom' into feat/mobile-gnb
sumi-0011 Sep 22, 2023
4bdde78
fix: merge error fix
sumi-0011 Sep 22, 2023
f48b27d
Merge branch 'develop' into feat/mobile-gnb
sumi-0011 Sep 23, 2023
94d66e4
fix: merge error fix
sumi-0011 Sep 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/images/sign/main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/components/FAQ/FAQ.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { FAQList } from '~/components/FAQ/FAQList';
import { SectionTitle } from '~/components/SectionTitle';
import { FAQ_GROUP, FAQGroupType, FAQS, FAQType } from '~/constant/faq';
import { commonLayoutCss } from '~/styles/layout';
import { mediaQuery } from '~/styles/media';

export function FAQ() {
const [activeTab, setActiveTab] = useState<FAQGroupType>('지원자격');
Expand Down Expand Up @@ -65,4 +66,8 @@ const tabCss = (theme: Theme, isActive: boolean) => css`
color: ${isActive ? theme.colors.yellow500 : theme.colors.white};
cursor: pointer;
padding: 16px 24px;

${mediaQuery('mobile')} {
font-size: 14px;
}
`;
22 changes: 22 additions & 0 deletions src/components/FAQ/FAQItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { css, Theme } from '@emotion/react';
import { motion, Variants } from 'framer-motion';

import { ArrowIcon } from '~/components/Icons';
import { mediaQuery } from '~/styles/media';
import { theme } from '~/styles/theme';

interface FAQItemProps {
Expand Down Expand Up @@ -68,12 +69,26 @@ const headerCss = (theme: Theme, isOpen: boolean) => css`
text-align: center;
${theme.typos.pretendard.subTitle2}
}

${mediaQuery('mobile')} {
padding: 8px;

> h3 {
font-weight: 500;
font-size: 14px;
}
}
`;

const arrowIconCss = (theme: Theme, isOpen: boolean) => css`
> path {
stroke: ${isOpen ? theme.colors.black800 : theme.colors.blue400};
}

${mediaQuery('mobile')} {
width: 24px;
height: 24px;
}
`;

const bodyCss = (theme: Theme) => css`
Expand All @@ -83,4 +98,11 @@ const bodyCss = (theme: Theme) => css`
color: ${theme.colors.white};
${theme.typos.pretendard.body1};
}
${mediaQuery('mobile')} {
> p {
padding: 20px 8px;

font-size: 14px;
}
}
`;
72 changes: 53 additions & 19 deletions src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import Link from 'next/link';
import { css } from '@emotion/react';
import { css, Theme } from '@emotion/react';

import { FIRST_ROW_FOOTER_INFOS, SECOND_ROW_FOOTER_INFOS } from '~/constant/footer';
import { colors } from '~/styles/colors';
import { mediaQuery } from '~/styles/media';

export function Footer() {
return (
Expand All @@ -11,17 +12,18 @@ export function Footer() {
<ul css={rowCss}>
{FIRST_ROW_FOOTER_INFOS.map(footer => (
<li key={footer.name}>
<Link css={linkCss} href={footer.href}>
<Link css={[linkCss, strongLinkCss]} href={footer.href}>
{footer.name}
</Link>
</li>
))}
</ul>
<ul css={[rowCss, rowGapCss]}>
<ul css={[secondRowCss]}>
{SECOND_ROW_FOOTER_INFOS.map(footer => (
<li key={footer.name}>
<Link css={linkCss} href={footer.href}>
{footer.name}
<span>{footer.name}</span>
<span>{footer.detail}</span>
</Link>
</li>
))}
Expand All @@ -46,32 +48,64 @@ const footerInfoWrapper = css`
height: 218px;
justify-content: center;
align-items: center;

${mediaQuery('mobile')} {
height: 167px;
width: 100%;
}
`;

const rowCss = css`
display: flex;
gap: 40px;

${mediaQuery('mobile')} {
width: 100%;
gap: 0;
justify-content: space-between;
}
`;

const rowGapCss = css`
const secondRowCss = css`
display: flex;
gap: 40px;
margin-top: 16px;

span + span {
margin-left: 12px;
}
${mediaQuery('mobile')} {
width: 100%;
gap: 0;
justify-content: space-between;
margin-top: 8px;

span + span {
margin-left: 16px;
}
}
`;

const linkCss = (theme: Theme) => css`
${theme.typos.pretendard.body1};
color: ${theme.colors.gray100};

${mediaQuery('mobile')} {
font-size: 11px;
}
`;

const linkCss = css`
font-size: 18px;
font-style: normal;
font-weight: 500;
line-height: 25.2px; /* 140% */
letter-spacing: -0.18px;
color: ${colors.gray100};
const strongLinkCss = (theme: Theme) => css`
${theme.typos.pretendard.subTitle2};
`;

const copyrightCss = css`
font-size: 18px;
font-style: normal;
font-weight: 500;
line-height: 25.2px; /* 140% */
letter-spacing: -0.18px;
color: ${colors.gray200};
const copyrightCss = (theme: Theme) => css`
${theme.typos.pretendard.body1};
color: ${theme.colors.gray200};
margin-top: 40px;

${mediaQuery('mobile')} {
font-size: 11px;
margin-top: 24px;
}
`;
82 changes: 60 additions & 22 deletions src/components/GNB/GNB.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import { useState } from 'react';
import Image from 'next/image';
import Link from 'next/link';
import { useRouter } from 'next/router';
import { css } from '@emotion/react';
import { css, Theme } from '@emotion/react';
import { AnimatePresence } from 'framer-motion';

import { Button } from '~/components/Button';
import { MobileMenu } from '~/components/GNB/MobileMenu';
import { MobileMenuIcon } from '~/components/GNB/MobileMenuIcon';
import { GNB_MENU_NAME, GNBMenu } from '~/constant/gnb';
import { colors } from '~/styles/colors';
import { mediaQuery } from '~/styles/media';

const LOGO_IMAGE = `/images/logo.png`;

function ApplyButton({ menu }: { menu: GNBMenu }) {
return (
<Button css={applyButtonCss}>
<Button>
<Link css={linkCss} href={menu.href}>
{menu.name}
</Link>
Expand All @@ -21,18 +25,20 @@ function ApplyButton({ menu }: { menu: GNBMenu }) {

export function GNB() {
const { pathname } = useRouter();
const [isMenuOpen, setIsMenuOpen] = useState(false);
const getActiveLinkcss = (menu: GNBMenu) => {
if (pathname.startsWith(menu.href)) {
return activeLinkCss;
}
return inActiveLinkCss;
};

return (
<>
<nav css={navCss}>
<div css={navWrapperCss}>
<Link href={'/'}>
{<Image src={LOGO_IMAGE} alt="로고 이미지" width={240} height={30} />}
{<Image src={LOGO_IMAGE} alt="로고 이미지" width={154} height={18.9} />}
</Link>
<ul css={menuContainerCss}>
{GNB_MENU_NAME.map(menu => (
Expand All @@ -49,60 +55,92 @@ export function GNB() {
</ul>
</div>
</nav>
<nav css={mobileNavCss}>
<div css={mobileMenuGNBCss}>
<Link href={'/'}>
{<Image src={LOGO_IMAGE} alt="로고 이미지" width={154} height={18.9} />}
</Link>
<MobileMenuIcon onClick={() => setIsMenuOpen(prev => !prev)} isChecked={isMenuOpen} />
</div>
<AnimatePresence mode="wait">{isMenuOpen && <MobileMenu />}</AnimatePresence>
</nav>
<div css={blankCss} />
</>
);
}

const navCss = css`
background-color: ${colors.black800};
const navCommonCss = (theme: Theme) => css`
background-color: ${theme.colors.black800};
position: fixed;
padding: 0 20px;
top: 0;
left: 0;
z-index: 9998;
width: 100vw;
`;

const navCss = (theme: Theme) => css`
${navCommonCss(theme)};
padding: 20px 32px;

${mediaQuery('mobile')} {
display: none;
}
`;

const blankCss = css`
width: 100vw;
height: 72px;
height: 82px;

${mediaQuery('mobile')} {
height: 72px;
}
`;

const navWrapperCss = css`
max-width: 1240px;
display: flex;
justify-content: space-between;
align-items: center;
height: 72px;
margin: 0 auto;
`;

const menuContainerCss = css`
display: flex;
gap: 60px;
gap: 32px;
`;

const mobileNavCss = css`
display: none;

${mediaQuery('mobile')} {
display: block;
}
`;

const menuCss = css`
margin: auto 0;
`;

const activeLinkCss = css`
color: ${colors.yellow500};
const activeLinkCss = (theme: Theme) => css`
color: ${theme.colors.yellow500};
`;

const inActiveLinkCss = css`
color: ${colors.white};
const inActiveLinkCss = (theme: Theme) => css`
color: ${theme.colors.white};
`;

const linkCss = css`
font-size: 1.25rem;
font-weight: 500;
line-height: 150%; /* 30px */
letter-spacing: -0.2px;
const linkCss = (theme: Theme) => css`
${theme.typos.pretendard.body1};
`;

const applyButtonCss = css`
background-color: ${colors.yellow500};
color: ${colors.black800};
const mobileMenuGNBCss = (theme: Theme) => css`
${navCommonCss(theme)};
padding: 20px 32px;
display: flex;
align-items: center;
justify-content: space-between;

& > a {
margin-top: 6px;
}
`;
62 changes: 62 additions & 0 deletions src/components/GNB/MobileMenu.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import Link from 'next/link';
import { css, Theme } from '@emotion/react';
import { m } from 'framer-motion';

import { GNB_MENU_NAME } from '~/constant/gnb';

export function MobileMenu({}) {
return (
<m.article
initial={{ height: 0, opacity: 0 }}
animate={{ height: '272px', opacity: 1 }}
exit={{ height: 0, opacity: 0 }}
css={mobileMenuCss}
>
<ul>
{GNB_MENU_NAME.map(menu => (
<li key={menu.name}>
{menu.type === 'button' ? (
<Link css={[linkCss, activeLinkCss]} href={menu.href}>
{menu.name}
</Link>
) : (
<Link css={[linkCss, inActiveLinkCss]} href={menu.href}>
{menu.name}
</Link>
)}
</li>
))}
</ul>
</m.article>
);
}

const mobileMenuCss = (theme: Theme) => css`
z-index: 9997;

width: 100vw;
height: fit-content;
position: fixed;
top: 0;
left: 0;
margin: auto;
background-color: ${theme.colors.black800};
padding-top: 72px;

overflow: hidden;
li {
padding: 12px 32px;
}
`;

const activeLinkCss = (theme: Theme) => css`
color: ${theme.colors.yellow500};
`;

const inActiveLinkCss = (theme: Theme) => css`
color: ${theme.colors.white};
`;

const linkCss = (theme: Theme) => css`
${theme.typos.pretendard.body1};
`;
Loading
Loading