-
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.
* feat: catogoryInfoType 추가 #79 * refactoring: interface 이름 변경 #79 * feat: 팀페이지의 tab button mocks data 추가 #79 * feat: tab button props type 생성 #79 * feat: TabButton 골격만 작성 #79 * feat: team page 에 tabButton 추가하기 #79 * feat: Tab Button UI 구현 #79 * feat: TabButton 클릭 이벤트 구현 #79 * design: button hover 시 background 색상 변경 #79 * design: 코드리뷰 반영 (120px -> 28(112px) 로 변경 #79
- Loading branch information
Showing
5 changed files
with
59 additions
and
2 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
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,29 @@ | ||
import { Flex, Button, Text } from '@chakra-ui/react'; | ||
|
||
import { TabButtonProps } from './type'; | ||
|
||
const TabButton = ({ currentTab, changeTab, categoryInfos }: TabButtonProps) => { | ||
return ( | ||
<Flex gap="30px"> | ||
{categoryInfos.map((data) => { | ||
return ( | ||
<Button | ||
key={data.id} | ||
w="28" | ||
bg={data.name === currentTab ? 'orange_dark' : 'white'} | ||
borderRadius="30px" | ||
shadow="md" | ||
_hover={{ bg: 'orange_light' }} | ||
onClick={() => changeTab(data.name)} | ||
> | ||
<Text color={data.name === currentTab ? 'white' : 'black'} fontSize="md" fontWeight="bold"> | ||
{data.name} | ||
</Text> | ||
</Button> | ||
); | ||
})} | ||
</Flex> | ||
); | ||
}; | ||
|
||
export default TabButton; |
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 @@ | ||
import { TabButtonInfoType } from '@/types'; | ||
|
||
export interface TabButtonProps { | ||
currentTab: string; | ||
changeTab: (tab: string) => void; | ||
categoryInfos: TabButtonInfoType[]; | ||
} |
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 { TabButtonInfoType } from '@/types'; | ||
|
||
const teamPageCategoryInfos: TabButtonInfoType[] = [ | ||
{ id: 1, name: '스터디' }, | ||
{ id: 2, name: '학습자료' }, | ||
{ id: 3, name: '작물창고' }, | ||
]; | ||
|
||
export default teamPageCategoryInfos; |
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