Merge pull request #415 from MuhammadKhalilzadeh/errors-page

Error page implemented
This commit is contained in:
Alexander Holliday authored and GitHub committed 2024-07-24 09:48:19 -07:00
commit 9a7b21abd8
2 files changed
+66 -9

No files matched your search

+15 -1
View File
@@ -1 +1,15 @@
/*Notfoundpage styles*/
.not-found-page {
height: 100vh;
}
.not-found-page button,
.not-found-page p {
font-size: var(--env-var-font-size-medium);
}
.not-found-page h1 {
font-size: var(--env-var-font-size-large);
font-weight: 600;
}
.not-found-page h1,
.not-found-page p {
color: var(--env-var-color-5);
}
+51 -8
View File
@@ -1,10 +1,53 @@
import React from 'react'
import './index.css'
import Button from "../../Components/Button";
import "./index.css";
import React from "react";
import PropTypes from "prop-types";
import { Stack, Typography } from "@mui/material";
const NotFound = () => {
return (
<div>NotFoundPage</div>
)
}
/**
* Support for defaultProps will be removed from function components in a future major release
* So That why we're using JavaScript default parameters instead.
*/
const DefaultValue = {
title: "We cannot find this page",
desc: "Either the URL doesn’t exist, or you don’t have access to it.",
};
export default NotFound
/**
* Renders an error page component with a customizable title and description.
*
* @component
* @example
* // Usage:
* <ErrorPage
* title="Page Not Found"
* desc="The requested page could not be found."
* />
*
* @param {Object} props - The component props.
* @param {string} [props.title="We cannot find this page"] - The title of the error page.
* @param {string} [props.desc="Either the URL doesn’t exist, or you don’t have access to it."] - The description of the error page.
* @returns {JSX.Element} The rendered error page component.
*/
const NotFound = ({ title = DefaultValue.title, desc = DefaultValue.desc }) => {
return (
<Stack className="not-found-page" justifyContent="center">
<Stack gap="20px" alignItems="center">
<Typography component="h1">{title}</Typography>
<Typography>{desc}</Typography>
<Button
label="Go to the main dashboard"
level="primary"
sx={{ mt: "24px" }}
/>
</Stack>
</Stack>
);
};
NotFound.propTypes = {
title: PropTypes.string,
desc: PropTypes.string,
};
export default NotFound;