From ae6af5e0d88ac97246a17be8365bc9282217d13e Mon Sep 17 00:00:00 2001 From: paolo7 Date: Mon, 13 May 2024 11:43:02 +0100 Subject: [PATCH] Added the upcoming site URLs in the site specific branding code --- public/index.html | 12 +++++++---- src/components/Drawer/Drawer.tsx | 36 +++++++++++++++++++++----------- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/public/index.html b/public/index.html index 565e91e..effad06 100644 --- a/public/index.html +++ b/public/index.html @@ -30,16 +30,20 @@ var domain = window.location.hostname; // If domain is not recognised, default to Tanzania var title = "eRegistry Tz"; - if (window.location.hostname === 'tmh-registry-client.herokuapp.com') { + if (window.location.hostname === 'tz-registry.swiftss.org' || + window.location.hostname === 'tmh-registry-client.herokuapp.com') { // Tanzania title = "eRegistry Tz"; - } else if (window.location.hostname === 'tmh-registry-client-gh-6a64e51863f6.herokuapp.com') { + } else if (window.location.hostname === 'gh-registry.swiftss.org' || + window.location.hostname === 'tmh-registry-client-gh-6a64e51863f6.herokuapp.com') { // Ghana title = "eRegistry Gh"; - } else if (window.location.hostname === 'tmh-registry-client-sl.herokuapp.com') { + } else if (window.location.hostname === 'sl-registry.swiftss.org' || + window.location.hostname === 'tmh-registry-client-sl.herokuapp.com') { // Sierra Leone title = "eRegistry SL"; - } else if (window.location.hostname === 'tmh-registry-client-staging.herokuapp.com') { + } else if (window.location.hostname === 'test-registry.swiftss.org' || + window.location.hostname === 'tmh-registry-client-staging.herokuapp.com') { // Staging site title = "eRegistry TEST SITE"; } else if (window.location.hostname === 'localhost') { diff --git a/src/components/Drawer/Drawer.tsx b/src/components/Drawer/Drawer.tsx index 50c4fb3..686164b 100644 --- a/src/components/Drawer/Drawer.tsx +++ b/src/components/Drawer/Drawer.tsx @@ -36,16 +36,20 @@ export type Props = { let SiteLogo: string; // If domain is not recognised, default to Tanzania SiteLogo = TSALogo; -if (window.location.hostname === 'tmh-registry-client.herokuapp.com') { +if (window.location.hostname === 'tz-registry.swiftss.org' || + window.location.hostname === 'tmh-registry-client.herokuapp.com') { // Tanzania SiteLogo = TSALogo; -} else if (window.location.hostname === 'tmh-registry-client-gh-6a64e51863f6.herokuapp.com') { +} else if (window.location.hostname === 'gh-registry.swiftss.org' || + window.location.hostname === 'tmh-registry-client-gh-6a64e51863f6.herokuapp.com') { // Ghana SiteLogo = GHLogo; -} else if (window.location.hostname === 'tmh-registry-client-sl.herokuapp.com') { +} else if (window.location.hostname === 'sl-registry.swiftss.org' || + window.location.hostname === 'tmh-registry-client-sl.herokuapp.com') { // Sierra Leone SiteLogo = SLLogo; -} else if (window.location.hostname === 'tmh-registry-client-staging.herokuapp.com') { +} else if (window.location.hostname === 'test-registry.swiftss.org' || + window.location.hostname === 'tmh-registry-client-staging.herokuapp.com') { // Staging site SiteLogo = TSALogoTest; } else if (window.location.hostname === 'localhost') { @@ -77,28 +81,32 @@ const Drawer: React.FC = (props) => { breakpoints.des1200 || breakpoints.des1440 || breakpoints.des1366 || breakpoints.des1920; const getLocalisedFooterText = () => { - if (window.location.hostname === 'tmh-registry-client.herokuapp.com') { + if (window.location.hostname === 'tz-registry.swiftss.org' || + window.location.hostname === 'tmh-registry-client.herokuapp.com') { // Tanzania return (
The Tanzania National Mesh Hernia Project is an original collaboration between SWIFTSS and the TSA (and the forerunner of the Affordable Mesh Hernia Surgery Initiative). For more information visit www.swiftss.org.
); - } else if (window.location.hostname === 'tmh-registry-client-gh-6a64e51863f6.herokuapp.com') { + } else if (window.location.hostname === 'gh-registry.swiftss.org' || + window.location.hostname === 'tmh-registry-client-gh-6a64e51863f6.herokuapp.com') { // Ghana return (
The Affordable Mesh Hernia Surgery Initiative is a collaboration between SWIFTSS and the Ghanaian AMHSI working group. For more information visit www.swiftss.org.
); - } else if (window.location.hostname === 'tmh-registry-client-sl.herokuapp.com') { + } else if (window.location.hostname === 'sl-registry.swiftss.org' || + window.location.hostname === 'tmh-registry-client-sl.herokuapp.com') { // Sierra Leone return (
The Affordable Mesh Hernia Surgery Initiative is a collaboration between SWIFTSS and the Sierra Leone AMHSI working group. For more information visit www.swiftss.org.
); - } else if (window.location.hostname === 'tmh-registry-client-staging.herokuapp.com') { + } else if (window.location.hostname === 'test-registry.swiftss.org' || + window.location.hostname === 'tmh-registry-client-staging.herokuapp.com') { // Staging site return (
This is the test site for the AMHSI. Please enjoy the freedom to try it out. Look @@ -125,28 +133,32 @@ const Drawer: React.FC = (props) => { const footerText= getLocalisedFooterText(); const getLocalisedHeaderText = () => { - if (window.location.hostname === 'tmh-registry-client.herokuapp.com') { + if (window.location.hostname === 'tz-registry.swiftss.org' || + window.location.hostname === 'tmh-registry-client.herokuapp.com') { // Tanzania return (
Tanzania National
Mesh Hernia Project
eRegistry
); - } else if (window.location.hostname === 'tmh-registry-client-gh-6a64e51863f6.herokuapp.com') { + } else if (window.location.hostname === 'gh-registry.swiftss.org' || + window.location.hostname === 'tmh-registry-client-gh-6a64e51863f6.herokuapp.com') { // Ghana return (
Ghana Affordable
Mesh Hernia Project
eRegistry
); - } else if (window.location.hostname === 'tmh-registry-client-sl.herokuapp.com') { + } else if (window.location.hostname === 'sl-registry.swiftss.org' || + window.location.hostname === 'tmh-registry-client-sl.herokuapp.com') { // Sierra Leone return (
Sierra Leone Affordable
Mesh Hernia Project
eRegistry
); - } else if (window.location.hostname === 'tmh-registry-client-staging.herokuapp.com') { + } else if (window.location.hostname === 'test-registry.swiftss.org' || + window.location.hostname === 'tmh-registry-client-staging.herokuapp.com') { // Staging site return (
Affordable Mesh