From 7457dd655e6770957b6f07aca89188df2a273dad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=84=EC=9C=A0=EB=AF=BC?= Date: Tue, 16 Jul 2024 19:10:23 +0900 Subject: [PATCH] =?UTF-8?q?FE-34=20:sparkles:=20=ED=94=84=EB=A1=9C?= =?UTF-8?q?=ED=95=84=20=EC=88=98=EC=A0=95=20=EC=99=84=EB=A3=8C=20=EC=8B=9C?= =?UTF-8?q?=20toast=20=EB=A9=94=EC=84=B8=EC=A7=80=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/_app.tsx | 2 ++ src/user/ui-profile/ProfileEdit.tsx | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 37d2f8d3..107acf01 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -3,6 +3,7 @@ import '@/styles/globals.css'; import type { AppProps } from 'next/app'; import { HydrationBoundary, QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; +import Toaster from '@/components/ui/toaster'; export default function App({ Component, pageProps }: AppProps) { const [queryClient] = React.useState(() => new QueryClient()); @@ -10,6 +11,7 @@ export default function App({ Component, pageProps }: AppProps) { + diff --git a/src/user/ui-profile/ProfileEdit.tsx b/src/user/ui-profile/ProfileEdit.tsx index 144d6926..1a969b6c 100644 --- a/src/user/ui-profile/ProfileEdit.tsx +++ b/src/user/ui-profile/ProfileEdit.tsx @@ -9,6 +9,7 @@ import { Form, Formik, useFormik } from 'formik'; import { useCreatePresignedUrl, useUpdateMe } from '@/hooks/userQueryHooks'; import * as Yup from 'yup'; import fileNameChange from '../util/fileNameChange'; +import { useToast } from '@/components/ui/use-toast'; interface UserProfileEditProps { initialValues: { @@ -26,6 +27,8 @@ export default function ProfileEdit({ initialValues, onModalClose }: UserProfile const createPresignedUrl = useCreatePresignedUrl(); const fileInputRef = useRef(null); + const { toast } = useToast(); + const handleSubmit = async () => { await formik.submitForm(); // Formik의 submitForm 함수 호출 }; @@ -33,6 +36,9 @@ export default function ProfileEdit({ initialValues, onModalClose }: UserProfile const { mutate: updateMe } = useUpdateMe({ onSuccess: () => { onModalClose(); + toast({ + description: '프로필 수정이 완료되었습니다.', + }); }, });