Skip to content

Commit

Permalink
๐Ÿ”ง chore: ์ œ์ถœ์‹œ ๋ฒ„ํŠผ์— disabled ์ถ”๊ฐ€ #37
Browse files Browse the repository at this point in the history
  • Loading branch information
froggy1014 committed Aug 29, 2024
1 parent bb3fcc2 commit 2446e78
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,22 @@ interface Props {
totalStep: number;
currentStep: number;
onNext: () => void;
disabled?: boolean;
}

const CreateFestivalButton: FC<Props> = ({
currentStep,
totalStep,
onNext,
disabled,
}) => {
return (
<div className="fixed bottom-[8px] w-full max-w-none px-[16px] lg:max-w-[450px]">
<BasicButton
type={totalStep === currentStep ? "submit" : "button"}
label={currentStep === 1 ? "๋‹ค์Œ" : "ํŽ˜์Šคํ‹ฐ๋ฒŒ ๋“ฑ๋กํ•˜๊ธฐ"}
onClick={onNext}
disabled={disabled}
/>
</div>
);
Expand Down
7 changes: 6 additions & 1 deletion src/app/(home)/festivals/new/view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ const CreateFestivalView: FC<Props> = ({ moods, categories }) => {
resolver: zodResolver(CreateFestivalSchema),
});

const { trigger, handleSubmit } = methods;
const {
trigger,
handleSubmit,
formState: { isSubmitting },
} = methods;

const { currentStep, handleNextStep, handlePrevStep } =
useStep<CreateFestivalType>(
Expand Down Expand Up @@ -106,6 +110,7 @@ const CreateFestivalView: FC<Props> = ({ moods, categories }) => {
totalStep={TOTAL_STEP}
currentStep={currentStep}
onNext={handleNextStep}
disabled={isSubmitting}
/>
</form>
</section>
Expand Down

0 comments on commit 2446e78

Please sign in to comment.