diff --git a/src/app/business/apply/page.tsx b/src/app/business/apply/page.tsx index 4959a42..8d4c17d 100644 --- a/src/app/business/apply/page.tsx +++ b/src/app/business/apply/page.tsx @@ -24,6 +24,7 @@ export default function ApplyBusiness() { await sendApplication(transformedData); }; const sendApplication = async (recvData: any) => { + setSucess(false); const { data: { user }, } = await supabase.auth.getUser(); @@ -66,6 +67,7 @@ export default function ApplyBusiness() { }, ]) .select(); + setSucess(true); // console.table(data); Swal.fire({ icon: error == null ? "success" : "error", @@ -141,6 +143,7 @@ export default function ApplyBusiness() { } }); } + setSucess(false); } else { console.error("User ID is undefined."); } diff --git a/src/components/loading/loader.tsx b/src/components/loading/loader.tsx index 4098107..565cc61 100644 --- a/src/components/loading/loader.tsx +++ b/src/components/loading/loader.tsx @@ -10,14 +10,14 @@ const loadingOption = { preserveAspectRatio: "xMidYMid slice", }, }; -const successOption = { - loop: false, - autoplay: true, - animationData: successData, - rendererSettings: { - preserveAspectRatio: "xMidYMid slice", - }, -}; +// const successOption = { +// loop: false, +// autoplay: true, +// animationData: successData, +// rendererSettings: { +// preserveAspectRatio: "xMidYMid slice", +// }, +// }; interface LoaderProps { isSuccess: boolean; @@ -25,15 +25,17 @@ interface LoaderProps { export function Loader(props: LoaderProps) { return ( -
+ <> {!props.isSuccess && ( - +
+ +
)} {/* {!props.isSuccess ? ( ) : ( )} */} -
+ ); }