diff --git a/src/components/checkBox/Box.tsx b/src/components/checkBox/Box.tsx index 7fec893..b859fcf 100644 --- a/src/components/checkBox/Box.tsx +++ b/src/components/checkBox/Box.tsx @@ -3,11 +3,12 @@ import styled, { css } from 'styled-components'; interface PropsType { disabled?: boolean; status: boolean; + size?: number; } -export const Box = ({ disabled, status }: PropsType) => { +export const Box = ({ size, disabled, status }: PropsType) => { return ( - <_Wrapper disabled={disabled} status={status}> + <_Wrapper size={size} disabled={disabled} status={status}> {status && ( ` justify-content: center; float: left; border-radius: 2px; - width: 24px; - height: 24px; + width: ${({ size }) => `${size}px`}; + height: ${({ size }) => `${size}px`}; ${({ status, disabled, theme }) => { const { gray2, primaryLighten1, gray3, gray5, primary } = theme.color; if (status && disabled) { diff --git a/src/components/checkBox/index.tsx b/src/components/checkBox/index.tsx index 9af1c8e..d6ca125 100644 --- a/src/components/checkBox/index.tsx +++ b/src/components/checkBox/index.tsx @@ -9,6 +9,7 @@ interface PropsType extends marginCssType { disabled?: boolean; label?: string; status: boolean; + size?: number; onChange: (status: boolean) => void; } @@ -19,6 +20,7 @@ export const CheckBox = ({ label, status, onChange, + size = 24, margin, }: PropsType) => { return ( @@ -28,7 +30,7 @@ export const CheckBox = ({ onClick={() => !disabled && onChange(!status)} margin={margin} > - + {label && } ); @@ -39,6 +41,8 @@ interface WrapperProps extends marginCssType { } const _Wrapper = styled.div` + display: flex; + align-items: center; cursor: ${({ disabled }) => (disabled ? 'no-drop' : 'pointer')}; ${({ margin }) => marginToCss({ margin })}; `;