@@ -11,6 +11,7 @@ import {
1111} from "@mui/material" ;
1212import SettingsIcon from "@mui/icons-material/Settings" ;
1313import SearchIcon from "@mui/icons-material/Search" ;
14+ import RefreshIcon from "@mui/icons-material/Refresh" ;
1415import {
1516 setFilterType ,
1617 toggleSidebarCollapsed ,
@@ -43,7 +44,7 @@ import Fab from "@mui/material/Fab";
4344import Brightness4Icon from "@mui/icons-material/Brightness4" ;
4445import Brightness7Icon from "@mui/icons-material/Brightness7" ;
4546import MenuIcon from "@mui/icons-material/Menu" ;
46-
47+ import { getMailsList } from "@app/store/mailAppReducer/actions" ;
4748const sections = [ "Banner" , "Features" , "Services" , "Team" , "Faq" ] ;
4849const settings = [ "View Profile" , "Edit Profile" , "Log out" ] ;
4950
@@ -62,13 +63,20 @@ const AppHeader = ({ viewMode, handleViewModeChange }) => {
6263 const [ showViewModes , setShowViewModes ] = useState ( null ) ;
6364 const [ searchTextState , setSearchTextState ] = useState ( searchText ) ;
6465
66+ const dispatch = useDispatch ( ) ;
67+ const navigate = useNavigate ( ) ;
68+ const theme = useTheme ( ) ;
69+
6570 const onShowViewModes = ( event ) => {
6671 setShowViewModes ( event . currentTarget ) ;
6772 } ;
6873
6974 const onHideViewModes = ( ) => {
7075 setShowViewModes ( null ) ;
7176 } ;
77+ const handleRefreshClick = ( ) => {
78+ dispatch ( getMailsList ( ) ) ;
79+ } ;
7280
7381 const handleSearchText = ( e ) => {
7482 setSearchTextState ( e . target . value ) ;
@@ -93,10 +101,6 @@ const AppHeader = ({ viewMode, handleViewModeChange }) => {
93101 localStorage . setItem ( "theme" , newTheme ) ;
94102 } ;
95103
96- const dispatch = useDispatch ( ) ;
97- const navigate = useNavigate ( ) ;
98- const theme = useTheme ( ) ;
99-
100104 const handleOpenNavMenu = ( event ) => {
101105 setAnchorElNav ( event . currentTarget ) ;
102106 } ;
@@ -247,6 +251,9 @@ const AppHeader = ({ viewMode, handleViewModeChange }) => {
247251 >
248252 { darkTheme ? < Brightness4Icon /> : < Brightness7Icon /> }
249253 </ IconButton >
254+ < IconButton color = "primary" onClick = { handleRefreshClick } >
255+ < RefreshIcon />
256+ </ IconButton >
250257 < Box sx = { { flexGrow : 0 } } >
251258 < Tooltip title = "Open settings" >
252259 < IconButton onClick = { handleOpenUserMenu } sx = { { ml : 7 } } >
0 commit comments