Skip to content
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
2 changes: 1 addition & 1 deletion frontend-new/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="loading">
<p>Loading<span class="dot-anim">.</span></p>
<img src="%PUBLIC_URL%/logo.svg" alt="Compass Logo" class="compass-logo" />
<img id="loading-logo" src="%PUBLIC_URL%/logo.svg" alt="Compass Logo" class="compass-logo" />
</div>
<!--
This HTML file is a template.
Expand Down
9 changes: 9 additions & 0 deletions frontend-new/src/branding/branding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
getMetaDescription,
getFaviconUrl,
getThemeCssVariables,
getLogoUrl,
} from "src/envService";
import { getSeoConfig, SeoConfig } from "src/branding/seoConfig";

Expand Down Expand Up @@ -89,6 +90,14 @@ export const applyBrandingFromEnv = (): void => {
upsertLinkHref("apple-touch-icon", appIconUrl);
}

const logUrl = getLogoUrl();
if (logUrl) {
const img = document.getElementById("loading-logo");
if (img instanceof HTMLImageElement) {
img.src = logUrl;
}
}

// JSON-LD structured data overrides.
updateJsonLd(getSeoConfig(), document.title);
};
7 changes: 6 additions & 1 deletion frontend-new/src/error/errorPage/ErrorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Box, Typography } from "@mui/material";
import React from "react";
import { useTranslation } from "react-i18next";
import BugReportButton from "src/feedback/bugReport/bugReportButton/BugReportButton";
import { getLogoUrl } from "src/envService";

const uniqueId = "37d307ae-4f1e-4d8d-bafe-fd642f8af4ab";

Expand All @@ -17,6 +18,10 @@ interface ErrorPageProps {

const ErrorPage: React.FC<ErrorPageProps> = ({ errorMessage }) => {
const { t } = useTranslation();

const logoUrlFromEnv = getLogoUrl();
const logoSrc = logoUrlFromEnv || `${process.env.PUBLIC_URL}/logo.svg`;

return (
<Box
sx={{
Expand All @@ -30,7 +35,7 @@ const ErrorPage: React.FC<ErrorPageProps> = ({ errorMessage }) => {
data-testid={DATA_TEST_ID.ERROR_CONTAINER}
>
<img
src="/logo.svg"
src={logoSrc}
alt={t("error.errorPage.illustrationAlt")}
width="250px"
data-testid={DATA_TEST_ID.ERROR_ILLUSTRATION}
Expand Down