Skip to content

Commit

Permalink
feat: GamesNearPage 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
dlwl98 committed Oct 30, 2023
1 parent f253059 commit 108e786
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/pages/GamesNearPage/GamesNearPage.styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import styled from '@emotion/styled';

export const PageWrapper = styled.div`
margin: -50px -16px 0 -16px;
padding: 50px 16px 80px 16px;
background-color: ${({ theme }) => theme.PALETTE.GRAY_100};
display: flex;
flex-direction: column;
gap: 16px;
`;
47 changes: 47 additions & 0 deletions src/pages/GamesNearPage/GamesNearPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { Header } from '@components/shared/Header';
import { MatchItem } from '@components/shared/MatchItem';
import { Text } from '@components/shared/Text';

import { useHeaderTitle } from '@hooks/useHeaderTitle';

import { PageWrapper } from './GamesNearPage.styles';

export const GamesNearPage = () => {
const { entryRef, showHeaderTitle } = useHeaderTitle<HTMLDivElement>();

return (
<>
<Header title={showHeaderTitle ? '내 근처 게스트 매치' : ''} />
<PageWrapper>
<div ref={entryRef}>
{showHeaderTitle || (
<Text size={20} weight={700}>
내 근처 게스트 매치
</Text>
)}
</div>
{Array(20)
.fill(null)
.map((_, i) => (
<MatchItem
key={i}
matchId="1"
startTime={new Date()}
timeMinutes={60}
mainAddress="서울특별시 송파구 송파나루길 206"
memberCount={6}
maxMemberCount={10}
membersProfileImageUrls={[
'https://picsum.photos/500',
'https://picsum.photos/500',
'https://picsum.photos/500',
'https://picsum.photos/500',
'https://picsum.photos/500',
'https://picsum.photos/500',
]}
/>
))}
</PageWrapper>
</>
);
};
1 change: 1 addition & 0 deletions src/pages/GamesNearPage/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './GamesNearPage';
3 changes: 2 additions & 1 deletion src/routes/router.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createBrowserRouter } from 'react-router-dom';

import { GamesNearPage } from '@pages/GamesNearPage';
import { HomePage } from '@pages/HomePage';
import { Layout } from '@pages/Layout';

Expand All @@ -15,7 +16,7 @@ export const router = createBrowserRouter([
{ path: 'players/:id', element: <h1>players</h1> },
{
path: 'games/near',
element: <h2>near</h2>,
element: <GamesNearPage />,
},
{
path: 'games/host',
Expand Down

0 comments on commit 108e786

Please sign in to comment.