Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/app/post-meetup/[groupId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ const EditMeetupPage = ({ params }: Props) => {

<form.Subscribe
children={(state) => (
<MeetupSubmitButton state={state} onSubmitClick={() => form.handleSubmit()} />
<MeetupSubmitButton
state={state}
submitName='모임 수정'
onSubmitClick={() => form.handleSubmit()}
/>
)}
selector={(state) => state}
/>
Expand Down
6 changes: 5 additions & 1 deletion src/app/post-meetup/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ const PostMeetupPage = () => {

<form.Subscribe
children={(state) => (
<MeetupSubmitButton state={state} onSubmitClick={() => form.handleSubmit()} />
<MeetupSubmitButton
state={state}
submitName='모임 생성'
onSubmitClick={() => form.handleSubmit()}
/>
)}
selector={(state) => state}
/>
Expand Down
5 changes: 3 additions & 2 deletions src/components/pages/post-meetup/post-button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@ import { AnyFormState } from '@tanstack/react-form';
import { Button } from '@/components/ui';

interface Props {
submitName: string;
state: AnyFormState;
onSubmitClick: () => void;
}

export const MeetupSubmitButton = ({ state, onSubmitClick }: Props) => {
export const MeetupSubmitButton = ({ submitName, state, onSubmitClick }: Props) => {
const { canSubmit, isSubmitted, isPristine } = state;

const isSubmitDisabled = !canSubmit || isSubmitted || isPristine;

return (
<div className='mt-6 border-t-1 border-gray-200 bg-white px-4 py-3'>
<Button disabled={isSubmitDisabled} type='button' onClick={onSubmitClick}>
모임 생성
{submitName}
</Button>
</div>
);
Expand Down