11import { TopBar } from "@interactivethings/swiss-federal-ci/dist/components" ;
22import { Header as SwissFederalCiHeader } from "@interactivethings/swiss-federal-ci/dist/components/pages-router" ;
3- import { Box , NativeSelect } from "@mui/material" ;
43import { useRouter } from "next/router" ;
54
65import { DataSourceMenu } from "@/components/data-source-menu" ;
6+ import { Flex } from "@/components/flex" ;
7+ import { Select } from "@/components/form" ;
78import { __HEADER_HEIGHT_CSS_VAR } from "@/components/header-constants" ;
89import contentRoutes from "@/content-routes.json" ;
910import { SOURCE_OPTIONS } from "@/domain/data-source/constants" ;
@@ -54,12 +55,14 @@ export const Header = ({
5455 } }
5556 >
5657 { SOURCE_OPTIONS . length > 1 && < DataSourceMenu /> }
57- < Box display = "flex" alignItems = "center" gap = { 3 } marginLeft = "auto" >
58+ < Flex alignItems = "center" gap = { 3 } marginLeft = "auto" >
5859 < LoginMenu />
59- < NativeSelect
60+ < Select
61+ id = "localeSwitcherSelect"
62+ variant = "standard"
6063 value = { currentLocale }
6164 onChange = { ( e ) => {
62- const locale = e . currentTarget . value ;
65+ const locale = e . target . value as string ;
6366 const alternate = alternates ?. [ locale ] ;
6467
6568 if ( alternate ) {
@@ -68,27 +71,27 @@ export const Header = ({
6871 push ( { pathname, query } , undefined , { locale } ) ;
6972 }
7073 } }
74+ options = { localeConfig . locales . map ( ( locale ) => ( {
75+ label : locale . toUpperCase ( ) ,
76+ value : locale ,
77+ } ) ) }
78+ sortOptions = { false }
7179 sx = { {
72- padding : 0 ,
73- border : "none !important" ,
74- backgroundColor : "transparent" ,
80+ width : "fit-content" ,
7581 color : "white !important" ,
7682
7783 "&:hover" : {
78- backgroundColor : "transparent" ,
79- color : ( t ) => `${ t . palette . cobalt [ 100 ] } !important` ,
84+ color : "cobalt.100" ,
85+ } ,
86+
87+ "& .MuiSelect-select" : {
88+ "&:hover, &[aria-expanded='true']" : {
89+ backgroundColor : "transparent !important" ,
90+ } ,
8091 } ,
8192 } }
82- >
83- { localeConfig . locales . map ( ( locale ) => (
84- // Color override is needed to make sure the text is visible on
85- // Windows machines.
86- < option key = { locale } value = { locale } style = { { color : "initial" } } >
87- { locale . toUpperCase ( ) }
88- </ option >
89- ) ) }
90- </ NativeSelect >
91- </ Box >
93+ />
94+ </ Flex >
9295 </ TopBar >
9396 { hideLogo ? null : (
9497 < SwissFederalCiHeader
0 commit comments