Skip to content

Commit

Permalink
Add Registration Page
Browse files Browse the repository at this point in the history
  • Loading branch information
roshni73 committed Oct 29, 2024
1 parent d27010d commit 35603d8
Show file tree
Hide file tree
Showing 6 changed files with 520 additions and 7 deletions.
13 changes: 13 additions & 0 deletions src/App/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,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 wrappedRoutes = {
rootLayout,
Expand All @@ -190,6 +202,7 @@ const wrappedRoutes = {
allSourcesFeeds,
about,
pageNotFound,
register,
};

export const unwrappedRoutes = unwrapRoute(Object.values(wrappedRoutes));
Expand Down
1 change: 1 addition & 0 deletions src/components/Navbar/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"strings": {
"headerLogoAltText": "Alert Hub logo",
"appLogin": "Login",
"appRegister":"register",
"appAbout": "About",
"appResources": "Resources",
"headerMenuHome": "Home",
Expand Down
26 changes: 19 additions & 7 deletions src/components/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { _cs } from '@togglecorp/fujs';
import goLogo from '#assets/icons/go-logo-2020.svg';
import Link from '#components/Link';
import NavigationTab from '#components/NavigationTab';
import useAuth from '#hooks/useAuth';

import LangaugeDropdown from './LanguageDropdown';

Expand All @@ -22,6 +23,7 @@ interface Props {
function Navbar(props: Props) {
const { className } = props;
const strings = useTranslation(i18n);
const { isAuthenticated } = useAuth();
return (
<nav className={_cs(styles.navbar, className)}>
<PageContainer
Expand Down Expand Up @@ -60,13 +62,23 @@ function Navbar(props: Props) {
>
{strings.appResources}
</NavigationTab>
<Button
name={undefined}
variant="primary"
onClick={undefined}
>
{strings.appLogin}
</Button>
{!isAuthenticated && (
<>
<Button
name={undefined}
variant="primary"
onClick={undefined}
>
{strings.appLogin}
</Button>
<Link
to="register"
variant="primary"
>
{strings.appRegister}
</Link>
</>
)}
</NavigationTabList>
</PageContainer>
<PageContainer
Expand Down
28 changes: 28 additions & 0 deletions src/views/Register/i18n.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"namespace": "register",
"strings": {
"registerTitle": "IFRC GO - Register",
"registerHeader": "Register",
"registerSubHeader": "Staff, members and volunteers of the Red Cross Red Crescent Movement (National Societies, the IFRC and the ICRC) are welcome to register for a user account on GO, to access information for the Membership. Other responders and members of the public may browse the public areas of the site without registering for an account.",
"registerFirstName": "First Name",
"registerLastName": "Last Name",
"registerEmail": "Email",
"registerCountry": "Country",
"registerCity": "City",
"registerOrganizationType": "Organization Type",
"registerOrganizationName": "Organization Name",
"registerDepartment": "Department",
"registerPosition": "Position",
"registerPhoneNumber": "Phone Number",
"registerPassword": "Password",
"registerConfirmPassword": "Confirm Password",
"registerJustification": "Justification",
"registerSubmit": "Register",
"registerAccountPresent": "Already have an account? {loginLink}",
"registerLogin": "Login",
"registrationFailure": "Sorry could not register new user right now!",
"registrationSuccess": "Successfully created a user!",
"requestAccess": "Request Access",
"registerJustify": "It appears you do not have an official Red Cross Red Crescent email, we will need to verify your status. Please note, this may take some time."
}
}
Loading

0 comments on commit 35603d8

Please sign in to comment.