-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ : #492 - 발자취 페이지 상단 탭 FootPrintTab 컴포넌트 기능 및 디자인 구현
- Loading branch information
Showing
5 changed files
with
117 additions
and
6 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
64 changes: 62 additions & 2 deletions
64
src/app/footprints/_Components/FootPrintTab/FootPrintTab.tsx
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,11 +1,71 @@ | ||
import classNames from 'classnames'; | ||
import React from 'react'; | ||
import './index.scss'; | ||
|
||
interface FootPrintTabProps { | ||
isMyFootPrintsTab: boolean; | ||
setMyFootPrintsTab: () => void; | ||
setAllFootPrintsTab: () => void; | ||
} | ||
|
||
export default function FootPrintTab({}: FootPrintTabProps) { | ||
return <div></div>; | ||
const TAB_MENU = { | ||
MY: '내 발자취', | ||
ALL: '둘러보기', | ||
}; | ||
|
||
export default function FootPrintTab({ | ||
isMyFootPrintsTab, | ||
setMyFootPrintsTab, | ||
setAllFootPrintsTab, | ||
}: FootPrintTabProps) { | ||
// TODO: isMyFootPrintsTab이 true => 내 발자취, false => 둘러보기 표시 | ||
|
||
const handleClickMyFootPrintsTab = () => { | ||
if (!isMyFootPrintsTab) { | ||
setMyFootPrintsTab(); | ||
} | ||
}; | ||
|
||
const handleClickAllFootPrintsTab = () => { | ||
if (isMyFootPrintsTab) { | ||
setAllFootPrintsTab(); | ||
} | ||
}; | ||
|
||
return ( | ||
<div className={classNames('footprint-tab')}> | ||
<div | ||
className={classNames( | ||
'footprint-tab__menu', | ||
'font-size-base', | ||
isMyFootPrintsTab | ||
? 'footprint-tab--focused' | ||
: 'footprint-tab--normal', | ||
)} | ||
onClick={handleClickMyFootPrintsTab}> | ||
{TAB_MENU.MY} | ||
<div | ||
className={classNames('footprint-tab__underline', { | ||
'footprint-tab__underline--focused': isMyFootPrintsTab, | ||
})} | ||
/> | ||
</div> | ||
<div | ||
className={classNames( | ||
'footprint-tab__menu', | ||
'font-size-base', | ||
!isMyFootPrintsTab | ||
? 'footprint-tab--focused' | ||
: 'footprint-tab--normal', | ||
)} | ||
onClick={handleClickAllFootPrintsTab}> | ||
{TAB_MENU.ALL} | ||
<div | ||
className={classNames('footprint-tab__underline', { | ||
'footprint-tab__underline--focused': !isMyFootPrintsTab, | ||
})} | ||
/> | ||
</div> | ||
</div> | ||
); | ||
} |
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,34 @@ | ||
.footprint-tab { | ||
margin-top: 2rem; | ||
display: flex; | ||
gap: 0rem; | ||
&:hover { | ||
cursor: pointer; | ||
} | ||
|
||
&__menu { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: 0.5rem; | ||
width: 6rem; | ||
} | ||
|
||
&__underline { | ||
background-color: var(--origin-secondary); | ||
height: 0.125rem; | ||
width: 100%; | ||
|
||
&--focused { | ||
background-color: var(--origin-primary); | ||
} | ||
} | ||
|
||
&--normal { | ||
color: var(--origin-secondary); | ||
} | ||
|
||
&--focused { | ||
color: var(--origin-primary); | ||
} | ||
} |
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,7 @@ | ||
.footprint-page { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1.5rem; | ||
width: 100%; | ||
height: 100%; | ||
} |
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