From fc7bf09b09035f7b77c317e95953db0475cc4937 Mon Sep 17 00:00:00 2001 From: JAEMOONLEE Date: Fri, 15 Sep 2023 11:06:40 +0900 Subject: [PATCH] =?UTF-8?q?[feat]=20Step2=20=EC=88=98=EC=A0=95,=20Stepper?= =?UTF-8?q?=20Component=20=EC=B6=94=EA=B0=80!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Stepper2/Stepper2.module.scss | 12 + components/Stepper2/Stepper2.tsx | 30 +++ components/index.tsx | 1 + pages/room/addRoom/step2.tsx | 279 +++++++++++------------ 4 files changed, 173 insertions(+), 149 deletions(-) create mode 100644 components/Stepper2/Stepper2.module.scss create mode 100644 components/Stepper2/Stepper2.tsx diff --git a/components/Stepper2/Stepper2.module.scss b/components/Stepper2/Stepper2.module.scss new file mode 100644 index 0000000..ac8a368 --- /dev/null +++ b/components/Stepper2/Stepper2.module.scss @@ -0,0 +1,12 @@ +.stepper_container { + @apply flex items-center justify-center space-x-4; + } + + .rounded { + @apply w-[32px] h-[32px] rounded-full text-r1 flex items-center justify-center focus:outline-none; + background: rgba(255, 142, 0, 0.10) + } + + .disabled { + @apply bg-g3 text-g0 + } \ No newline at end of file diff --git a/components/Stepper2/Stepper2.tsx b/components/Stepper2/Stepper2.tsx new file mode 100644 index 0000000..936b872 --- /dev/null +++ b/components/Stepper2/Stepper2.tsx @@ -0,0 +1,30 @@ +import React, { useState } from 'react'; +import styles from './Stepper2.module.scss'; + + +interface StepperProps { + disabled ?: boolean +} + +export default function Stepper2 ( { disabled }: StepperProps ) { + const [count, setCount] = useState(1); + + return ( +
+ + {count} + +
+ ); +}; diff --git a/components/index.tsx b/components/index.tsx index 5a947de..5b9946a 100644 --- a/components/index.tsx +++ b/components/index.tsx @@ -11,6 +11,7 @@ export { default as Radio } from '@/components/Radio/Radio.tsx'; export { default as Select } from '@/components/Select/Select.tsx'; export { default as SignUp } from '@/components/SignUp/Step1.tsx'; export { default as Stepper } from '@/components/Stepper/Stepper.tsx'; +export { default as Stepper2 } from '@/components/Stepper2/Stepper2.tsx'; export { default as Textarea } from '@/components/Textarea/Textarea.tsx'; export { default as Toggle } from '@/components/Toggle/Toggle.tsx'; export { default as Typography } from '@/components/Typography/Typography.tsx'; diff --git a/pages/room/addRoom/step2.tsx b/pages/room/addRoom/step2.tsx index 78136ef..cd083d7 100644 --- a/pages/room/addRoom/step2.tsx +++ b/pages/room/addRoom/step2.tsx @@ -5,15 +5,12 @@ import { GetStaticPropsContext } from 'next'; import Router, { useRouter } from 'next/router'; import { Stepper, - Select, + Stepper2, Typography, Checkbox, Button, } from '@/components/index.tsx'; import { FieldValues, SubmitHandler, useForm } from 'react-hook-form'; -import { GuList, DongList } from '@/public/js/guDongList.ts'; -import { Option } from '@/components/Select/Select'; -import { GuDong } from '../addRoom'; export const getStaticProps = async ({ locale }: GetStaticPropsContext) => ({ props: { @@ -23,52 +20,35 @@ export const getStaticProps = async ({ locale }: GetStaticPropsContext) => ({ export default function Step1() { console.log('useRouter >>', useRouter()); - - const filterTranslation = useTranslation('filter'); const { register, handleSubmit, watch } = useForm({ mode: 'onChange' }); - const [guValue, setGuValue] = useState