Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[토너먼트] 토너먼트 인트로 화면 퍼블리싱 #54

Merged
merged 15 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions public/svg/3dicons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions src/assets/svg/3Dicons.tsx

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/assets/svg/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { default as Svg3Dicons } from './3Dicons';
export { default as Favicon } from './Favicon';
export { default as IcAdd } from './IcAdd';
export { default as IcAlertCircle } from './IcAlertCircle';
Expand Down
Empty file removed src/components/.keep
Empty file.
23 changes: 23 additions & 0 deletions src/components/tournament/intro/TournamentContainer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import TournamentStartText from './tournamentStartText/TournamentStartText';
import TournamentItemCount from './tournamentItemCount/TournamentItemCount';
import styled from 'styled-components';
import { Svg3Dicons } from '../../../assets/svg';

export default function TournamentConatainer() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아주 사소하지만 Container 오타인 것 같아요~!

return (
<>
<TournamentStartText />
<TournamentItemCount />
<TournamentImg>
<Svg3Dicons />
</TournamentImg>
Comment on lines +9 to +13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

너무 깔끔하고 좋아요👍👍

{/* 공통버튼 btn_cta_fill 들어갈 예정*/}
</>
);
}

const TournamentImg = styled.div`
width: 20rem;
height: 20rem;
margin: 0 auto;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

덕분에 margin 0 auto 알아갑니다 :)

Comment on lines +1 to +22
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 파일에 대한 스타일 코드는 따로 하지 않은 이유가 있는지 궁금합니다 !! 추후 확장성을 위해 컨벤션을 맞추면 좋지 않을까 생각해서요! :)

`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import styled from 'styled-components';

export const TournamentItemCountWrapper = styled.article`
margin-bottom: 5.5rem;
`;

export const TotalItems = styled.p`
${({ theme }) => theme.fonts.body_09};
color: ${({ theme }) => theme.colors.G_09};
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import * as S from './TournamentItemCount.style';

export default function TournamentItemCount() {
const count = 16;
return (
<S.TournamentItemCountWrapper>
<S.TotalItems>총 등록된 선물 {count}개</S.TotalItems>
</S.TournamentItemCountWrapper>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function TournamentStartButton() {
return (
<div>
<button>시작하기</button>
</div>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import styled from 'styled-components';

export const TournamentStartTextWrapper = styled.article`
display: flex;
flex-direction: column;
gap: 0.4rem;
margin-bottom: 2rem;

text-align: left;
`;

export const Title = styled.p`
${({ theme }) => theme.fonts.Title};
`;

export const SubTitle = styled.p`
${({ theme }) => theme.fonts.body_07};
`;

export const UserName = styled.span`
color: ${({ theme }) => theme.colors.P_06};
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { useRecoilValue } from 'recoil';
import { userNameState } from '../../../../recoil/atoms';
import * as S from './TournamentStartText.style';

export default function TournamentStartText() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rface 써서 화살표 함수로 바꾸면 좋을 것 같아요~!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

화살표 함수 리팩토링 코드리뷰 반영해놓겠습니다 감사해요!

const userName = useRecoilValue(userNameState);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

리코일까지 작성한 거 넘 좋아요🙌

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저도 같은 방식으로 추후에 구현하겠습니다. 감사합니다 ㅎㅎ

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넘 좋아요 !!! 빠르게 로그인이 되어야 겠군요 : - )


return (
<S.TournamentStartTextWrapper>
<S.SubTitle>선물 등록이 마감되어</S.SubTitle>
<S.Title>
<S.UserName>{userName}</S.UserName>님을 위한 <br />
선물 토너먼트를 시작합니다
</S.Title>
</S.TournamentStartTextWrapper>
);
}
16 changes: 16 additions & 0 deletions src/pages/TournamentPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import styled from 'styled-components';
import TournamentConatainer from '../components/tournament/intro/TournamentContainer';

const TournamentPage = () => {
return (
<TournamentPageWrapper>
<TournamentConatainer />
</TournamentPageWrapper>
);
};

export default TournamentPage;

const TournamentPageWrapper = styled.section`
margin: 0 2rem;
`;
Comment on lines +1 to +16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 파일에서의 스타일 코드 분리도 컨벤션처럼 하면 어떤가 ! 합니다

특별한 이유가 있었다면 답글로 달아주세요 !! : )

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아! 제가 작업할 때 밑에 적고 분리를 추후에 해서 빼먹었던 것 같네요! 빠르게 코드리뷰 반영해놓을게요 감사해요!

12 changes: 5 additions & 7 deletions src/recoil/atoms.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//이런 식으로 작성
import { atom } from 'recoil';

//import { atom } from "recoil";

// export const SweetState = atom({
// key: "sweet",
// default: {},
// });
export const userNameState = atom({
key: '',
default: '시동훈',
});
5 changes: 5 additions & 0 deletions src/router/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Layout from '../layouts/Layout';
import GiftHomeDetailFriends from '../pages/GiftHomeDetail/GiftHomeDetailFriends';
import GiftHomeDetail2030 from '../pages/GiftHomeDetail/GiftHomeDetail2030';
import OnBoardingPage from '../pages/OnBoardingPage';
import TournamentPage from '../pages/TournamentPage';

const router = createBrowserRouter([
{
Expand Down Expand Up @@ -33,6 +34,10 @@ const router = createBrowserRouter([
path: '/onboarding',
element: <OnBoardingPage />,
},
{
path: '/tournament',
element: <TournamentPage />,
},
],
},
]);
Expand Down
Loading