-
Notifications
You must be signed in to change notification settings - Fork 6
Feat: 헤더 구현 및 버튼 수정 #19
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
This file contains hidden or 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 hidden or 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,37 @@ | ||
| import Image from "next/image"; | ||
| import Profile from "@/public/icons/profile.png" | ||
| import Star from "@/public/icons/star.png" | ||
| import Link from "next/link"; | ||
| import Button from "./Button"; | ||
| import { useRouter } from "next/router"; | ||
|
|
||
| const HeaderMenu = () => { | ||
| const isLoggedIn = false; | ||
| const router = useRouter() | ||
|
|
||
| const handleClick = () => { | ||
| router.push('/login') | ||
| } | ||
|
|
||
| return ( | ||
| <> | ||
| {!isLoggedIn ? ( | ||
| <Button onClick={handleClick} width="w-[80px] md:w-[128px]" height="h-[37px] md:h-[53px]" size="text-[14px] md:text-[18px]" type="button">로그인</Button> | ||
| ) : ( | ||
| <div className="flex items-center gap-[24px]"> | ||
| <Link href={'/favorite'} className="flex items-center gap-[6px] bg-gray200 border border-purple100 rounded-[4px] py-[10px] px-[12px] text-[12px] leading-[14.32px] md:text-[14px] md:leading-[16.71px] font-normal"> | ||
| <Image src={Star} width={14} height={17} alt="" className="align-top"/>즐겨찾기 | ||
| </Link> | ||
| <div className="flex items-center gap-[6px] text-[14px] leading-[16.71px] font-normal"> | ||
| <Image src={Profile} width={28} height={28} alt="프로필" /> | ||
| {/* 임시 유저 네임 */} | ||
| <span className="hidden md:block">전상민</span> | ||
| </div> | ||
| </div> | ||
| )} | ||
| </> | ||
| ); | ||
| } | ||
|
|
||
| export default HeaderMenu; | ||
|
|
||
This file contains hidden or 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 Logo from "@/public/icons/logo.svg"; | ||
| import Image from "next/image"; | ||
| import Link from "next/link"; | ||
| import HeaderMenu from "../HeaderMenu"; | ||
|
|
||
| const Header = () => { | ||
|
|
||
| return ( | ||
| <div> | ||
| <div className="bg-gray100 py-[13px] px-[32px] md:py-[33px] md:px-[200px]"> | ||
| <div className="flex justify-between items-center max-w-[1520px]"> | ||
| <Link href={"/"} className="w-[88.67px] h-[16px] md:w-[133px] md:h-[24px]"> | ||
| <Image src={Logo} width={133} height={24} alt="로고" /> | ||
| </Link> | ||
| <HeaderMenu /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default Header; |
This file contains hidden or 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,6 +1,12 @@ | ||
| import Header from "@/components/Layout/Header"; | ||
| import "@/styles/globals.css"; | ||
| import type { AppProps } from "next/app"; | ||
|
|
||
| export default function App({ Component, pageProps }: AppProps) { | ||
| return <Component {...pageProps} />; | ||
| return ( | ||
| <> | ||
| <Header /> | ||
| <Component {...pageProps} /> | ||
| </> | ||
| ); | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
바로 onClick에서 콜백함수로 구현하면 깔끔합니다!