Skip to content

Commit

Permalink
- fix Paul's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Uriel-Sautron committed Jan 14, 2025
1 parent 23fa75a commit bf5c79a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ const styles = {
},
lmrLogo: {
width: 'auto',
height: 'auto',
marginTop: 'auto',

marginRight: 'auto',
},
simulationTitle: {
Expand Down
2 changes: 1 addition & 1 deletion front/src/common/BootstrapSNCF/NavBarSNCF.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className="mastheader">
Expand Down
2 changes: 1 addition & 1 deletion front/src/main/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function Home() {

return (
<ModalProvider>
<NavBarSNCF logo={digitalTwin.digitalTwinLogo} />
<NavBarSNCF logo={digitalTwin.logoWithName} />
<main className="mastcontainer mastcontainer-no-mastnav">
<div className="cardscontainer">
<div className="row justify-content-center mb-2">
Expand Down
10 changes: 5 additions & 5 deletions front/src/utils/hooks/useLogo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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();
Expand All @@ -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);
Expand Down

0 comments on commit bf5c79a

Please sign in to comment.