|
| 1 | +import { Button } from '@components/shared/Button'; |
| 2 | +import { Header } from '@components/shared/Header'; |
| 3 | +import { MatchItem } from '@components/shared/MatchItem'; |
| 4 | +import { Text } from '@components/shared/Text'; |
| 5 | + |
| 6 | +import { theme } from '@styles/theme'; |
| 7 | + |
| 8 | +import { MainPageContainer, MainPageSubContainer } from './MainPage.style'; |
| 9 | + |
| 10 | +export const MainPage = () => { |
| 11 | + return ( |
| 12 | + <MainPageContainer> |
| 13 | + <Header isLogo={true} /> |
| 14 | + <MainPageSubContainer> |
| 15 | + <Text children={'내 근처의 경기'} weight={700} size={'1.25rem'} /> |
| 16 | + {serverMatchItemList.map( |
| 17 | + ({ |
| 18 | + matchId, |
| 19 | + startTime, |
| 20 | + timeMinutes, |
| 21 | + mainAddress, |
| 22 | + memberCount, |
| 23 | + maxMemberCount, |
| 24 | + membersProfileImageUrls, |
| 25 | + }) => ( |
| 26 | + <MatchItem |
| 27 | + key={matchId} |
| 28 | + matchId={matchId} |
| 29 | + startTime={startTime} |
| 30 | + timeMinutes={timeMinutes} |
| 31 | + mainAddress={mainAddress} |
| 32 | + memberCount={memberCount} |
| 33 | + maxMemberCount={maxMemberCount} |
| 34 | + membersProfileImageUrls={membersProfileImageUrls} |
| 35 | + /> |
| 36 | + ) |
| 37 | + )} |
| 38 | + <Button {...MAIN_PAGE_BUTTON_PROP}></Button> |
| 39 | + </MainPageSubContainer> |
| 40 | + <MainPageSubContainer> |
| 41 | + <Text children={'추천 크루'} weight={700} size={'1.25rem'} /> |
| 42 | + {serverMatchItemList.map( |
| 43 | + ({ |
| 44 | + matchId, |
| 45 | + startTime, |
| 46 | + timeMinutes, |
| 47 | + mainAddress, |
| 48 | + memberCount, |
| 49 | + maxMemberCount, |
| 50 | + membersProfileImageUrls, |
| 51 | + }) => ( |
| 52 | + <MatchItem |
| 53 | + key={matchId} |
| 54 | + matchId={matchId} |
| 55 | + startTime={startTime} |
| 56 | + timeMinutes={timeMinutes} |
| 57 | + mainAddress={mainAddress} |
| 58 | + memberCount={memberCount} |
| 59 | + maxMemberCount={maxMemberCount} |
| 60 | + membersProfileImageUrls={membersProfileImageUrls} |
| 61 | + /> |
| 62 | + ) |
| 63 | + )} |
| 64 | + <Button {...MAIN_PAGE_BUTTON_PROP}></Button> |
| 65 | + </MainPageSubContainer> |
| 66 | + </MainPageContainer> |
| 67 | + ); |
| 68 | +}; |
| 69 | + |
| 70 | +const serverMatchItemList = [ |
| 71 | + { |
| 72 | + matchId: '1', |
| 73 | + startTime: new Date(), |
| 74 | + timeMinutes: 60, |
| 75 | + mainAddress: '', |
| 76 | + memberCount: 2, |
| 77 | + maxMemberCount: 8, |
| 78 | + membersProfileImageUrls: [ |
| 79 | + 'https://picsum.photos/500', |
| 80 | + 'https://picsum.photos/500', |
| 81 | + ], |
| 82 | + }, |
| 83 | + { |
| 84 | + matchId: '2', |
| 85 | + startTime: new Date(), |
| 86 | + timeMinutes: 60, |
| 87 | + mainAddress: '', |
| 88 | + memberCount: 2, |
| 89 | + maxMemberCount: 8, |
| 90 | + membersProfileImageUrls: [ |
| 91 | + 'https://picsum.photos/500', |
| 92 | + 'https://picsum.photos/500', |
| 93 | + ], |
| 94 | + }, |
| 95 | + { |
| 96 | + matchId: '3', |
| 97 | + startTime: new Date(), |
| 98 | + timeMinutes: 60, |
| 99 | + mainAddress: '', |
| 100 | + memberCount: 2, |
| 101 | + maxMemberCount: 8, |
| 102 | + membersProfileImageUrls: [ |
| 103 | + 'https://picsum.photos/500', |
| 104 | + 'https://picsum.photos/500', |
| 105 | + ], |
| 106 | + }, |
| 107 | +]; |
| 108 | + |
| 109 | +const MAIN_PAGE_BUTTON_PROP = { |
| 110 | + width: '100%', |
| 111 | + height: '3.5rem', |
| 112 | + text: '더보기', |
| 113 | + fontSize: `${theme.FONT_SIZE.LG}`, |
| 114 | + fontWeight: theme.FONT_WEIGHT.BOLD, |
| 115 | + lineHeight: 0, |
| 116 | + textColor: `${theme.PALETTE.RED_400}`, |
| 117 | + borderColor: `${theme.PALETTE.RED_400}`, |
| 118 | + backgroundColor: 'white', |
| 119 | + handleClick: () => console.log('hi'), |
| 120 | +}; |
0 commit comments