Skip to content
Merged
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
12 changes: 11 additions & 1 deletion src/components/pages/group/group-modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { useParams, useRouter } from 'next/navigation';

import { GroupModalApprovalContent } from '@/components/pages/group/group-modal/approval-content';
import { GroupModalCommonContent } from '@/components/pages/group/group-modal/common-content';
import { Toast } from '@/components/ui';
import { ModalContent } from '@/components/ui/modal';
import { useToast } from '@/components/ui/toast/core';
import { useAttendGroup } from '@/hooks/use-group/use-group-attend';
import { useDeleteGroup } from '@/hooks/use-group/use-group-delete';
import { useKickGroupMember } from '@/hooks/use-group/use-group-kick';
Expand Down Expand Up @@ -32,6 +34,7 @@ export const GroupModal = (props: Props) => {

const { replace } = useRouter();
const { groupId } = useParams() as { groupId: string };
const { run } = useToast();

const { mutateAsync: attendMutate, isPending: isAttending } = useAttendGroup({ groupId });
const { mutateAsync: leaveMutate, isPending: isCanceling } = useLeaveGroup({ groupId });
Expand All @@ -44,7 +47,14 @@ export const GroupModal = (props: Props) => {
const isPending = isAttending || isCanceling || isDeleting || isKicking;

const mutateByType = {
attend: () => attendMutate(undefined),
attend: async () => {
await attendMutate(undefined);
run(
<Toast offset='button' type='success'>
모임 신청 완료! Share the fun
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
모임 신청 완료! Share the fun
모임 신청 완료! Share the Monster

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ 괴물이 되셨군요

</Toast>,
);
},
approval: (message: AttendGroupPayload) => attendMutate(message),
pending: () => leaveMutate(),
leave: () => leaveMutate(),
Expand Down