NotFoundBlock.jsx 2.1 KB

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