From aaa70dea4625e55bbadd1f5634b9ec9b6387acf4 Mon Sep 17 00:00:00 2001 From: LimSumi Date: Wed, 18 Oct 2023 19:25:25 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20age=20=EB=B3=80=EA=B2=BD=EB=B6=80?= =?UTF-8?q?=EB=B6=84=20=EC=88=98=EC=A0=95=ED=95=98=EA=B8=B0=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EC=B6=94=EA=B0=80,=20=ED=95=84=EC=88=98?= =?UTF-8?q?=20=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 필수 표시 바꿀 때 switch 케이스명도 바꿔주기 --- src/commons/SelectBox.tsx | 13 ++++---- src/pages/register/VMRegisterForm.tsx | 26 +++++----------- src/pages/register/VRadioGroup.tsx | 6 ++-- src/pages/update/VUpdateRegisterForm.tsx | 38 ++++++++++++------------ 4 files changed, 37 insertions(+), 46 deletions(-) diff --git a/src/commons/SelectBox.tsx b/src/commons/SelectBox.tsx index d3c95a91..5253d16a 100644 --- a/src/commons/SelectBox.tsx +++ b/src/commons/SelectBox.tsx @@ -13,7 +13,7 @@ interface SelectProps { } const yearOptions: SelectProps[] = []; -for (let idx = 0; idx < 33; idx += 1) { +for (let idx = 0; idx < 32; idx += 1) { yearOptions.push({ label: `${idx}`, value: `${idx}` }); } @@ -31,6 +31,7 @@ const SelectBox = ({ id, label }: IdProps) => { const [selectedType, setSelectedType] = useRecoilState(registerState); const year = selectedType.age.substring(0, selectedType.age.indexOf('년')); + console.log('년', year); const month = selectedType.age.substring( selectedType.age.indexOf('년') + 1, selectedType.age.indexOf('개'), @@ -40,21 +41,21 @@ const SelectBox = ({ id, label }: IdProps) => { console.log(value); console.log('달', month); - if (label === '종') { + if (label === '종🔸') { setSelectedType((prevType) => ({ ...prevType, type: value, })); - } else if (label === '나이') { + } else if (label === 'ㅤ') { setSelectedType((prevType) => ({ ...prevType, - age: `${value}년${month}개월`, + age: `${year}년${value}개월`, })); console.log(value); } else { setSelectedType((prevType) => ({ ...prevType, - age: `${year}년${value}개월`, + age: `${value}년${month}개월`, })); console.log(value); } @@ -79,7 +80,7 @@ const SelectBox = ({ id, label }: IdProps) => {

{label}

{
{ @@ -96,7 +86,7 @@ const VMRegisterForm = ({ handleChange }: RegisterProps) => {
{ diff --git a/src/pages/register/VRadioGroup.tsx b/src/pages/register/VRadioGroup.tsx index a3102fb8..da83a819 100644 --- a/src/pages/register/VRadioGroup.tsx +++ b/src/pages/register/VRadioGroup.tsx @@ -25,7 +25,7 @@ const VRadioGroup = ({ return (
-

성별

+

성별🔸

- 입양 상태 + 입양 상태🔸

- 중성화 상태 + 중성화 상태🔸

{ handleChange(e); }} defaultValue={petInfo.name} />
-
- { - handleChange(e); - }} - defaultValue={petInfo.age} - /> - +
+ +
+ +
개월
+
@@ -56,7 +50,7 @@ const VMRegisterForm = ( id="size" name="크기" type="text" - placeholder={petInfo.size} + placeholder="주변 사물과 비교해서 작성해주셔도 좋아요!" onChange={(e) => { handleChange(e); }} @@ -65,15 +59,21 @@ const VMRegisterForm = (
-
- + + { handleChange(e); }} + autoComplete="off" + min={1} defaultValue={petInfo.weight} />
@@ -82,7 +82,7 @@ const VMRegisterForm = ( id="vaccinationStatus" name="접종여부" type="text" - placeholder={petInfo.vaccinationStatus} + placeholder="접종명과 차수를 입력해주세요" onChange={(e) => { handleChange(e); }} @@ -96,7 +96,7 @@ const VMRegisterForm = ( id="description" name="상세설명" type="text" - placeholder={petInfo.description} + placeholder="상세 설명을 입력해주세요" onChange={(e) => { handleChange(e); }}