-
Notifications
You must be signed in to change notification settings - Fork 9
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] 버튼 컴포넌트, GNB, Footer 추가 #253
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
34d41d5
refactor: 화살표 함수에서 function으로 수정
99-zziy 1de59b8
feat: global cursor style 삭제
99-zziy 8b84560
feat: gnb 추가
99-zziy b350054
feat: button 추가
99-zziy 73332ca
feat: gnb 스타일 추가
99-zziy 2f5ef45
feat: 해당하는 페이지의 버튼 링크 색 변경
99-zziy 7af0c41
feat: footer 추가
99-zziy 535a2a7
refactor: function, named export
99-zziy e2cb5f6
Merge branch 'develop' into feat/common-component
99-zziy 204605f
feat: footer style 수정
99-zziy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { ButtonHTMLAttributes, PropsWithChildren } from 'react'; | ||
import { css } from '@emotion/react'; | ||
|
||
export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & PropsWithChildren; | ||
|
||
export function Button({ children, ...props }: ButtonProps) { | ||
return ( | ||
<button {...props} css={buttonCss}> | ||
{children} | ||
</button> | ||
); | ||
} | ||
|
||
const buttonCss = css` | ||
padding: 12px 32px; | ||
font-size: 20px; | ||
height: 54px; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { Button } from './Button'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import Link from 'next/link'; | ||
import { css } from '@emotion/react'; | ||
|
||
import { FIRST_ROW_FOOTER_INFOS, SECOND_ROW_FOOTER_INFOS } from '~/constant/footer'; | ||
import { colors } from '~/styles/colors'; | ||
|
||
export function Footer() { | ||
return ( | ||
<footer css={footerCss}> | ||
<div css={footerInfoWrapper}> | ||
<ul css={rowCss}> | ||
{FIRST_ROW_FOOTER_INFOS.map(footer => ( | ||
<li key={footer.name}> | ||
<Link css={linkCss} href={footer.href}> | ||
{footer.name} | ||
</Link> | ||
</li> | ||
))} | ||
</ul> | ||
<ul css={[rowCss, rowGapCss]}> | ||
{SECOND_ROW_FOOTER_INFOS.map(footer => ( | ||
<li key={footer.name}> | ||
<Link css={linkCss} href={footer.href}> | ||
{footer.name} | ||
</Link> | ||
</li> | ||
))} | ||
</ul> | ||
<p css={copyrightCss}>© 2023 DEPROMEET. ALL RIGHTS RESERVED.</p> | ||
</div> | ||
</footer> | ||
); | ||
} | ||
|
||
const footerCss = css` | ||
background-color: ${colors.black800}; | ||
padding: 0 20px; | ||
width: 100vw; | ||
`; | ||
|
||
const footerInfoWrapper = css` | ||
max-width: 1240px; | ||
margin: 0 auto; | ||
display: flex; | ||
flex-direction: column; | ||
height: 218px; | ||
justify-content: center; | ||
align-items: center; | ||
`; | ||
|
||
const rowCss = css` | ||
display: flex; | ||
gap: 40px; | ||
`; | ||
|
||
const rowGapCss = css` | ||
margin-top: 16px; | ||
`; | ||
|
||
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 copyrightCss = css` | ||
font-size: 18px; | ||
font-style: normal; | ||
font-weight: 500; | ||
line-height: 25.2px; /* 140% */ | ||
letter-spacing: -0.18px; | ||
color: ${colors.gray200}; | ||
margin-top: 40px; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { Footer } from './Footer'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import Image from 'next/image'; | ||
import Link from 'next/link'; | ||
import { useRouter } from 'next/router'; | ||
import { css } from '@emotion/react'; | ||
|
||
import { Button } from '~/components/Button'; | ||
import { GNB_MENU_NAME, GNBMenu } from '~/constant/gnb'; | ||
import { colors } from '~/styles/colors'; | ||
|
||
const LOGO_IMAGE = `/images/logo.png`; | ||
|
||
function ApplyButton({ menu }: { menu: GNBMenu }) { | ||
return ( | ||
<Button css={applyButtonCss}> | ||
<Link css={linkCss} href={menu.href}> | ||
{menu.name} | ||
</Link> | ||
</Button> | ||
); | ||
} | ||
|
||
export function GNB() { | ||
const { pathname } = useRouter(); | ||
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} />} | ||
</Link> | ||
<ul css={menuContainerCss}> | ||
{GNB_MENU_NAME.map(menu => ( | ||
<li css={menuCss} key={menu.name}> | ||
{menu.type === 'button' ? ( | ||
<ApplyButton menu={menu} /> | ||
) : ( | ||
<Link css={[linkCss, getActiveLinkcss(menu)]} href={menu.href}> | ||
{menu.name} | ||
</Link> | ||
)} | ||
</li> | ||
))} | ||
</ul> | ||
</div> | ||
</nav> | ||
); | ||
} | ||
|
||
const navCss = css` | ||
background-color: ${colors.black800}; | ||
position: fixed; | ||
padding: 0 20px; | ||
top: 0; | ||
left: 0; | ||
z-index: 9998; | ||
width: 100vw; | ||
`; | ||
|
||
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; | ||
`; | ||
|
||
const menuCss = css` | ||
margin: auto 0; | ||
`; | ||
|
||
const activeLinkCss = css` | ||
color: ${colors.yellow500}; | ||
`; | ||
|
||
const inActiveLinkCss = css` | ||
color: ${colors.white}; | ||
`; | ||
|
||
const linkCss = css` | ||
font-size: 1.25rem; | ||
font-weight: 500; | ||
line-height: 150%; /* 30px */ | ||
letter-spacing: -0.2px; | ||
`; | ||
|
||
const applyButtonCss = css` | ||
background-color: ${colors.yellow500}; | ||
color: ${colors.black800}; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { GNB } from './GNB'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
export const DEPROMEET_EMAIL = 'depromeet@gmail.com'; | ||
export const DEPROMEET_EMAIL = 'mailto:depromeet@gmail.com'; | ||
export const DEPROMEET_MEDIUM = 'https://depromeet.medium.com/'; | ||
export const DEPROMEET_FACEBOOK = 'https://www.facebook.com/depromeet/'; | ||
export const DEPROMEET_INSTAGRAM = 'https://www.instagram.com/depromeet/'; | ||
export const DEPROMEET_GITHUB = 'https://github.com/depromeet/'; | ||
export const DEPROMEET_BEHANCE = 'https://www.behance.net/Depromeet'; | ||
|
||
export const KAKAO_PLUS_FRIEND = 'http://pf.kakao.com/_xoxmcxed'; | ||
export const DEPROMEET_KAKAO_PLUS_FRIEND = 'http://pf.kakao.com/_xoxmcxed'; | ||
export const DEPROMEET_LINKEDIN = 'https://www.linkedin.com/company/depromeet/'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { | ||
DEPROMEET_BEHANCE, | ||
DEPROMEET_EMAIL, | ||
DEPROMEET_GITHUB, | ||
DEPROMEET_INSTAGRAM, | ||
DEPROMEET_KAKAO_PLUS_FRIEND, | ||
DEPROMEET_LINKEDIN, | ||
DEPROMEET_MEDIUM, | ||
} from '~/constant/depromeet'; | ||
|
||
export const FIRST_ROW_FOOTER_INFOS = [ | ||
{ name: 'Instagram', href: DEPROMEET_INSTAGRAM }, | ||
{ name: 'Behance', href: DEPROMEET_BEHANCE }, | ||
{ name: 'Github', href: DEPROMEET_GITHUB }, | ||
{ name: 'Medium', href: DEPROMEET_MEDIUM }, | ||
{ name: 'LinkedIn', href: DEPROMEET_LINKEDIN }, | ||
]; | ||
|
||
export const SECOND_ROW_FOOTER_INFOS = [ | ||
{ name: 'Kakao channel @depromeet', href: DEPROMEET_KAKAO_PLUS_FRIEND }, | ||
{ name: 'E-mail depromeet@gmail', href: DEPROMEET_EMAIL }, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
export type GNBMenu = { | ||
name: 'About' | '모집안내' | '프로젝트' | '지원하기'; | ||
href: '/about' | '/recruit' | '/project' | '/'; | ||
type: 'text' | 'button'; | ||
}; | ||
// TODO: 지원하기 url 넣기 | ||
export const GNB_MENU_NAME: GNBMenu[] = [ | ||
{ | ||
name: 'About', | ||
href: '/about', | ||
type: 'text', | ||
}, | ||
{ | ||
name: '모집안내', | ||
href: '/recruit', | ||
type: 'text', | ||
}, | ||
{ | ||
name: '프로젝트', | ||
href: '/project', | ||
type: 'text', | ||
}, | ||
{ | ||
name: '지원하기', | ||
href: '/', | ||
type: 'button', | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
불편했는데 굳굳👍