From a602a5cabd8ec3dc9f667243da5e67027b94ca98 Mon Sep 17 00:00:00 2001 From: naro_Kim Date: Mon, 3 Jul 2023 12:56:41 +0900 Subject: [PATCH 1/2] =?UTF-8?q?chore:=20button=20disbled=20=EC=9D=B4?= =?UTF-8?q?=EC=8A=88=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/write/components/Counter/Counter.tsx | 4 ++-- src/app/write/components/Form/FirstStep.tsx | 1 + src/components/IconButton/IconButton.tsx | 6 +++++- src/components/SvgIcon/SvgIcon.tsx | 14 +++++++------- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/app/write/components/Counter/Counter.tsx b/src/app/write/components/Counter/Counter.tsx index ef3b9d38..4708d51b 100644 --- a/src/app/write/components/Counter/Counter.tsx +++ b/src/app/write/components/Counter/Counter.tsx @@ -23,9 +23,9 @@ const Counter = ({ control, name, min = 2, max = 20, ...rest }: CounterProps ( <> - + - + )} /> diff --git a/src/app/write/components/Form/FirstStep.tsx b/src/app/write/components/Form/FirstStep.tsx index 52d44ed7..e839af55 100644 --- a/src/app/write/components/Form/FirstStep.tsx +++ b/src/app/write/components/Form/FirstStep.tsx @@ -19,6 +19,7 @@ const FirstStep = ({ nextStep }: stepProps) => { const { stepOne, setData } = useFormStore(); const method = useForm({ + mode: 'onSubmit', resolver: zodResolver(stepOneSchema), defaultValues: stepOne || {}, }); diff --git a/src/components/IconButton/IconButton.tsx b/src/components/IconButton/IconButton.tsx index 21f42e35..8bc74022 100644 --- a/src/components/IconButton/IconButton.tsx +++ b/src/components/IconButton/IconButton.tsx @@ -42,9 +42,13 @@ const IconButton = ({ useEffect(() => { if (!error) return; - setStatus(error ? ICON_STATUS.ERROR : disabled ? ICON_STATUS.DISABLE : ICON_STATUS.DEFAULT); + setStatus(error ? ICON_STATUS.ERROR : ICON_STATUS.DEFAULT); }, [error, disabled]); + useEffect(() => { + setStatus(disabled ? ICON_STATUS.DISABLE : ICON_STATUS.DEFAULT); + }, [disabled]); + const handleMouseEnter = () => { if (error || disabled || status === ICON_STATUS.ACTIVE) return; hover && setStatus(ICON_STATUS.HOVER); diff --git a/src/components/SvgIcon/SvgIcon.tsx b/src/components/SvgIcon/SvgIcon.tsx index 1d04df61..39d519e1 100644 --- a/src/components/SvgIcon/SvgIcon.tsx +++ b/src/components/SvgIcon/SvgIcon.tsx @@ -1,16 +1,16 @@ import { SVGProps } from 'react'; interface Props extends SVGProps { - /** icon id (spriteIcons 폴더하에 있는 svg 파일명과 동일함) */ - id: string; + /** icon id (spriteIcons 폴더하에 있는 svg 파일명과 동일함) */ + id: string; } const SvgIcon = ({ id, width = 16, height = 16, fill = 'none', ...rest }: Props) => { - return ( - - - - ); + return ( + + + + ); }; export default SvgIcon; From d52ffe47d3f96e7380a7cb02e09729e88841cc16 Mon Sep 17 00:00:00 2001 From: naro_Kim Date: Mon, 3 Jul 2023 20:42:09 +0900 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20minus-hover=20sprite=20=EA=B5=90?= =?UTF-8?q?=EC=B2=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/sprite.svg | 8 ++++++++ public/spriteIcons/minus-hover.svg | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/public/sprite.svg b/public/sprite.svg index 8fc540e2..3af5a39e 100644 --- a/public/sprite.svg +++ b/public/sprite.svg @@ -38,6 +38,10 @@ + + + + @@ -166,10 +170,14 @@ + + + + diff --git a/public/spriteIcons/minus-hover.svg b/public/spriteIcons/minus-hover.svg index 40a1ec38..55dd6d72 100644 --- a/public/spriteIcons/minus-hover.svg +++ b/public/spriteIcons/minus-hover.svg @@ -1,6 +1,14 @@ + + + + + + + +