From 1e5c0f05fb5693a7bbdde0d78ae317a606e46bd8 Mon Sep 17 00:00:00 2001 From: MuhammadKhalilzadeh Date: Mon, 22 Jul 2024 22:51:15 +0330 Subject: [PATCH 1/7] Error page implemented --- Client/src/App.jsx | 2 + Client/src/Pages/Errors/index.css | 40 ++++++++++++++++++++ Client/src/Pages/Errors/index.jsx | 63 +++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 Client/src/Pages/Errors/index.css create mode 100644 Client/src/Pages/Errors/index.jsx diff --git a/Client/src/App.jsx b/Client/src/App.jsx index 0482aec5d..4d0b7a7ae 100644 --- a/Client/src/App.jsx +++ b/Client/src/App.jsx @@ -20,6 +20,7 @@ import Details from "./Pages/Monitors/Details"; import Maintenance from "./Pages/Maintenance"; import "react-toastify/dist/ReactToastify.css"; import { ToastContainer } from "react-toastify"; +import ErrorPage from "./Pages/Errors"; function App() { return ( @@ -89,6 +90,7 @@ function App() { path="/new-password-confirmed" element={} /> + } /> diff --git a/Client/src/Pages/Errors/index.css b/Client/src/Pages/Errors/index.css new file mode 100644 index 000000000..fef0d001d --- /dev/null +++ b/Client/src/Pages/Errors/index.css @@ -0,0 +1,40 @@ +.error-page, +.error-template, +.error-title, +.error-description { + justify-content: center; + align-items: center; +} + +.error-page { + display: flex; + min-height: 100vh; +} + +.error-template { + min-height: 170px; +} + +.error-title, +.error-description { + text-align: center; +} + +.error-title { + font-size: var(--env-var-font-size-large); + color: var(--env-var-color-5); + font-weight: 600; +} + +.error-description { + font-size: var(--env-var-font-size-medium); + font-weight: 500; +} + +.error-page-gap-medium { + height: var(--env-var-spacing-2); +} + +.error-page-gap-xlarge { + height: calc(var(--env-var-spacing-4) + var(--env-var-spacing-2)); +} diff --git a/Client/src/Pages/Errors/index.jsx b/Client/src/Pages/Errors/index.jsx new file mode 100644 index 000000000..afaadfe4a --- /dev/null +++ b/Client/src/Pages/Errors/index.jsx @@ -0,0 +1,63 @@ +import Button from "../../Components/Button"; +import "./index.css"; +import React from "react"; +import PropTypes from "prop-types"; + +/** + * 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.", +}; + +/** + * Renders an error page component with a customizable title and description. + * + * @component + * @example + * // Usage: + * + * + * @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 ErrorPage = ({ + title = DefaultValue.title, + desc = DefaultValue.desc, +}) => { + return ( +
+
+
{title}
+
+
{desc}
+
+
+
+
+
+ ); +}; + +ErrorPage.propTypes = { + title: PropTypes.string, + desc: PropTypes.string, +}; + +export default ErrorPage; From 8b5c9461d577657160ae0210918008851c4e002d Mon Sep 17 00:00:00 2001 From: MuhammadKhalilzadeh Date: Mon, 22 Jul 2024 22:55:23 +0330 Subject: [PATCH 2/7] fixing conflicts --- Client/src/App.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Client/src/App.jsx b/Client/src/App.jsx index 4d0b7a7ae..4bb99022f 100644 --- a/Client/src/App.jsx +++ b/Client/src/App.jsx @@ -18,8 +18,9 @@ import NewPasswordConfirmed from "./Pages/Auth/NewPasswordConfirmed"; import ProtectedRoute from "./Components/ProtectedRoute"; import Details from "./Pages/Monitors/Details"; import Maintenance from "./Pages/Maintenance"; -import "react-toastify/dist/ReactToastify.css"; -import { ToastContainer } from "react-toastify"; +import withAdminCheck from "./HOC/withAdminCheck"; +import Configure from "./Pages/Monitors/Configure"; + import ErrorPage from "./Pages/Errors"; function App() { From e4b441dffa83148f5507dcc3dffa526ffb27ad0a Mon Sep 17 00:00:00 2001 From: MuhammadKhalilzadeh Date: Mon, 22 Jul 2024 22:56:31 +0330 Subject: [PATCH 3/7] fixing conflicts --- Client/src/App.jsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/Client/src/App.jsx b/Client/src/App.jsx index 4bb99022f..8f170e8c5 100644 --- a/Client/src/App.jsx +++ b/Client/src/App.jsx @@ -21,8 +21,6 @@ import Maintenance from "./Pages/Maintenance"; import withAdminCheck from "./HOC/withAdminCheck"; import Configure from "./Pages/Monitors/Configure"; -import ErrorPage from "./Pages/Errors"; - function App() { return ( <> @@ -91,7 +89,6 @@ function App() { path="/new-password-confirmed" element={} /> - } /> From f3905fee51ade10929025602ae4147bd49b9a86d Mon Sep 17 00:00:00 2001 From: MuhammadKhalilzadeh Date: Tue, 23 Jul 2024 00:09:03 +0330 Subject: [PATCH 4/7] fixing conflicts --- Client/src/App.jsx | 7 ++-- Client/src/Pages/Errors/index.css | 40 ------------------ Client/src/Pages/Errors/index.jsx | 63 ---------------------------- Client/src/Pages/NotFound/index.css | 36 +++++++++++++++- Client/src/Pages/NotFound/index.jsx | 65 +++++++++++++++++++++++++---- 5 files changed, 96 insertions(+), 115 deletions(-) delete mode 100644 Client/src/Pages/Errors/index.css delete mode 100644 Client/src/Pages/Errors/index.jsx diff --git a/Client/src/App.jsx b/Client/src/App.jsx index 8f170e8c5..2015793d7 100644 --- a/Client/src/App.jsx +++ b/Client/src/App.jsx @@ -18,8 +18,8 @@ import NewPasswordConfirmed from "./Pages/Auth/NewPasswordConfirmed"; import ProtectedRoute from "./Components/ProtectedRoute"; import Details from "./Pages/Monitors/Details"; import Maintenance from "./Pages/Maintenance"; -import withAdminCheck from "./HOC/withAdminCheck"; -import Configure from "./Pages/Monitors/Configure"; +import "react-toastify/dist/ReactToastify.css"; +import { ToastContainer } from "react-toastify"; function App() { return ( @@ -81,7 +81,8 @@ function App() { } /> } /> {/* } /> */} - } /> + {/* } /> */} + } /> } /> } /> } /> diff --git a/Client/src/Pages/Errors/index.css b/Client/src/Pages/Errors/index.css deleted file mode 100644 index fef0d001d..000000000 --- a/Client/src/Pages/Errors/index.css +++ /dev/null @@ -1,40 +0,0 @@ -.error-page, -.error-template, -.error-title, -.error-description { - justify-content: center; - align-items: center; -} - -.error-page { - display: flex; - min-height: 100vh; -} - -.error-template { - min-height: 170px; -} - -.error-title, -.error-description { - text-align: center; -} - -.error-title { - font-size: var(--env-var-font-size-large); - color: var(--env-var-color-5); - font-weight: 600; -} - -.error-description { - font-size: var(--env-var-font-size-medium); - font-weight: 500; -} - -.error-page-gap-medium { - height: var(--env-var-spacing-2); -} - -.error-page-gap-xlarge { - height: calc(var(--env-var-spacing-4) + var(--env-var-spacing-2)); -} diff --git a/Client/src/Pages/Errors/index.jsx b/Client/src/Pages/Errors/index.jsx deleted file mode 100644 index afaadfe4a..000000000 --- a/Client/src/Pages/Errors/index.jsx +++ /dev/null @@ -1,63 +0,0 @@ -import Button from "../../Components/Button"; -import "./index.css"; -import React from "react"; -import PropTypes from "prop-types"; - -/** - * 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.", -}; - -/** - * Renders an error page component with a customizable title and description. - * - * @component - * @example - * // Usage: - * - * - * @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 ErrorPage = ({ - title = DefaultValue.title, - desc = DefaultValue.desc, -}) => { - return ( -
-
-
{title}
-
-
{desc}
-
-
-
-
-
- ); -}; - -ErrorPage.propTypes = { - title: PropTypes.string, - desc: PropTypes.string, -}; - -export default ErrorPage; diff --git a/Client/src/Pages/NotFound/index.css b/Client/src/Pages/NotFound/index.css index 937c1ee8d..2863581d6 100644 --- a/Client/src/Pages/NotFound/index.css +++ b/Client/src/Pages/NotFound/index.css @@ -1 +1,35 @@ -/*Notfoundpage styles*/ \ No newline at end of file +/*Notfoundpage styles*/ +.not-found-page, +.not-found-template, +#not-found-title, +#not-found-description { + justify-content: center; + align-items: center; +} + +.not-found-page { + display: flex; + min-height: 100vh; +} + +.not-found-template { + min-height: 170px; +} + +#not-found-title, +#not-found-description { + text-align: center; +} + +#not-found-title { + font-size: var(--env-var-font-size-large); + color: var(--env-var-color-5); + font-weight: 600; + margin-bottom: var(--env-var-spacing-2); +} + +#not-found-description { + font-size: var(--env-var-font-size-medium); + font-weight: 500; + margin-bottom: calc(var(--env-var-spacing-4) + var(--env-var-spacing-2)); +} diff --git a/Client/src/Pages/NotFound/index.jsx b/Client/src/Pages/NotFound/index.jsx index 02138b326..5a55ad5ce 100644 --- a/Client/src/Pages/NotFound/index.jsx +++ b/Client/src/Pages/NotFound/index.jsx @@ -1,10 +1,59 @@ -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 { Typography } from "@mui/material"; -const NotFound = () => { - return ( -
NotFoundPage
- ) -} +/** + * 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 \ No newline at end of file +/** + * Renders an error page component with a customizable title and description. + * + * @component + * @example + * // Usage: + * + * + * @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 ( +
+
+ {title} + {desc} +
+
+
+
+ ); +}; + +NotFound.propTypes = { + title: PropTypes.string, + desc: PropTypes.string, +}; + +export default NotFound; From 6ff5fe2a364ad62ca3c5ef3c05c54e0b6dd9ea8a Mon Sep 17 00:00:00 2001 From: MuhammadKhalilzadeh Date: Tue, 23 Jul 2024 00:12:49 +0330 Subject: [PATCH 5/7] fixing conflicts --- Client/src/App.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Client/src/App.jsx b/Client/src/App.jsx index 2015793d7..0482aec5d 100644 --- a/Client/src/App.jsx +++ b/Client/src/App.jsx @@ -81,8 +81,7 @@ function App() { } /> } /> {/* } /> */} - {/* } /> */} - } /> + } /> } /> } /> } /> From 14bbb241b9ccfe092fdbfcd63aa66619fa18061b Mon Sep 17 00:00:00 2001 From: MuhammadKhalilzadeh Date: Tue, 23 Jul 2024 09:12:11 +0330 Subject: [PATCH 6/7] fixing bugs --- Client/src/Pages/NotFound/index.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Client/src/Pages/NotFound/index.jsx b/Client/src/Pages/NotFound/index.jsx index 5a55ad5ce..44947d60a 100644 --- a/Client/src/Pages/NotFound/index.jsx +++ b/Client/src/Pages/NotFound/index.jsx @@ -2,7 +2,7 @@ import Button from "../../Components/Button"; import "./index.css"; import React from "react"; import PropTypes from "prop-types"; -import { Typography } from "@mui/material"; +import { Stack, Typography } from "@mui/material"; /** * Support for defaultProps will be removed from function components in a future major release @@ -31,8 +31,8 @@ const DefaultValue = { */ const NotFound = ({ title = DefaultValue.title, desc = DefaultValue.desc }) => { return ( -
-
+ + {title} {desc}
{ sx={{ fontSize: "var(--env-var-font-size-medium)" }} />
-
-
+ + ); }; From 9159d8cf5f76d3500d5a274c147934727a1ad152 Mon Sep 17 00:00:00 2001 From: Mohammad Khalilzadeh Date: Wed, 24 Jul 2024 09:29:15 +0330 Subject: [PATCH 7/7] new changes --- Client/src/Pages/NotFound/index.css | 42 ++++++++--------------------- Client/src/Pages/NotFound/index.jsx | 24 +++++++---------- 2 files changed, 20 insertions(+), 46 deletions(-) diff --git a/Client/src/Pages/NotFound/index.css b/Client/src/Pages/NotFound/index.css index 2863581d6..621172386 100644 --- a/Client/src/Pages/NotFound/index.css +++ b/Client/src/Pages/NotFound/index.css @@ -1,35 +1,15 @@ -/*Notfoundpage styles*/ -.not-found-page, -.not-found-template, -#not-found-title, -#not-found-description { - justify-content: center; - align-items: center; -} - .not-found-page { - display: flex; - min-height: 100vh; + height: 100vh; } - -.not-found-template { - min-height: 170px; -} - -#not-found-title, -#not-found-description { - text-align: center; -} - -#not-found-title { - font-size: var(--env-var-font-size-large); - color: var(--env-var-color-5); - font-weight: 600; - margin-bottom: var(--env-var-spacing-2); -} - -#not-found-description { +.not-found-page button, +.not-found-page p { font-size: var(--env-var-font-size-medium); - font-weight: 500; - margin-bottom: calc(var(--env-var-spacing-4) + var(--env-var-spacing-2)); +} +.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); } diff --git a/Client/src/Pages/NotFound/index.jsx b/Client/src/Pages/NotFound/index.jsx index 44947d60a..1b2accbc0 100644 --- a/Client/src/Pages/NotFound/index.jsx +++ b/Client/src/Pages/NotFound/index.jsx @@ -31,21 +31,15 @@ const DefaultValue = { */ const NotFound = ({ title = DefaultValue.title, desc = DefaultValue.desc }) => { return ( - - - {title} - {desc} -
-
+ + + {title} + {desc} +