diff --git a/src/app/theme.ts b/src/app/theme.ts index 8bf9872b..78e0a9ab 100644 --- a/src/app/theme.ts +++ b/src/app/theme.ts @@ -4,20 +4,11 @@ const theme = createTheme({ typography: { fontFamily: "Roboto, Arial, sans-serif", }, - logoSizes: { + logoSize: { width: { - xs: "40vw", - sm: "35vw", - md: "30vw", - lg: "25vw", - xl: "20vw", - }, - height: { - xs: "100%", - sm: "90%", - md: "80%", - lg: "70%", - xl: "50%", + xs: "290px", + sm: "390px", + md: "512px", }, }, cssVariables: true, @@ -119,6 +110,7 @@ const theme = createTheme({ styleOverrides: { root: { backgroundColor: "#05486C", // Dark Blue background + height: "64px", // Height of the AppBar }, }, }, diff --git a/src/components/Header.tsx b/src/components/Header.tsx index b76a9f9a..c5c21834 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -1,3 +1,4 @@ +import theme from "@/app/theme"; import styled from "@emotion/styled"; import AccountCircleIcon from "@mui/icons-material/AccountCircle"; import MenuIcon from "@mui/icons-material/Menu"; @@ -8,7 +9,7 @@ import { IconButton, Toolbar, Typography, - useTheme, + useMediaQuery, } from "@mui/material"; import Image from "next/image"; import Link from "next/link"; @@ -32,7 +33,7 @@ interface HeaderProps { } const Header: React.FC = ({ setSideNavOpen }) => { - const theme = useTheme(); + const isSmallScreen = useMediaQuery(theme.breakpoints.down("md")); /** * Function to handle the toggling of the side navigation menu @@ -42,72 +43,57 @@ const Header: React.FC = ({ setSideNavOpen }) => { }; return ( - - {/* AppBar component for the header */} - - - {/* Navigation menu toggle button */} - - - + + + {/* Navigation menu toggle button on the left */} + + + - {/* Logo container in the center */} - - - {/* Link to the home page with the logo */} - - - - - + {/* Logo container in the center */} + + + + + - {/* User interaction components */} - + {/* Language toggle button */} + + + {isSmallScreen ? "FR" : "Français"} + + - {/* User account icon button */} - console.log("User Account Clicked")} - > - - - - - - + {/* User account icon button */} + console.log("User Account Clicked")} + > + + + + + ); }; diff --git a/src/type/theme.d.ts b/src/type/theme.d.ts index acd465bf..baf251c3 100644 --- a/src/type/theme.d.ts +++ b/src/type/theme.d.ts @@ -10,16 +10,16 @@ import { ResponsiveStyleValue } from "@mui/system"; declare module "@mui/material/styles" { interface Theme { - // Custom sizes for logo, defined by responsive width and height - logoSizes: { + // Custom size for logo, defined by responsive width and height + logoSize: { width: ResponsiveStyleValue; height: ResponsiveStyleValue; }; } interface ThemeOptions { - // Optional custom sizes for logo, with partial responsive width and height - logoSizes?: { + // Optional custom size for logo, with partial responsive width and height + logoSize?: { width?: ResponsiveStyleValue; height?: ResponsiveStyleValue; };