-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create PULL_REQUEST_TEMPLATE.md * Update PULL_REQUEST_TEMPLATE.md * Update PULL_REQUEST_TEMPLATE.md * [Feat] 개발 환경 세팅 (#2) * feat: 필요없는 파일 정리 * chore: 패키지 설치 * style: set Global Style * feat: set absolute path * feat: set react router * chore: 웹폰트 파일 추가(Pretendard, 현대하모니) * style: 웹 폰트 font-family 설정 * style: theme, colors 설정 * feat: Layout 컴포넌트, 하단바 조건부 렌더링 설정 * Create aws.yml * [Feat] 하단바 UI 작업, 페이지 라우터 연결 (#10) * feat: 필요없는 파일 정리 * chore: 패키지 설치 * style: set Global Style * feat: set absolute path * feat: set react router * chore: 웹폰트 파일 추가(Pretendard, 현대하모니) * style: 웹 폰트 font-family 설정 * style: theme, colors 설정 * feat: Layout 컴포넌트, 하단바 조건부 렌더링 설정 * Create PULL_REQUEST_TEMPLATE.md * Update PULL_REQUEST_TEMPLATE.md * Update PULL_REQUEST_TEMPLATE.md * chore: 하단바용 아이콘 이미지 추가 * feat: 페이지 컴포넌트 생성, 라우터 연결 * feat: 하단바 UI 구현 * chore: Navbar 컴포넌트 위치 변경
- Loading branch information
Showing
18 changed files
with
173 additions
and
3 deletions.
There are no files selected for viewing
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import styled from "styled-components"; | ||
import home from "@assets/images/home.webp"; | ||
import home_bold from "@assets/images/home_bold.webp"; | ||
import note from "@assets/images/note.webp"; | ||
import note_bold from "@assets/images/note_bold.webp"; | ||
import report from "@assets/images/report.webp"; | ||
import report_bold from "@assets/images/report_bold.webp"; | ||
import badge from "@assets/images/badge.webp"; | ||
import badge_bold from "@assets/images/badge_bold.webp"; | ||
import etc from "@assets/images/etc.webp"; | ||
import etc_bold from "@assets/images/etc_bold.webp"; | ||
import { theme } from "@styles/theme"; | ||
import { useNavigate } from "react-router-dom"; | ||
|
||
interface NavButtonType { | ||
type: string; | ||
name: string; | ||
} | ||
|
||
export const NavButton = ({ type, name }: NavButtonType) => { | ||
let ButtonImg; | ||
|
||
const navigate = useNavigate(); | ||
const handleClickNavButton = () => { | ||
if (name === "홈") navigate("/"); | ||
else if (name === "기록") navigate("/note"); | ||
else if (name === "리포트") navigate("/report"); | ||
else if (name === "배지") navigate("/badge"); | ||
}; | ||
switch (type) { | ||
case "home": | ||
ButtonImg = <img src={home} alt="홈" />; | ||
break; | ||
case "homeB": | ||
ButtonImg = <img src={home_bold} alt="홈" />; | ||
break; | ||
case "note": | ||
ButtonImg = <img src={note} alt="주행기록" />; | ||
break; | ||
case "noteB": | ||
ButtonImg = <img src={note_bold} alt="주행기록" />; | ||
break; | ||
case "report": | ||
ButtonImg = <img src={report} alt="리포트" />; | ||
break; | ||
case "reportB": | ||
ButtonImg = <img src={report_bold} alt="리포트" />; | ||
break; | ||
case "badge": | ||
ButtonImg = <img src={badge} alt="배지" />; | ||
break; | ||
case "badgeB": | ||
ButtonImg = <img src={badge_bold} alt="배지" />; | ||
break; | ||
case "etc": | ||
ButtonImg = <img src={etc} alt="더보기" />; | ||
break; | ||
case "etcB": | ||
ButtonImg = <img src={etc_bold} alt="더보기" />; | ||
break; | ||
} | ||
return ( | ||
<NavButtonElement onClick={handleClickNavButton}> | ||
{ButtonImg} | ||
<ButtonName>{name}</ButtonName> | ||
</NavButtonElement> | ||
); | ||
}; | ||
|
||
const NavButtonElement = styled.button` | ||
border: none; | ||
background-color: transparent; | ||
img { | ||
width: 24px; | ||
height: 24px; | ||
} | ||
`; | ||
|
||
const ButtonName = styled.div` | ||
font-family: "HyndaiHarmony"; | ||
font-weight: 300; | ||
font-size: 13px; | ||
color: ${theme.colors.gray9}; | ||
margin-top: 4px; | ||
`; |
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,47 @@ | ||
import { theme } from "@styles/theme"; | ||
import styled from "styled-components"; | ||
import { useLocation } from "react-router-dom"; | ||
|
||
import { NavButton } from "./NavButton"; | ||
|
||
export const Navbar = () => { | ||
const { pathname } = useLocation(); | ||
|
||
return ( | ||
<NavbarContainer> | ||
{pathname === "/note" ? ( | ||
<NavButton type="noteB" name="기록" /> | ||
) : ( | ||
<NavButton type="note" name="기록" /> | ||
)} | ||
{pathname === "/report" ? ( | ||
<NavButton type="reportB" name="리포트" /> | ||
) : ( | ||
<NavButton type="report" name="리포트" /> | ||
)} | ||
{pathname === "/" ? ( | ||
<NavButton type="homeB" name="홈" /> | ||
) : ( | ||
<NavButton type="home" name="홈" /> | ||
)} | ||
{pathname === "/badge" ? ( | ||
<NavButton type="badgeB" name="배지" /> | ||
) : ( | ||
<NavButton type="badge" name="배지" /> | ||
)} | ||
<NavButton type="etc" name="더보기" /> | ||
</NavbarContainer> | ||
); | ||
}; | ||
|
||
const NavbarContainer = styled.div` | ||
position: absolute; | ||
bottom: 0; | ||
width: 100%; | ||
height: 72px; | ||
background-color: white; | ||
border-top: 1px solid ${theme.colors.gray4}; | ||
display: flex; | ||
justify-content: space-around; | ||
`; |
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,9 @@ | ||
import { Layout } from "@components/common/Layout"; | ||
|
||
export const BadgePage = () => { | ||
return ( | ||
<Layout navbar> | ||
<div>배지</div> | ||
</Layout> | ||
); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Layout } from "@components/common/Layout"; | ||
|
||
export const NotePage = () => { | ||
return ( | ||
<Layout navbar> | ||
<div>주행 기록</div> | ||
</Layout> | ||
); | ||
}; |
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,9 @@ | ||
import { Layout } from "@components/common/Layout"; | ||
|
||
export const ReportPage = () => { | ||
return ( | ||
<Layout navbar> | ||
<div>리포트</div> | ||
</Layout> | ||
); | ||
}; |