NotFoundBlock.jsx 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import {Box, Container, Typography, useMediaQuery} from "@mui/material";
  2. import imgUrl from "../img/not-found/1.png";
  3. export const NotFoundBlock = ({img=imgUrl,
  4. headerText='OOPS! THAT PAGE CAN’T BE FOUND',
  5. text='The page you are trying to reach is not available.',
  6. marginTop='0px'}) => {
  7. const matches = useMediaQuery('(max-width:899px)');
  8. const matches2 = useMediaQuery('(max-width:450px)');
  9. return (
  10. <main
  11. style={{
  12. backgroundColor: "#f3f3f3",
  13. padding: matches ? "20px 0" : "50px 0",
  14. marginTop: marginTop
  15. }}
  16. >
  17. <Container maxWidth="lg">
  18. <Box sx={{
  19. backgroundColor: "#fff",
  20. height: matches2 ? "250px" : "350px",
  21. display: "flex",
  22. flexDirection: "column",
  23. justifyContent: "center",
  24. alignItems: "center"
  25. }}>
  26. <img
  27. style={{
  28. maxWidth: matches2 ? "100px" : "150px"
  29. }}
  30. src={ img }
  31. alt={ headerText }
  32. />
  33. <Typography
  34. variant={matches2 ? "h6" : "h5"}
  35. fontFamily="sarif"
  36. fontWeight="300"
  37. marginBottom="20px"
  38. marginTop="20px"
  39. textAlign="center"
  40. sx={{textTransform: 'uppercase'}}
  41. >
  42. { headerText }
  43. </Typography>
  44. <Typography
  45. variant={matches2 ? "body1" : "h7"}
  46. textAlign="center"
  47. fontWeight="300"
  48. >
  49. { text }
  50. </Typography>
  51. </Box>
  52. </Container>
  53. </main>
  54. )
  55. }