diff --git a/components/Navbar.tsx b/components/Navbar.tsx index 820b553..ae69f7d 100644 --- a/components/Navbar.tsx +++ b/components/Navbar.tsx @@ -8,9 +8,10 @@ import { NoSSR } from './NoSSR' const NavBar: React.FC = () => { const { openModal } = useModalStore(); + // get saved session ticket data + const sessionTicket = localStorage.getItem('SessionTicket'); + const handleClick = () => { - // get saved session ticket data - const sessionTicket = localStorage.getItem('SessionTicket'); if (sessionTicket !== null) { openModal({ title: 'Wallet', @@ -70,8 +71,12 @@ const NavBar: React.FC = () => { onClick={handleClick} > - Connect
- Wallet + { + sessionTicket ? + <>Connect
Wallet + : + <>Sign
In + }
diff --git a/features/Auth/components/SignupForm.tsx b/features/Auth/components/SignupForm.tsx index 0fce1c4..80b1ff0 100644 --- a/features/Auth/components/SignupForm.tsx +++ b/features/Auth/components/SignupForm.tsx @@ -51,33 +51,35 @@ const SignupForm: React.FC = () => { }) return ( -
-
- - -
-
- - -
-
- - -
-
- - -
-
+ <> +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ ) } export default SignupForm \ No newline at end of file diff --git a/package.json b/package.json index bc56ace..cb7cd75 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "react-dom": "18.2.0", "react-hook-form": "^7.41.1", "react-ipfs-url": "^0.2.2", + "react-toastify": "^9.1.1", "react-use": "^17.4.0", "recoil": "^0.7.5", "yup": "^0.32.11" diff --git a/pages/_app.tsx b/pages/_app.tsx index 2e976fa..24c141a 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,4 +1,6 @@ import '@/styles/globals.css' +import 'react-toastify/dist/ReactToastify.css' +import { ToastContainer } from 'react-toastify' import type { AppProps } from 'next/app' import { RecoilRoot } from 'recoil' @@ -7,6 +9,11 @@ function App({ Component, pageProps }: AppProps) { return ( + ) } diff --git a/utils/requester.ts b/utils/requester.ts index f8de09b..2ca394e 100644 --- a/utils/requester.ts +++ b/utils/requester.ts @@ -1,8 +1,8 @@ import axios from 'axios' import type { AxiosError, AxiosRequestConfig } from 'axios' +import { toast } from 'react-toastify' const titleId: string = process.env.NEXT_PUBLIC_PLAYFAB_TITLEID - const Requester = axios.create({ baseURL: `https://${titleId}.playfabapi.com`, }) @@ -31,7 +31,7 @@ Requester.interceptors.response.use( if (axios.isAxiosError(error)) { const axiosError = error as AxiosError - return Promise.reject(axiosError.response?.data) + return Promise.reject(axiosError.response?.data), toast(axiosError.response?.data.errorMessage); } return Promise.reject(error) diff --git a/yarn.lock b/yarn.lock index af4ace7..9a9f76c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2151,7 +2151,7 @@ clone@^2.1.1: resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" integrity sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w== -clsx@^1.1.0, clsx@^1.2.1: +clsx@^1.1.0, clsx@^1.1.1, clsx@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.2.1.tgz#0ddc4a20a549b59c93a4116bb26f5294ca17dc12" integrity sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg== @@ -5442,6 +5442,13 @@ react-promiseful@^2.0.0: lodash "^4.17.11" prop-types "^15.7.2" +react-toastify@^9.1.1: + version "9.1.1" + resolved "https://registry.yarnpkg.com/react-toastify/-/react-toastify-9.1.1.tgz#9280caea4a13dc1739c350d90660a630807bf10b" + integrity sha512-pkFCla1z3ve045qvjEmn2xOJOy4ZciwRXm1oMPULVkELi5aJdHCN/FHnuqXq8IwGDLB7PPk2/J6uP9D8ejuiRw== + dependencies: + clsx "^1.1.1" + react-universal-interface@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/react-universal-interface/-/react-universal-interface-0.6.2.tgz#5e8d438a01729a4dbbcbeeceb0b86be146fe2b3b"