Skip to content

Commit

Permalink
feat: (#15) 네모버튼 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
chsua committed Jul 11, 2023
1 parent 58a0527 commit 224f5d8
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
14 changes: 14 additions & 0 deletions frontend/src/components/common/SquareButton/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import * as S from './style';

interface SquareButtonProps {
theme: 'blank' | 'fill';
children: string;
}

/* 마감시간, 확인, 취소 등 사용될 버튼
* 부모에서 크기를 조절, 내용(children) 전달
* props로 테마를 받음
*/
export default function SquareButton({ theme, children }: SquareButtonProps) {
return <S.Button theme={theme}>{children}</S.Button>;
}
19 changes: 19 additions & 0 deletions frontend/src/components/common/SquareButton/style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { styled } from 'styled-components';

interface ButtonProps {
theme: 'blank' | 'fill';
}

export const Button = styled.button<ButtonProps>`
display: block;
width: 100%;
height: 100%;
outline: 2px solid #ff7877;
border-radius: 5px;
background-color: ${props => (props.theme === 'blank' ? 'rgba(0,0,0,0)' : '#ff7877')};
color: ${props => (props.theme === 'blank' ? '#ff7877' : '#ffffff')};
font-size: 16px;
`;

0 comments on commit 224f5d8

Please sign in to comment.