@@ -20,15 +20,13 @@ import {
20
20
import { LanguageSelector } from './LanguageSelector'
21
21
import { ReactElement } from 'react'
22
22
import MenuIcon from '@mui/icons-material/Menu'
23
- import { useTheme } from '@mui/material/styles'
24
23
import logo from './assets/images/logo.png'
25
24
26
25
const NavBar = ( ) : ReactElement => {
27
26
const [ isDrawerOpen , setIsDrawerOpen ] = useState < boolean > ( false )
28
27
const location = useLocation ( )
29
28
const { openSurvey } = useSurvey ( )
30
29
const { t } = useTranslation ( )
31
- const theme = useTheme ( )
32
30
33
31
const toggleDrawer = ( newOpen : boolean ) => ( ) => {
34
32
setIsDrawerOpen ( newOpen )
@@ -49,35 +47,37 @@ const NavBar = (): ReactElement => {
49
47
< >
50
48
< AppBar position = "sticky" color = "default" >
51
49
< 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' } } >
81
81
< LanguageSelector />
82
82
</ Box >
83
83
</ Toolbar >
@@ -86,31 +86,31 @@ const NavBar = (): ReactElement => {
86
86
< Drawer open = { isDrawerOpen } onClose = { toggleDrawer ( false ) } >
87
87
< Box sx = { { width : 250 } } role = "presentation" onClick = { toggleDrawer ( false ) } >
88
88
< 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 >
93
93
</ ListItemButton >
94
94
</ Link >
95
95
</ 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 >
100
100
</ ListItemButton >
101
101
</ Link >
102
102
</ 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 >
107
107
</ ListItemButton >
108
108
</ Link >
109
109
</ 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 >
114
114
</ ListItemButton >
115
115
</ Link >
116
116
</ ListItem >
0 commit comments