Skip to content

Commit

Permalink
[토너먼트] 토너먼트 인트로 화면 퍼블리싱 및 랜더링 (#67)
Browse files Browse the repository at this point in the history
* feat: 토너먼트 공통 버튼 도입

* docs: 토너먼트 컨테이너 폴더변경

* style: 토너먼트 패딩 값 변경

* feat: 공통 컴포넌트 시작하기 버튼 구현

* feat: 시작하기 버튼 후 라운드 시작 로직 구현!

* chore: 네이밍 오타 수정

* style: 스타일 코드 분리

* style: arrow 함수로 변경

* fix: 아이콘 오류 수정
  • Loading branch information
imeureka authored Jan 11, 2024
1 parent 49f0f88 commit 1e97d05
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 35 deletions.
12 changes: 0 additions & 12 deletions src/components/TournamentFlowContainer.tsx

This file was deleted.

12 changes: 12 additions & 0 deletions src/components/tournament/TournamentFlowContainer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import TournamentCard from './tournamentFlow/tournamentCard/TournamentCard';
import TournamentFooter from './tournamentFlow/tournamentFooter/TournamentFooter';
const TournamentFlowContainer = () => {
return (
<>
<TournamentCard />
<TournamentFooter />
</>
);
};

export default TournamentFlowContainer;
38 changes: 24 additions & 14 deletions src/components/tournament/intro/TournamentContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
import TournamentStartText from './tournamentStartText/TournamentStartText';
import TournamentItemCount from './tournamentItemCount/TournamentItemCount';
import styled from 'styled-components';
import * as S from './TournamentContatiner.style';
import { Svg3Dicons } from '../../../assets/svg';
import TournamentStartButton from './tournamentStartButton/TournamentStartButton';
import { useState } from 'react';
import TournamentFlowContainer from '../TournamentFlowContainer';

export default function TournamentConatainer() {
const TournamentContainer = () => {
const [showTournamentContainer, setShowTournamentContainer] = useState(true);

const handleStartClick = () => {
setShowTournamentContainer(false);
};
return (
<>
<TournamentStartText />
<TournamentItemCount />
<TournamentImg>
<Svg3Dicons />
</TournamentImg>
{/* 공통버튼 btn_cta_fill 들어갈 예정*/}
{showTournamentContainer && (
<>
<TournamentStartText />
<TournamentItemCount />
<S.TournamentImg>
<Svg3Dicons />
</S.TournamentImg>
<TournamentStartButton onClick={handleStartClick} />
</>
)}

{!showTournamentContainer && <TournamentFlowContainer />}
</>
);
}
};

const TournamentImg = styled.div`
width: 20rem;
height: 20rem;
margin: 0 auto;
`;
export default TournamentContainer;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import styled from "styled-components";

export const TournamentImg = styled.div`
width: 20rem;
height: 20rem;
margin: 0 auto;
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import styled from 'styled-components';

export const TournamentStartButtonWrapper = styled.div`
position: absolute;
margin-bottom: 2rem;
bottom: 0;
`;
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
export default function TournamentStartButton() {
import React from 'react';
import BtnFill from '../../../common/Button/Cta/fill/BtnFill';
import * as S from './TournamentStartButton.style';

interface TournamentStartButtonProps {
onClick: () => void;
}

const TournamentStartButton: React.FC<TournamentStartButtonProps> = ({ onClick }) => {
return (
<div>
<button>시작하기</button>
</div>
<S.TournamentStartButtonWrapper>
<BtnFill customStyle={{ backgroundColor: '#FF2176', border: 'none' }} onClick={onClick}>
시작하기
</BtnFill>
</S.TournamentStartButtonWrapper>
);
}
};

export default TournamentStartButton;
2 changes: 1 addition & 1 deletion src/pages/TournamentOngoing.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import TournamentFlowContainer from '../components/TournamentFlowContainer';
import TournamentFlowContainer from '../components/tournament/TournamentFlowContainer';

const TournamentOngoing = () => {
return (
Expand Down
6 changes: 3 additions & 3 deletions src/pages/TournamentPage.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import styled from 'styled-components';
import TournamentConatainer from '../components/tournament/intro/TournamentContainer';
import TournamentContainer from '../components/tournament/intro/TournamentContainer';

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

export default TournamentPage;

const TournamentPageWrapper = styled.section`
margin: 0 2rem;
padding: 1.2rem 2rem 0 2rem;
`;

0 comments on commit 1e97d05

Please sign in to comment.