-
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: tabButton 밑에 전체보기 button 구현 #200 * feat: 학습자료와 스터디의 네비게이션 버튼 구현 * feat: 스터디의 grid view 구현 #200 * feat: 학습자료의 grid view 구현 * fix: 학습자료에 map key 없어서 생기는 에러 수정 #200 * chore: study mocks data 추가 #200 * fix: styledDataPicker의 eslint 에러 수정 #200 * feat: 스터디 및 학습자료 네비게이션 구현 #200 * refact: 코드 리뷰 반영 #200
- Loading branch information
Showing
17 changed files
with
347 additions
and
46 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export interface StudyAssetCardProps { | ||
id: number; | ||
title: string; | ||
content: string; | ||
date: string; | ||
|
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 { TabButtonInfoType } from '@/types'; | ||
|
||
export const CARD_PER_PAGE = 4; | ||
|
||
export const TEAM_CATEGORY_INFOS: TabButtonInfoType[] = [ | ||
{ id: 1, name: '스터디', wholeView: true, page: '/' }, | ||
{ id: 2, name: '학습자료', wholeView: true, page: '/' }, | ||
{ id: 3, name: '작물창고', wholeView: false }, | ||
]; |
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,27 @@ | ||
import { Grid } from '@chakra-ui/react'; | ||
|
||
import StudyAssetCard from '@/components/StudyAssetCard'; | ||
|
||
import { AssetGridViewProps } from './types'; | ||
|
||
const AssetGridView = ({ assetArray }: AssetGridViewProps) => { | ||
return ( | ||
<Grid gap="4" templateColumns={{ base: 'repeat(2, 1fr)', lg: 'repeat(4, 1fr)' }}> | ||
{assetArray.map((asset) => { | ||
return ( | ||
<StudyAssetCard | ||
key={`${asset.title}-${asset.id}`} | ||
id={asset.id} | ||
title={asset.title} | ||
content={asset.content} | ||
date={asset.date} | ||
bookmark={asset.bookmark} | ||
img={asset.img} | ||
/> | ||
); | ||
})} | ||
</Grid> | ||
); | ||
}; | ||
|
||
export default AssetGridView; |
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,5 @@ | ||
import { StudyAssetCardProps } from '@/components/StudyAssetCard/types'; | ||
|
||
export interface AssetGridViewProps { | ||
assetArray: StudyAssetCardProps[]; | ||
} |
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,38 @@ | ||
import { IconButton, Flex } from '@chakra-ui/react'; | ||
import { BiChevronRight, BiChevronLeft } from 'react-icons/bi'; | ||
import { BsPlus } from 'react-icons/bs'; | ||
|
||
import { NavigationButtonProps } from './types'; | ||
|
||
const NavigationButton = ({ handlePrevClick, handleNextClick, handlePlusClick }: NavigationButtonProps) => { | ||
return ( | ||
<Flex align="center" justify="flex-end" gap="4" w="100%"> | ||
<IconButton | ||
shadow="base" | ||
aria-label="" | ||
icon={<BiChevronLeft />} | ||
onClick={handlePrevClick} | ||
size="icon_sm" | ||
variant="icon_white" | ||
/> | ||
<IconButton | ||
shadow="base" | ||
aria-label="" | ||
icon={<BiChevronRight />} | ||
onClick={handleNextClick} | ||
size="icon_sm" | ||
variant="icon_white" | ||
/> | ||
<IconButton | ||
shadow="base" | ||
aria-label="" | ||
icon={<BsPlus />} | ||
onClick={handlePlusClick} | ||
size="icon_md" | ||
variant="icon_orange_dark" | ||
/> | ||
</Flex> | ||
); | ||
}; | ||
|
||
export default NavigationButton; |
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,5 @@ | ||
export interface NavigationButtonProps { | ||
handlePrevClick: () => void; | ||
handleNextClick: () => void; | ||
handlePlusClick: () => void; | ||
} |
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,32 @@ | ||
import { Grid } from '@chakra-ui/react'; | ||
|
||
import StudyCard from '@/components/StudyCard'; | ||
|
||
import { StudyGridViewProps } from './types'; | ||
|
||
const StudyGridView = ({ studyArray }: StudyGridViewProps) => { | ||
return ( | ||
<Grid gap="4" templateColumns={{ base: 'repeat(2, 1fr)', lg: 'repeat(4, 1fr)' }}> | ||
{studyArray.map((study) => { | ||
return ( | ||
<StudyCard | ||
key={study.id} | ||
id={study.id} | ||
name={study.name} | ||
description={study.description} | ||
startDate={study.startDate} | ||
endDate={study.endDate} | ||
status={study.status} | ||
isDeleted={study.isDeleted} | ||
cropId={study.cropId} | ||
teamId={study.teamId} | ||
percent={study.percent} | ||
rank={study.rank} | ||
/> | ||
); | ||
})} | ||
</Grid> | ||
); | ||
}; | ||
|
||
export default StudyGridView; |
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,5 @@ | ||
import { StudyCardProps } from '@/components/StudyCard/types'; | ||
|
||
export interface StudyGridViewProps { | ||
studyArray: StudyCardProps[]; | ||
} |
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.