25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

59 satır
1.5 KiB

  1. // import { useState } from 'react';
  2. // material-ui
  3. import {
  4. Grid,
  5. Typography,
  6. Stack
  7. } from '@mui/material';
  8. import * as React from "react";
  9. import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
  10. // ==============================|| DASHBOARD - DEFAULT ||============================== //
  11. const DashboardDefault = () => {
  12. const userData = JSON.parse(localStorage.getItem("userData"));
  13. React.useEffect(() => {
  14. localStorage.setItem('searchCriteria',"")
  15. }, [])
  16. const BackgroundHead = {
  17. backgroundImage: `url(${titleBackgroundImg})`,
  18. width: '100%',
  19. height: '100%',
  20. backgroundSize:'contain',
  21. backgroundRepeat: 'no-repeat',
  22. backgroundColor: '#0C489E',
  23. backgroundPosition: 'right'
  24. }
  25. const getWelcomeMsg=()=>{
  26. var current = new Date()
  27. var curHr = current.getHours()
  28. if (curHr < 12) {
  29. return "Good Morning"
  30. } else if (curHr < 18) {
  31. return "Good Afternoon"
  32. } else {
  33. //evening
  34. return "Good Evening"
  35. }
  36. }
  37. return (
  38. <Grid container sx={{minHeight: '87vh', backgroundColor: "backgroundColor.default"}} direction="column">
  39. <Grid item xs={12}>
  40. <div style={BackgroundHead}>
  41. <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">
  42. <Typography ml={15} color='#FFF' variant="h4" sx={{ "textShadow": "0px 0px 25px #0c489e" }}>
  43. {getWelcomeMsg()}, {userData.fullenName}
  44. </Typography>
  45. </Stack>
  46. </div>
  47. </Grid>
  48. </Grid>
  49. );
  50. };
  51. export default DashboardDefault;