@@ -15,6 +15,8 @@ import DarkModeLightModeButton from "../components/MainPage/DarkModeLightModeBut
1515import MainMenuSideBar from "../components/MainMenu/MainMenuSideBar" ;
1616import logo_text_blue from "../static/files-ui-logo-text-med.png" ;
1717import logo_text_blue_dark from "../static/files-ui-logo-text-med-dark.png" ;
18+ import { UserContext } from "../globals/contexts/UserContext" ;
19+ import AnchorToTab from "../components/util-components/AnchorToTab" ;
1820
1921const drawerWidth = 280 ;
2022const StyledImage = styled ( "img" ) ( ( { theme } ) => ( {
@@ -27,23 +29,34 @@ const StyledImage = styled("img")(({ theme }) => ({
2729 } ,
2830} ) ) ;
2931function NavBarTemplate ( props ) {
32+ const [ usuario , dispatch ] = React . useContext ( UserContext ) ;
33+ const darkModeOn = usuario . darkMode ;
3034 //const navigate = useNavigateToTop();
31- const { window, children, darkModeOn, handleDarkMode, selectedIndex } = props ;
35+ const {
36+ window,
37+ children,
38+ /* darkModeOn, */ /* handleDarkMode, */ selectedIndex,
39+ } = props ;
3240 const [ mobileOpen , setMobileOpen ] = React . useState ( false ) ;
3341
3442 //const [selectedIndex, setSelectedIndex] = React.useState(0);
43+ const handleDarkMode = ( ) => {
44+ // setDarkModeOn((darkModeOn) => !darkModeOn);
45+ if ( ! darkModeOn ) dispatch ( { type : "TURNOFFLIGHT" } ) ;
46+ else dispatch ( { type : "TURNONLIGHT" } ) ;
47+ } ;
3548
3649 const handleGoGitRepo = ( ) => {
50+ alert ( "HAAA" ) ;
3751 window . open ( "https://github.com/files-ui" , "_blank" ) ;
3852 } ;
53+
3954 const handleDrawerToggle = ( ) => {
4055 setMobileOpen ( ! mobileOpen ) ;
4156 } ;
4257
4358 const drawer = (
44- < div
45-
46- >
59+ < div >
4760 < Toolbar >
4861 < a href = "/" style = { { textDecoration : "none" } } >
4962 < Stack
@@ -90,7 +103,7 @@ function NavBarTemplate(props) {
90103 < Box sx = { { display : "flex" , flexDirection : { xs : "column" , sm : "row" } } } >
91104 < CssBaseline />
92105 < AppBar
93- className = "section-container"
106+ className = "section-container"
94107 position = "fixed"
95108 sx = { {
96109 width : { sm : `calc(100% - ${ drawerWidth } px)` } ,
@@ -126,17 +139,19 @@ function NavBarTemplate(props) {
126139 </ Typography >
127140 < Box style = { { flexGrow : 1 } } />
128141 < Stack direction = "row" spacing = { 1 } >
129- < Tooltip title = "Go to Files-ui GitHub repo" >
130- < IconButton
131- style = { { borderRadius : "8px" , border : "0.5px solid #eaeef3" } }
132- onClick = { handleGoGitRepo }
133- color = "secondary"
134- aria-label = "upload picture"
135- component = "label"
136- >
137- < GitHubIcon /* htmlColor="white" */ />
138- </ IconButton >
139- </ Tooltip >
142+ < AnchorToTab href = "https://github.com/files-ui" >
143+ < Tooltip title = "Go to Files-ui GitHub repo" >
144+ < IconButton
145+ style = { { borderRadius : "8px" , border : "0.5px solid #eaeef3" } }
146+ //onClick={handleGoGitRepo}
147+ color = "secondary"
148+ aria-label = "upload picture"
149+ component = "label"
150+ >
151+ < GitHubIcon /* htmlColor="white" */ />
152+ </ IconButton >
153+ </ Tooltip >
154+ </ AnchorToTab >
140155 < DarkModeLightModeButton
141156 darkModeOn = { darkModeOn }
142157 onChangeDarkMode = { handleDarkMode }
0 commit comments