@@ -19,6 +19,7 @@ import {
1919import { uploadPicture , userLogout } from "@app/store/authReducer/actions" ;
2020import { useTheme } from "@mui/material/styles" ;
2121
22+ import { toggleTheme } from "@app/store/authReducer" ;
2223import AppBar from "@mui/material/AppBar" ;
2324import Toolbar from "@mui/material/Toolbar" ;
2425import CustomElevator from "@app/components/Header/CustomElevator" ;
@@ -98,7 +99,7 @@ const AppHeader = ({ viewMode, handleViewModeChange }) => {
9899 const toggleDarkTheme = ( ) => {
99100 const newTheme = darkTheme ? "light" : "dark" ;
100101 setDarkTheme ( newTheme === "dark" ) ;
101- localStorage . setItem ( "theme" , newTheme ) ;
102+ dispatch ( toggleTheme ( newTheme ) ) ;
102103 } ;
103104
104105 const handleOpenNavMenu = ( event ) => {
@@ -152,10 +153,11 @@ const AppHeader = ({ viewMode, handleViewModeChange }) => {
152153 return (
153154 < Box
154155 sx = { {
155- borderBottom : `1px solid ${ theme . palette . divider } ` ,
156+ borderBottom : `1px solid ${ theme . palette . text . primary } ` ,
156157 display : "flex" ,
157158 alignItems : "center" ,
158159 padding : "10px 16px" ,
160+ backgroundColor : theme . palette . background . default ,
159161 } }
160162 >
161163 < Box
@@ -168,7 +170,7 @@ const AppHeader = ({ viewMode, handleViewModeChange }) => {
168170 } }
169171 >
170172 < IconButton onClick = { ( e ) => handleViewModeChange ( e . target . value ) } >
171- < MenuIcon />
173+ < MenuIcon sx = { { color : theme . palette . text . primary } } />
172174 </ IconButton >
173175 < Box
174176 component = "img"
@@ -205,7 +207,7 @@ const AppHeader = ({ viewMode, handleViewModeChange }) => {
205207 sx = { {
206208 position : "relative" ,
207209 width : "100%" ,
208- backgroundColor : theme . palette . background . default ,
210+ color : theme . palette . text . primary ,
209211 } }
210212 >
211213 < InputBase
@@ -218,10 +220,8 @@ const AppHeader = ({ viewMode, handleViewModeChange }) => {
218220 padding : "5px 15px 5px 35px" ,
219221 height : "36px" ,
220222 borderRadius : "4px" ,
221- border : `1px solid ${ theme . palette . divider } ` ,
222- color : theme . palette . text . primary ,
223+ border : `1px solid ${ theme . palette . text . primary } ` ,
223224 fontSize : "12px" ,
224- backgroundColor : theme . palette . background . paper ,
225225 transition : "all 0.3s ease" ,
226226 "&:focus" : {
227227 borderColor : theme . palette . text . primary ,
@@ -249,7 +249,11 @@ const AppHeader = ({ viewMode, handleViewModeChange }) => {
249249 } }
250250 aria-label = "Toggle theme"
251251 >
252- { darkTheme ? < Brightness4Icon /> : < Brightness7Icon /> }
252+ { darkTheme ? (
253+ < Brightness4Icon sx = { { color : theme . palette . text . primary } } />
254+ ) : (
255+ < Brightness7Icon sx = { { color : theme . palette . text . primary } } />
256+ ) }
253257 </ IconButton >
254258 < IconButton color = "primary" onClick = { handleRefreshClick } >
255259 < RefreshIcon />
@@ -322,7 +326,14 @@ const AppHeader = ({ viewMode, handleViewModeChange }) => {
322326 horizontal : "right" ,
323327 } }
324328 >
325- < Box p = { { xs : 2 , md : 3 } } >
329+ < Box
330+ p = { {
331+ xs : 2 ,
332+ md : 3 ,
333+ color : theme . palette . text . primary ,
334+ backgroundColor : theme . palette . background . paper ,
335+ } }
336+ >
326337 < Box className = "user-root" >
327338 < input { ...getInputProps ( ) } />
328339 < IconButton className = "icon-btn-root" { ...getRootProps ( ) } >
@@ -339,13 +350,23 @@ const AppHeader = ({ viewMode, handleViewModeChange }) => {
339350 className = "user-title"
340351 component = "h3"
341352 variant = "h6"
342- sx = { { color : "#fff" } }
353+ sx = { {
354+ color : theme . palette . text . primary ,
355+ backgroundColor : theme . palette . background . paper ,
356+ } }
343357 >
344- { currentAuthUser ?. first_name
345- ? currentAuthUser ?. first_name
358+ { currentAuthUser ?. full_name
359+ ? currentAuthUser ?. full_name
346360 : "" }
347361 </ Typography >
348- < Typography className = "user-sub-title" component = "span" >
362+ < Typography
363+ className = "user-sub-title"
364+ component = "span"
365+ sx = { {
366+ color : theme . palette . text . primary ,
367+ backgroundColor : theme . palette . background . paper ,
368+ } }
369+ >
349370 { currentAuthUser ?. bio
350371 ? currentAuthUser ?. bio . substring ( 0 , 30 ) + "..."
351372 : "" }
0 commit comments