From 353326b6c29286edecbcd28fe93eeea54d6827ab Mon Sep 17 00:00:00 2001 From: Aditya Khatri Date: Tue, 12 Nov 2024 11:49:11 +0545 Subject: [PATCH 1/2] Add register page Remove unnecessary required fields --- src/App/routes/index.tsx | 13 ++ src/components/Navbar/i18n.json | 1 + src/components/Navbar/index.tsx | 18 ++ src/views/Login/i18n.json | 2 +- src/views/Register/i18n.json | 20 ++ src/views/Register/index.tsx | 292 +++++++++++++++++++++++++++ src/views/Register/styles.module.css | 40 ++++ 7 files changed, 385 insertions(+), 1 deletion(-) create mode 100644 src/views/Register/i18n.json create mode 100644 src/views/Register/index.tsx create mode 100644 src/views/Register/styles.module.css diff --git a/src/App/routes/index.tsx b/src/App/routes/index.tsx index f0f856f2..2ba87eb8 100644 --- a/src/App/routes/index.tsx +++ b/src/App/routes/index.tsx @@ -214,6 +214,18 @@ const pageNotFound = customWrapRoute({ visibility: 'anything', }, }); +const register = customWrapRoute({ + parent: rootLayout, + path: 'register', + component: { + render: () => import('#views/Register'), + props: {}, + }, + context: { + title: 'Register', + visibility: 'is-not-authenticated', + }, +}); const login = customWrapRoute({ parent: rootLayout, @@ -288,6 +300,7 @@ const wrappedRoutes = { resendValidationEmail, mySubscription, cookiePolicy, + register, historicalAlerts, subscriptionDetail, }; diff --git a/src/components/Navbar/i18n.json b/src/components/Navbar/i18n.json index 117178a3..97ad5041 100644 --- a/src/components/Navbar/i18n.json +++ b/src/components/Navbar/i18n.json @@ -3,6 +3,7 @@ "strings": { "headerLogoAltText": "Alert Hub logo", "appLogin": "Login", + "appRegister":"Register", "appAbout": "About", "appResources": "Resources", "headerMenuHome": "Home", diff --git a/src/components/Navbar/index.tsx b/src/components/Navbar/index.tsx index 06221e83..e9ab985f 100644 --- a/src/components/Navbar/index.tsx +++ b/src/components/Navbar/index.tsx @@ -19,6 +19,7 @@ import UserContext from '#contexts/user'; import { LogoutMutation } from '#generated/types/graphql'; import useAuth from '#hooks/domain/useAuth'; import useAlert from '#hooks/useAlert'; +import useAuth from '#hooks/useAuth'; import LangaugeDropdown from './LanguageDropdown'; @@ -76,6 +77,7 @@ function Navbar(props: Props) { }, ); + const { isAuthenticated } = useAuth(); return (