diff --git a/front/src/styles/scss/_body.scss b/front/src/styles/scss/_body.scss
index 09870309334..340e854f46c 100644
--- a/front/src/styles/scss/_body.scss
+++ b/front/src/styles/scss/_body.scss
@@ -68,11 +68,17 @@ body {
height: 24px !important;
}
- &__horizon {
+ &-with-name {
img {
height: 40px;
}
}
+
+ .without-image {
+ img {
+ width: 24px;
+ }
+ }
}
.actionbar.fullscreen {
diff --git a/front/src/styles/scss/common/components/_releaseInformations.scss b/front/src/styles/scss/common/components/_releaseInformations.scss
index 95601ab7417..99233f996e0 100644
--- a/front/src/styles/scss/common/components/_releaseInformations.scss
+++ b/front/src/styles/scss/common/components/_releaseInformations.scss
@@ -9,6 +9,10 @@
position: relative;
height: 560px;
+ img {
+ min-height: 192px;
+ }
+
.license-attributions {
background-color: var(--coolgray1);
padding: 8px;
diff --git a/front/src/utils/hooks/useDeploymentSettings.ts b/front/src/utils/hooks/useDeploymentSettings.tsx
similarity index 70%
rename from front/src/utils/hooks/useDeploymentSettings.ts
rename to front/src/utils/hooks/useDeploymentSettings.tsx
index fa69914dcab..f1d0735adac 100644
--- a/front/src/utils/hooks/useDeploymentSettings.ts
+++ b/front/src/utils/hooks/useDeploymentSettings.tsx
@@ -1,4 +1,4 @@
-import { useEffect, useState } from 'react';
+import { createContext, useContext, useEffect, useState, type ReactNode } from 'react';
import defaultLogo from 'assets/logo-color.svg';
import defaultOsrdLogo from 'assets/logo-osrd-color-white.svg';
@@ -11,7 +11,18 @@ const MONTH_VALUES = {
JUNE: 5,
DECEMBER: 11,
};
-type DeploymentSettings = {
+
+const defaultSettings = {
+ digitalTwinName: 'Osrd',
+ digitalTwinLogo: defaultLogo,
+ digitalTwinLogoWithName: defaultOsrdLogo,
+ stdcmName: 'Stdcm',
+ stdcmLogo: undefined,
+ stdcmSimulationSheetLogo: undefined,
+ isCustomizedDeployment: false,
+};
+
+export type DeploymentSettings = {
digitalTwinName: string;
digitalTwinLogo: string;
digitalTwinLogoWithName: string;
@@ -21,17 +32,15 @@ type DeploymentSettings = {
isCustomizedDeployment: boolean;
};
-const useDeploymentSettings = () => {
+export type DeploymentSettingsContext = DeploymentSettings | undefined;
+
+const deploymentSettingsContext = createContext(undefined);
+
+type DeploymentContextProviderProps = { children: ReactNode };
+
+export const DeploymentContextProvider = ({ children }: DeploymentContextProviderProps) => {
const [customizedDeploymentSetting, setCustomizedDeploymentSetting] =
- useState({
- digitalTwinName: 'Osrd',
- digitalTwinLogo: defaultLogo,
- digitalTwinLogoWithName: defaultOsrdLogo,
- stdcmName: 'Stdcm',
- stdcmLogo: undefined,
- stdcmSimulationSheetLogo: undefined,
- isCustomizedDeployment: false,
- });
+ useState();
useEffect(() => {
const fetchInternalProd = async () => {
@@ -50,12 +59,11 @@ const useDeploymentSettings = () => {
digitalTwinLogoWithName = xmasOsrdLogo;
}
- setCustomizedDeploymentSetting((prev) => ({
- ...prev,
- isCustomizedDeployment: false,
+ setCustomizedDeploymentSetting({
+ ...defaultSettings,
digitalTwinLogo,
digitalTwinLogoWithName,
- }));
+ });
} else {
const overridesData = await response.json();
const { icons, names } = overridesData;
@@ -79,10 +87,17 @@ const useDeploymentSettings = () => {
console.error('Error fetching overrides.json', error);
}
};
+
fetchInternalProd();
}, []);
- return customizedDeploymentSetting;
+ return (
+
+ {children}
+
+ );
};
+const useDeploymentSettings = () => useContext(deploymentSettingsContext);
+
export default useDeploymentSettings;