Skip to content

Commit 78d66f7

Browse files
committed
feat: 모임 생성 퍼널 버튼에 form이 유효하지 않으면 disabled 적용
1 parent 5bb9eb6 commit 78d66f7

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

src/v1/bookGroup/create/steps/EnterTitleStep/EnterTitleStep.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import BottomActionButton from '@/v1/base/BottomActionButton';
99
import { TitleField } from './fields';
1010

1111
const EnterTitleStep = ({ onNextStep }: MoveFunnelStepProps) => {
12-
const { handleSubmit } = useFormContext<EnterTitleStepFormValues>();
12+
const {
13+
handleSubmit,
14+
formState: { isValid },
15+
} = useFormContext<EnterTitleStepFormValues>();
1316

1417
useRemoveVerticalScroll();
1518

@@ -24,6 +27,7 @@ const EnterTitleStep = ({ onNextStep }: MoveFunnelStepProps) => {
2427

2528
<BottomActionButton
2629
type="submit"
30+
disabled={!isValid}
2731
onClick={handleSubmit(() => onNextStep?.())}
2832
>
2933
다음

src/v1/bookGroup/create/steps/SelectJoinTypeStep/SelectJoinTypeStep.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ export type JoinTypeStepFieldName = keyof SelectJoinTypeStepFormValues;
1010
export type JoinTypeStepFieldProp = { name: JoinTypeStepFieldName };
1111

1212
const SelectJoinTypeStep = ({ onSubmit }: MoveFunnelStepProps) => {
13-
const { handleSubmit } = useFormContext<SelectJoinTypeStepFormValues>();
13+
const {
14+
handleSubmit,
15+
formState: { isValid },
16+
} = useFormContext<SelectJoinTypeStepFormValues>();
1417

1518
return (
1619
<article>
@@ -31,6 +34,7 @@ const SelectJoinTypeStep = ({ onSubmit }: MoveFunnelStepProps) => {
3134

3235
<BottomActionButton
3336
type="submit"
37+
disabled={!isValid}
3438
onClick={onSubmit && handleSubmit(onSubmit)}
3539
>
3640
독서모임 만들기

src/v1/bookGroup/create/steps/SetUpDetailStep/SetUpDetailStep.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ const SetUpDetailStep = ({
3030
goToSelectBookStep,
3131
onNextStep,
3232
}: SetUpDetailStepProps) => {
33-
const { handleSubmit, getValues } =
34-
useFormContext<SetUpDetailStepFormValues>();
33+
const {
34+
handleSubmit,
35+
getValues,
36+
formState: { isValid },
37+
} = useFormContext<SetUpDetailStepFormValues>();
3538

3639
return (
3740
<article className="flex flex-col gap-[2.5rem] overflow-y-scroll pb-[7rem]">
@@ -55,6 +58,7 @@ const SetUpDetailStep = ({
5558

5659
<BottomActionButton
5760
type="submit"
61+
disabled={!isValid}
5862
onClick={handleSubmit(() => onNextStep?.())}
5963
>
6064
다음

0 commit comments

Comments
 (0)