diff --git a/app/front-end/src/app/(authentication)/sign-in/page.tsx b/app/front-end/src/app/(authentication)/sign-in/page.tsx index ff602f1d..5a09aec1 100644 --- a/app/front-end/src/app/(authentication)/sign-in/page.tsx +++ b/app/front-end/src/app/(authentication)/sign-in/page.tsx @@ -60,7 +60,7 @@ export default function SignInPage() { } return (
- + {/* */} {twoFaData && }
diff --git a/app/front-end/src/app/(authentication)/sign-up/page.tsx b/app/front-end/src/app/(authentication)/sign-up/page.tsx index e543c361..1ba63ba9 100644 --- a/app/front-end/src/app/(authentication)/sign-up/page.tsx +++ b/app/front-end/src/app/(authentication)/sign-up/page.tsx @@ -55,7 +55,7 @@ export default function SignUp() { return (
- + {/* */}
- {children} + + {/* */} ) diff --git a/app/front-end/src/app/settings/page.tsx b/app/front-end/src/app/settings/page.tsx index 05bbe1e3..4372de96 100644 --- a/app/front-end/src/app/settings/page.tsx +++ b/app/front-end/src/app/settings/page.tsx @@ -6,7 +6,8 @@ import styles from './styles.module.css' import AccountTab from '@/components/SettingsForm/account-tab/accountTab' import SecurityTab from '@/components/SettingsForm/security-tab/security' import { FormContext, SettingsProps } from '@/components/SettingsForm/form-components/formContext' -import { ToastContainer, toast } from 'react-toastify'; +import { toast } from 'react-toastify'; +import { notificationStyle } from '@/components/ToastProvider' async function getInitialData({setValuesToPost, setAccountValues} : @@ -14,14 +15,14 @@ async function getInitialData({setValuesToPost, setAccountValues} : setValuesToPost : SettingsProps['setValuesToPost'], setAccountValues : SettingsProps['setAccountValues'] }) { - + try { const access = Cookies.get('access'); const response = await fetch('', { method : "GET", headers :{ Authorization : `Bearer ${access}` }, }) - + // const data = await response.json(); setValuesToPost( { @@ -72,22 +73,22 @@ const postFormData = async ({valuesToPost, isChanged} : } const validateInput : () => boolean = () => { - const toCheck : string[] = ["first_name", "last_name", "nickname", "email"]; + const toCheck : string[] = ["first_name", "last_name", "nickname"]; let isValid : boolean = true; toCheck.map((key) => { if (valuesToPost[key] === "") { - toast.error(`Invalid input : ${key}`) + toast.error(`Invalid input : ${key}`, notificationStyle) isValid = false; } }); if (! validateEmail(valuesToPost["email"] as string)) { - toast.error(`Invalid input : email`); + toast.error(`Invalid input : email`, notificationStyle); isValid = false; } if (valuesToPost['new_password'] !== valuesToPost['repeat_password']) { - toast.error(`Invalid input : new_password or repeat_password`); + toast.error(`Invalid input : new_password or repeat_password`, notificationStyle); isValid = false; } return isValid; @@ -108,7 +109,7 @@ const postFormData = async ({valuesToPost, isChanged} : }); if (res.ok) { - toast.success("To be saved..."); + toast.success("To be saved...", notificationStyle); /* .... updates form placeholders */ } } @@ -173,7 +174,6 @@ function SettingsPage() return (
-
diff --git a/app/front-end/src/components/ToastProvider.tsx b/app/front-end/src/components/ToastProvider.tsx new file mode 100644 index 00000000..567d9e9d --- /dev/null +++ b/app/front-end/src/components/ToastProvider.tsx @@ -0,0 +1,46 @@ +"use client"; + +import React from 'react' +import { ToastContainer } from "react-toastify"; + +interface ToastProviderProps { + children: React.ReactNode; +} + +const notificationStyle : {} = +{ + position: "top-right", + autoClose: 5000, + hideProgressBar: false, + closeOnClick: true, + pauseOnHover: true, + draggable: true, + progress: undefined, + theme: "dark", + // transition: Bounce, +} + +function ToastProvider({ children }: ToastProviderProps) { + + return ( + <> + + {children} + + ); +} + +export default ToastProvider; +export { notificationStyle } \ No newline at end of file diff --git a/app/front-end/src/components/inviteFriend.tsx b/app/front-end/src/components/inviteFriend.tsx index 8d94e74b..f4c506a6 100644 --- a/app/front-end/src/components/inviteFriend.tsx +++ b/app/front-end/src/components/inviteFriend.tsx @@ -277,7 +277,7 @@ export default function InviteFriend( {show, close}: Props) { return ( <> - + /> */} - + {/* */} Two Factor Authentication