Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

113 lignes
3.3KB

  1. import MenuIcon from "@mui/icons-material/Menu";
  2. import { Box } from "@mui/material";
  3. import AppBar from "@mui/material/AppBar";
  4. import Grid from "@mui/material/Grid";
  5. import IconButton from "@mui/material/IconButton";
  6. import Toolbar from "@mui/material/Toolbar";
  7. import Typography from "@mui/material/Typography";
  8. import useDashboard from "hooks/useDashBoard";
  9. import * as React from "react";
  10. interface HeaderProps {
  11. onDrawerToggle: () => void;
  12. }
  13. export default function Header(props: HeaderProps) {
  14. const { onDrawerToggle } = props;
  15. const { contentsWidth, headerTitle, tabs } = useDashboard();
  16. return (
  17. <React.Fragment>
  18. <AppBar color="primary" position="sticky" elevation={0}>
  19. <Toolbar>
  20. <Grid container spacing={1} alignItems="center">
  21. <Grid sx={{ display: { sm: "none", xs: "block" } }} item>
  22. <IconButton
  23. color="inherit"
  24. aria-label="open drawer"
  25. onClick={onDrawerToggle}
  26. edge="start"
  27. >
  28. <MenuIcon />
  29. </IconButton>
  30. </Grid>
  31. {/* <Grid item xs /> */}
  32. {/* <Grid item>
  33. <Link
  34. href="/"
  35. variant="body2"
  36. sx={{
  37. textDecoration: "none",
  38. color: lightColor,
  39. "&:hover": {
  40. color: "common.white",
  41. },
  42. }}
  43. rel="noopener noreferrer"
  44. target="_blank"
  45. >
  46. Go to docs
  47. </Link>
  48. </Grid> */}
  49. {/* <Grid item>
  50. <Tooltip title="Alerts • No alerts">
  51. <IconButton color="inherit">
  52. <NotificationsIcon />
  53. </IconButton>
  54. </Tooltip>
  55. </Grid> */}
  56. {/* <Grid item>
  57. <IconButton color="inherit" sx={{ p: 0.5 }}>
  58. <Avatar src="/static/images/avatar/1.jpg" alt="My Avatar" />
  59. </IconButton>
  60. </Grid> */}
  61. </Grid>
  62. </Toolbar>
  63. </AppBar>
  64. <AppBar
  65. component="div"
  66. color="primary"
  67. position="static"
  68. elevation={0}
  69. sx={{ zIndex: 0 }}
  70. >
  71. <Toolbar>
  72. <Grid container alignItems="center" spacing={1}>
  73. <Grid item xs>
  74. <Typography color="inherit" variant="h5" component="h1">
  75. {headerTitle}
  76. </Typography>
  77. </Grid>
  78. {/* <Grid item>
  79. <Button
  80. sx={{ borderColor: lightColor }}
  81. variant="outlined"
  82. color="inherit"
  83. size="small"
  84. >
  85. Web setup
  86. </Button>
  87. </Grid>
  88. <Grid item>
  89. <Tooltip title="Help">
  90. <IconButton color="inherit">
  91. <HelpIcon />
  92. </IconButton>
  93. </Tooltip>
  94. </Grid> */}
  95. </Grid>
  96. </Toolbar>
  97. </AppBar>
  98. <AppBar
  99. component="div"
  100. position="static"
  101. elevation={0}
  102. sx={{ zIndex: 0 }}
  103. >
  104. {!!tabs && <Box sx={{ maxWidth: contentsWidth }}>{tabs}</Box>}
  105. </AppBar>
  106. </React.Fragment>
  107. );
  108. }