From 5a32d468775805cbbdbce58c75aa20d342c7b7c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A1=B0=EC=83=81=ED=98=84?= Date: Tue, 20 Dec 2022 14:09:55 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=EC=82=AC=ED=95=AD=20=EB=B0=98=EC=98=81=ED=95=9C=20develop=20in?= =?UTF-8?q?to=20main=20(#17)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: changeLog 추가 * chore: modify template * input 매개변수 및 마진 값 수정 (#12) * (#11) refactor: setState -> onChange로 변경 * (#11) fix: margin left 6px 추가 * (#14) feat: modal 매개변수로 children 추가 (#15) * fix: input label 옵셔널 * fix: modal children 옵셔널 * fix: search setState -> onChange * fix: index에서 name CheckBox로 export --- src/components/input/Label.tsx | 2 +- src/components/modal/index.tsx | 2 +- src/components/search/index.tsx | 12 ++++-------- src/index.ts | 2 +- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/components/input/Label.tsx b/src/components/input/Label.tsx index 295253a..7bef8e0 100644 --- a/src/components/input/Label.tsx +++ b/src/components/input/Label.tsx @@ -1,7 +1,7 @@ import { Text } from '../styleGuide/text/Text'; export interface labelPropsType { - label: string; + label?: string; } export const Label = ({ label }: labelPropsType) => { diff --git a/src/components/modal/index.tsx b/src/components/modal/index.tsx index 188c3ed..e12d50d 100644 --- a/src/components/modal/index.tsx +++ b/src/components/modal/index.tsx @@ -9,7 +9,7 @@ interface propsType extends headerPropsType, contentPropsType { inputList?: JSX.Element[]; buttonList: JSX.Element[]; close: () => void; - children: ReactNode; + children?: ReactNode; } export const Modal = ({ diff --git a/src/components/search/index.tsx b/src/components/search/index.tsx index a8a71ac..1ecca43 100644 --- a/src/components/search/index.tsx +++ b/src/components/search/index.tsx @@ -1,29 +1,25 @@ import styled, { css } from 'styled-components'; import { Search } from '../styleGuide/icon/Search'; -import { Dispatch, SetStateAction } from 'react'; +import { ChangeEvent } from 'react'; import { marginCssType, marginToCss } from '../../utils/distance'; interface PropsType extends marginCssType { className?: string; value: string; - setState: Dispatch>; + onChange: (e: ChangeEvent) => void; disabled?: boolean; } export const SearchBox = ({ className, value, - setState, + onChange, disabled, }: PropsType) => { return ( <_Wrapper className={className} disabled={disabled}> - <_Input - value={value} - onChange={(e) => setState(e.target.value)} - disabled={disabled} - /> + <_Input value={value} onChange={onChange} disabled={disabled} /> ); }; diff --git a/src/index.ts b/src/index.ts index 22aab68..2f523ec 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ export * from './components/button/Button'; -export * from './components/checkBox'; +export * as CheckBox from './components/checkBox'; export * from './components/dropdown'; export * from './components/input'; export * from './components/radio/Radio';