Skip to content

Commit

Permalink
[ feat ] : Button Ts 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
Chanwoo-Jeong committed Jun 1, 2023
1 parent b1a8b66 commit 2283aed
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions Week7-0527/CardsGameTS/src/components/Buttons.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
import styled, { css } from "styled-components";

/** 헀더에 λ“€μ–΄κ°€λŠ” 큰 λ²„νŠΌ **/

interface BigButtonProps {
children: React.ReactNode;
onClick: () => void;
}

const BigButton = ({ children, ...props }: BigButtonProps) => {
return <ResetBtnWrapper {...props}>{children}</ResetBtnWrapper>;
};

const ResetBtnWrapper = styled.button`
margin: 0 1rem;
padding: 1rem;
Expand All @@ -20,12 +31,22 @@ const ResetBtnWrapper = styled.button`
}
`;

/** 헀더에 λ“€μ–΄κ°€λŠ” 큰 λ²„νŠΌ **/
const BigButton = ({ children, ...props }) => {
return <ResetBtnWrapper {...props}>{children}</ResetBtnWrapper>;
/** λ‚œμ΄λ„ λ³€κ²½ λ²„νŠΌ **/
interface DifficultyBtnWrapperProps {
difficulty: string;
currentDifficulty: string;
}

interface DifficultyButtonProps extends DifficultyBtnWrapperProps {
children: React.ReactNode;
onClick: () => void;
}

const DifficultyButton = ({ children, ...props }: DifficultyButtonProps) => {
return <DifficultyBtnWrapper {...props}>{children}</DifficultyBtnWrapper>;
};

const DifficultyBtnWrapper = styled.button`
const DifficultyBtnWrapper = styled.button<DifficultyBtnWrapperProps>`
width: 10rem;
height: 5rem;
Expand All @@ -50,9 +71,4 @@ const DifficultyBtnWrapper = styled.button`
`};
`;

/** λ‚œμ΄λ„ λ³€κ²½ λ²„νŠΌ **/
const DifficultyButton = ({ children, ...props }) => {
return <DifficultyBtnWrapper {...props}>{children}</DifficultyBtnWrapper>;
};

export { BigButton, DifficultyButton };

0 comments on commit 2283aed

Please sign in to comment.