Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the upcoming site URLs in the site specific branding code #250

Merged
merged 1 commit into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
36 changes: 24 additions & 12 deletions src/components/Drawer/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down Expand Up @@ -77,28 +81,32 @@ const Drawer: React.FC<Props> = (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 (
<div>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 <a href="https://swiftss.org/">www.swiftss.org</a>.</div>
);
} 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 (
<div>The Affordable Mesh Hernia Surgery Initiative is a collaboration between SWIFTSS and
the Ghanaian AMHSI working group. For more information
visit <a href="https://swiftss.org/">www.swiftss.org</a>.</div>
);
} 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 (
<div>The Affordable Mesh Hernia Surgery Initiative is a collaboration between SWIFTSS and
the Sierra Leone AMHSI working group. For more information
visit <a href="https://swiftss.org/">www.swiftss.org</a>.</div>
);
} 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 (
<div>This is the test site for the AMHSI. Please enjoy the freedom to try it out. Look
Expand All @@ -125,28 +133,32 @@ const Drawer: React.FC<Props> = (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 (
<div>Tanzania National<br />
Mesh Hernia Project<br />
eRegistry</div>
);
} 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 (
<div>Ghana Affordable<br />
Mesh Hernia Project<br />
eRegistry</div>
);
} 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 (
<div>Sierra Leone Affordable<br />
Mesh Hernia Project<br />
eRegistry</div>
);
} 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 (
<div>Affordable Mesh<br />
Expand Down
Loading