diff --git a/packages/frontend-v2/components/Error/ErrorBoundary.tsx b/packages/frontend-v2/components/Error/ErrorBoundary.tsx index 6bd5b2723..2436b2cc6 100644 --- a/packages/frontend-v2/components/Error/ErrorBoundary.tsx +++ b/packages/frontend-v2/components/Error/ErrorBoundary.tsx @@ -1,4 +1,4 @@ -import React, { Component, ErrorInfo } from 'react'; +import React, { Component, ErrorInfo } from "react"; interface IProps { fallback: React.FC; @@ -9,13 +9,12 @@ interface IState { hasError: boolean; } -export class ErrorBoundary extends Component{ - - state = {hasError: false}; +export class ErrorBoundary extends Component { + state = { hasError: false }; constructor(props: IProps) { super(props); - this.state = {hasError: false}; + this.state = { hasError: false }; } static getDerivedStateFromError(error: Error) { @@ -32,11 +31,8 @@ export class ErrorBoundary extends Component{ render() { if (this.state.hasError) { - return (<> - {this.props.fallback} - ) + return <>{this.props.fallback}; } - return this.props.children; } } diff --git a/packages/frontend-v2/pages/404.tsx b/packages/frontend-v2/pages/404.tsx new file mode 100644 index 000000000..2b178f440 --- /dev/null +++ b/packages/frontend-v2/pages/404.tsx @@ -0,0 +1,52 @@ +import { Flex, Heading, Image, Text } from "@chakra-ui/react"; +import { GraduateButtonLink, GraduatePostAuthHeader } from "../components"; + +export default function Custom404() { + return ( + + + + + sad face + + Oops! Page not found + + + + + Sorry! We are unable to retrieve the information you need. + + + Back to Home + + + + + + ); +} diff --git a/packages/frontend-v2/pages/_app.tsx b/packages/frontend-v2/pages/_app.tsx index 5c20226a3..3258cf0d0 100644 --- a/packages/frontend-v2/pages/_app.tsx +++ b/packages/frontend-v2/pages/_app.tsx @@ -25,9 +25,9 @@ function MyApp({ Component, pageProps }: AppProps) { - - {disableApp ? : } - + + {disableApp ? : } + @@ -70,10 +70,10 @@ const DisabledApp: React.FC = () => { const ErrorPage: React.FC = () => { return ( - - THIS PAGE DOES NOT EXIST - + + THERES A PROBLEM THAT OCCURED HERE. + ); -} +}; export default MyApp; diff --git a/packages/frontend-v2/pages/errorBoundary.tsx b/packages/frontend-v2/pages/errorBoundary.tsx deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/frontend-v2/pages/index.tsx b/packages/frontend-v2/pages/index.tsx index 590618361..f05549b3f 100644 --- a/packages/frontend-v2/pages/index.tsx +++ b/packages/frontend-v2/pages/index.tsx @@ -24,7 +24,6 @@ interface InfoTextProps { } const LandingPage: NextPage = () => { - throw new Error("testing"); return (