@@ -19,6 +19,7 @@ import {
19
19
import { uploadPicture , userLogout } from "@app/store/authReducer/actions" ;
20
20
import { useTheme } from "@mui/material/styles" ;
21
21
22
+ import { toggleTheme } from "@app/store/authReducer" ;
22
23
import AppBar from "@mui/material/AppBar" ;
23
24
import Toolbar from "@mui/material/Toolbar" ;
24
25
import CustomElevator from "@app/components/Header/CustomElevator" ;
@@ -98,7 +99,7 @@ const AppHeader = ({ viewMode, handleViewModeChange }) => {
98
99
const toggleDarkTheme = ( ) => {
99
100
const newTheme = darkTheme ? "light" : "dark" ;
100
101
setDarkTheme ( newTheme === "dark" ) ;
101
- localStorage . setItem ( "theme" , newTheme ) ;
102
+ dispatch ( toggleTheme ( newTheme ) ) ;
102
103
} ;
103
104
104
105
const handleOpenNavMenu = ( event ) => {
@@ -152,10 +153,11 @@ const AppHeader = ({ viewMode, handleViewModeChange }) => {
152
153
return (
153
154
< Box
154
155
sx = { {
155
- borderBottom : `1px solid ${ theme . palette . divider } ` ,
156
+ borderBottom : `1px solid ${ theme . palette . text . primary } ` ,
156
157
display : "flex" ,
157
158
alignItems : "center" ,
158
159
padding : "10px 16px" ,
160
+ backgroundColor : theme . palette . background . default ,
159
161
} }
160
162
>
161
163
< Box
@@ -168,7 +170,7 @@ const AppHeader = ({ viewMode, handleViewModeChange }) => {
168
170
} }
169
171
>
170
172
< IconButton onClick = { ( e ) => handleViewModeChange ( e . target . value ) } >
171
- < MenuIcon />
173
+ < MenuIcon sx = { { color : theme . palette . text . primary } } />
172
174
</ IconButton >
173
175
< Box
174
176
component = "img"
@@ -205,7 +207,7 @@ const AppHeader = ({ viewMode, handleViewModeChange }) => {
205
207
sx = { {
206
208
position : "relative" ,
207
209
width : "100%" ,
208
- backgroundColor : theme . palette . background . default ,
210
+ color : theme . palette . text . primary ,
209
211
} }
210
212
>
211
213
< InputBase
@@ -218,10 +220,8 @@ const AppHeader = ({ viewMode, handleViewModeChange }) => {
218
220
padding : "5px 15px 5px 35px" ,
219
221
height : "36px" ,
220
222
borderRadius : "4px" ,
221
- border : `1px solid ${ theme . palette . divider } ` ,
222
- color : theme . palette . text . primary ,
223
+ border : `1px solid ${ theme . palette . text . primary } ` ,
223
224
fontSize : "12px" ,
224
- backgroundColor : theme . palette . background . paper ,
225
225
transition : "all 0.3s ease" ,
226
226
"&:focus" : {
227
227
borderColor : theme . palette . text . primary ,
@@ -249,7 +249,11 @@ const AppHeader = ({ viewMode, handleViewModeChange }) => {
249
249
} }
250
250
aria-label = "Toggle theme"
251
251
>
252
- { darkTheme ? < Brightness4Icon /> : < Brightness7Icon /> }
252
+ { darkTheme ? (
253
+ < Brightness4Icon sx = { { color : theme . palette . text . primary } } />
254
+ ) : (
255
+ < Brightness7Icon sx = { { color : theme . palette . text . primary } } />
256
+ ) }
253
257
</ IconButton >
254
258
< IconButton color = "primary" onClick = { handleRefreshClick } >
255
259
< RefreshIcon />
@@ -322,7 +326,14 @@ const AppHeader = ({ viewMode, handleViewModeChange }) => {
322
326
horizontal : "right" ,
323
327
} }
324
328
>
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
+ >
326
337
< Box className = "user-root" >
327
338
< input { ...getInputProps ( ) } />
328
339
< IconButton className = "icon-btn-root" { ...getRootProps ( ) } >
@@ -339,13 +350,23 @@ const AppHeader = ({ viewMode, handleViewModeChange }) => {
339
350
className = "user-title"
340
351
component = "h3"
341
352
variant = "h6"
342
- sx = { { color : "#fff" } }
353
+ sx = { {
354
+ color : theme . palette . text . primary ,
355
+ backgroundColor : theme . palette . background . paper ,
356
+ } }
343
357
>
344
- { currentAuthUser ?. first_name
345
- ? currentAuthUser ?. first_name
358
+ { currentAuthUser ?. full_name
359
+ ? currentAuthUser ?. full_name
346
360
: "" }
347
361
</ 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
+ >
349
370
{ currentAuthUser ?. bio
350
371
? currentAuthUser ?. bio . substring ( 0 , 30 ) + "..."
351
372
: "" }
0 commit comments