From bf5c79a653f215b76b15f97d39757351b538aa6c Mon Sep 17 00:00:00 2001 From: Uriel-Sautron Date: Tue, 14 Jan 2025 10:42:11 +0100 Subject: [PATCH] - fix Paul's comments --- .../StdcmResults/SimulationReportStyleSheet.ts | 3 +-- front/src/common/BootstrapSNCF/NavBarSNCF.tsx | 2 +- front/src/main/home.tsx | 2 +- front/src/utils/hooks/useLogo.ts | 10 +++++----- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/front/src/applications/stdcm/components/StdcmResults/SimulationReportStyleSheet.ts b/front/src/applications/stdcm/components/StdcmResults/SimulationReportStyleSheet.ts index a49138f5478..8fc80373df4 100644 --- a/front/src/applications/stdcm/components/StdcmResults/SimulationReportStyleSheet.ts +++ b/front/src/applications/stdcm/components/StdcmResults/SimulationReportStyleSheet.ts @@ -44,8 +44,7 @@ const styles = { }, lmrLogo: { width: 'auto', - height: 'auto', - marginTop: 'auto', + marginRight: 'auto', }, simulationTitle: { diff --git a/front/src/common/BootstrapSNCF/NavBarSNCF.tsx b/front/src/common/BootstrapSNCF/NavBarSNCF.tsx index 5a4661dcee5..fddb5a8a153 100644 --- a/front/src/common/BootstrapSNCF/NavBarSNCF.tsx +++ b/front/src/common/BootstrapSNCF/NavBarSNCF.tsx @@ -32,7 +32,7 @@ const LegacyNavBarSNCF = ({ appName, logo }: Props) => { const { t } = useTranslation('home/navbar'); const { logout, username } = useAuth(); - const headerLogo = logo ?? digitalTwin.logo; + const headerLogo = logo ?? digitalTwin?.logo; return (
diff --git a/front/src/main/home.tsx b/front/src/main/home.tsx index e370aed0cf8..7754f94b52e 100644 --- a/front/src/main/home.tsx +++ b/front/src/main/home.tsx @@ -24,7 +24,7 @@ export default function Home() { return ( - +
diff --git a/front/src/utils/hooks/useLogo.ts b/front/src/utils/hooks/useLogo.ts index 6dac21ae8c5..17af6f8e64b 100644 --- a/front/src/utils/hooks/useLogo.ts +++ b/front/src/utils/hooks/useLogo.ts @@ -13,9 +13,9 @@ const MONTH_VALUES = { }; const useLogo = () => { - const [digitalTwin, setDigitalTwin] = useState<{ logo: string; digitalTwinLogo: string }>({ + const [digitalTwin, setDigitalTwin] = useState<{ logo: string; logoWithName: string }>({ logo: defaultLogo, - digitalTwinLogo: defaultOsrdLogo, + logoWithName: defaultOsrdLogo, }); const [stdcm, setStdcm] = useState<{ stdcmLogo?: string; stdcmPngLogo?: string }>({ stdcmLogo: undefined, @@ -30,10 +30,10 @@ const useLogo = () => { if (!response.ok || response.headers.get('Content-Type') !== 'application/json') { setCustomizedDeployment(false); if (new Date().getMonth() === MONTH_VALUES.JUNE) { - setDigitalTwin({ logo: proudLogo, digitalTwinLogo: proudOsrdLogo }); + setDigitalTwin({ logo: proudLogo, logoWithName: proudOsrdLogo }); } if (new Date().getMonth() === MONTH_VALUES.DECEMBER) { - setDigitalTwin({ logo: xmasLogo, digitalTwinLogo: xmasOsrdLogo }); + setDigitalTwin({ logo: xmasLogo, logoWithName: xmasOsrdLogo }); } } else { const overridesData = await response.json(); @@ -46,7 +46,7 @@ const useLogo = () => { setCustomizedDeployment(true); setStdcm({ stdcmLogo: lmrLogoPath, stdcmPngLogo: lmrPngLogoPath }); - setDigitalTwin({ logo: horizonLogoPath, digitalTwinLogo: horizonFullLogoPath }); + setDigitalTwin({ logo: horizonLogoPath, logoWithName: horizonFullLogoPath }); } } catch { setCustomizedDeployment(false);