@@ -20,15 +20,13 @@ import {
2020import { LanguageSelector } from './LanguageSelector'
2121import { ReactElement } from 'react'
2222import MenuIcon from '@mui/icons-material/Menu'
23- import { useTheme } from '@mui/material/styles'
2423import logo from './assets/images/logo.png'
2524
2625const NavBar = ( ) : ReactElement => {
2726 const [ isDrawerOpen , setIsDrawerOpen ] = useState < boolean > ( false )
2827 const location = useLocation ( )
2928 const { openSurvey } = useSurvey ( )
3029 const { t } = useTranslation ( )
31- const theme = useTheme ( )
3230
3331 const toggleDrawer = ( newOpen : boolean ) => ( ) => {
3432 setIsDrawerOpen ( newOpen )
@@ -49,35 +47,37 @@ const NavBar = (): ReactElement => {
4947 < >
5048 < AppBar position = "sticky" color = "default" >
5149 < Container maxWidth = "xl" >
52- < IconButton
53- color = "inherit"
54- aria-label = "open drawer"
55- onClick = { toggleDrawer ( true ) }
56- sx = { { display : { xs : 'block' , md : 'none' } } }
57- edge = "start"
58- >
59- < MenuIcon />
60- </ IconButton >
61- < Toolbar disableGutters sx = { { display : { xs : 'none' , md : 'flex' } } } >
62- < Link to = "/" style = { { textDecoration : 'none' , marginRight : '1rem' , flexShrink : 0 , color : theme . palette . primary . main } } >
63- < Avatar src = { logo } alt = "Logo WDT" sx = { { width : '100%' , height : '100%' , maxWidth : '50px' } } />
64- </ Link >
65- < Link to = "/sponsorship" style = { { textDecoration : 'none' , height : '100%' , color : theme . palette . primary . main } } >
66- < Button sx = { { height : '100%' , backgroundColor : isActive ( '/sponsorship' ) ? '#c1c1c1' : 'transparent' } } >
67- < Typography > { t ( "navbar.sponsorship" , "¿Te interesa patrocinar?" ) } </ Typography >
68- </ Button >
69- </ Link >
70- < Link to = "/about" style = { { textDecoration : 'none' , height : '100%' , color : theme . palette . primary . main } } >
71- < Button sx = { { height : '100%' , backgroundColor : isActive ( '/about' ) ? '#c1c1c1' : 'transparent' } } >
72- < Typography > { t ( "navbar.aboutUs" , "Acerca de nosotros" ) } </ Typography >
73- </ Button >
74- </ Link >
75- < Link to = "/" onClick = { openSurvey } style = { { textDecoration : 'none' , height : '100%' , color : theme . palette . primary . main } } >
76- < Button sx = { { height : '100%' } } >
77- < Typography > { t ( "navbar.survey" , "Encuesta" ) } </ Typography >
78- </ Button >
79- </ Link >
80- < Box sx = { { ml : 1 } } >
50+ < Toolbar variant = "dense" sx = { { alignItems : 'stretch' , justifyContent : 'space-between' } } >
51+ < IconButton
52+ color = "inherit"
53+ aria-label = "open drawer"
54+ onClick = { toggleDrawer ( true ) }
55+ edge = "start"
56+ sx = { { display : { xs : 'flex' , md : 'none' } } }
57+ >
58+ < MenuIcon />
59+ </ IconButton >
60+ < Box sx = { { display : { xs : 'none' , md : 'flex' } , alignItems : 'center' } } >
61+ < Link to = "/" style = { { textDecoration : 'none' , marginRight : '1rem' , flexShrink : 0 } } >
62+ < Avatar src = { logo } alt = "Logo WDT" sx = { { width : '100%' , height : '100%' , maxWidth : '50px' } } />
63+ </ Link >
64+ < Link to = "/sponsorship" style = { { textDecoration : 'none' , height : '100%' } } >
65+ < Button className = { isActive ( '/sponsorship' ) ? 'active' : '' } sx = { { height : '100%' , borderRadius : '0' } } >
66+ < Typography > { t ( "navbar.sponsorship" ) } </ Typography >
67+ </ Button >
68+ </ Link >
69+ < Link to = "/about" style = { { textDecoration : 'none' , height : '100%' } } >
70+ < Button className = { isActive ( '/about' ) ? 'active' : '' } sx = { { height : '100%' , borderRadius : '0' } } >
71+ < Typography > { t ( "navbar.aboutUs" ) } </ Typography >
72+ </ Button >
73+ </ Link >
74+ < Link to = "/" onClick = { openSurvey } style = { { textDecoration : 'none' , height : '100%' } } >
75+ < Button sx = { { height : '100%' , borderRadius : '0' } } >
76+ < Typography > { t ( "navbar.survey" ) } </ Typography >
77+ </ Button >
78+ </ Link >
79+ </ Box >
80+ < Box sx = { { display : 'flex' , alignItems : 'center' } } >
8181 < LanguageSelector />
8282 </ Box >
8383 </ Toolbar >
@@ -86,31 +86,31 @@ const NavBar = (): ReactElement => {
8686 < Drawer open = { isDrawerOpen } onClose = { toggleDrawer ( false ) } >
8787 < Box sx = { { width : 250 } } role = "presentation" onClick = { toggleDrawer ( false ) } >
8888 < List >
89- < ListItem >
90- < Link to = "/" style = { { textDecoration : 'none' , height : '100%' , width : '100%' , color : theme . palette . primary . main } } >
91- < ListItemButton sx = { { height : '100%' , color : '#000000' , backgroundColor : isActive ( '/' ) ? '#c1c1c1 ' : 'transparent' } } >
92- < Typography > { t ( "navbar.home" , "Inicio" ) } </ Typography >
89+ < ListItem sx = { { px : 0 } } >
90+ < Link to = "/" style = { { textDecoration : 'none' , width : '100%' } } >
91+ < ListItemButton className = { isActive ( '/' ) ? 'active ' : '' } >
92+ < Typography > { t ( "navbar.home" ) } </ Typography >
9393 </ ListItemButton >
9494 </ Link >
9595 </ ListItem >
96- < ListItem >
97- < Link to = "/sponsorship" style = { { textDecoration : 'none' , height : '100%' , width : '100%' , color : theme . palette . primary . main } } >
98- < ListItemButton sx = { { height : '100%' , color : '#000000' , backgroundColor : isActive ( '/sponsorship' ) ? '#c1c1c1 ' : 'transparent' } } >
99- < Typography > { t ( "navbar.sponsorship" , "¿Te interesa patrocinar?" ) } </ Typography >
96+ < ListItem sx = { { px : 0 } } >
97+ < Link to = "/sponsorship" style = { { textDecoration : 'none' , width : '100%' } } >
98+ < ListItemButton className = { isActive ( '/sponsorship' ) ? 'active ' : '' } >
99+ < Typography > { t ( "navbar.sponsorship" ) } </ Typography >
100100 </ ListItemButton >
101101 </ Link >
102102 </ ListItem >
103- < ListItem >
104- < Link to = "/about" style = { { textDecoration : 'none' , height : '100%' , width : '100%' , color : theme . palette . primary . main } } >
105- < ListItemButton sx = { { height : '100%' , color : '#000000' , backgroundColor : isActive ( '/about' ) ? '#c1c1c1 ' : 'transparent' } } >
106- < Typography > { t ( "navbar.aboutUs" , "Acerca de nosotros" ) } </ Typography >
103+ < ListItem sx = { { px : 0 } } >
104+ < Link to = "/about" style = { { textDecoration : 'none' , width : '100%' } } >
105+ < ListItemButton className = { isActive ( '/about' ) ? 'active ' : '' } >
106+ < Typography > { t ( "navbar.aboutUs" ) } </ Typography >
107107 </ ListItemButton >
108108 </ Link >
109109 </ ListItem >
110- < ListItem >
111- < Link to = "/ " onClick = { openSurvey } style = { { textDecoration : 'none' , height : '100%' , width : '100%' , color : theme . palette . primary . main } } >
112- < ListItemButton sx = { { height : '100%' , color : theme . palette . primary . main } } >
113- < Typography > { t ( "navbar.survey" , "Encuesta" ) } </ Typography >
110+ < ListItem sx = { { px : 0 } } >
111+ < Link to = "# " onClick = { openSurvey } style = { { textDecoration : 'none' , width : '100%' } } >
112+ < ListItemButton sx = { { height : '100%' } } >
113+ < Typography > { t ( "navbar.survey" ) } </ Typography >
114114 </ ListItemButton >
115115 </ Link >
116116 </ ListItem >
0 commit comments