From 334d54daf5206106d1b7bfdd131b172ab6fb5c5d Mon Sep 17 00:00:00 2001 From: Feroze Mohideen Date: Tue, 21 May 2024 16:51:39 -0400 Subject: [PATCH] add component (#4672) --- .../src/legacy/components/PageNotFound.tsx | 190 ++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 dashboard/src/legacy/components/PageNotFound.tsx diff --git a/dashboard/src/legacy/components/PageNotFound.tsx b/dashboard/src/legacy/components/PageNotFound.tsx new file mode 100644 index 0000000000..8637e85703 --- /dev/null +++ b/dashboard/src/legacy/components/PageNotFound.tsx @@ -0,0 +1,190 @@ +import React, { Component } from "react"; +import { withRouter, type RouteComponentProps } from "react-router"; +import styled from "styled-components"; + +import { pushFiltered } from "shared/routing"; + +type PropsType = RouteComponentProps & {}; + +type StateType = {}; + +class PageNotFound extends Component { + state = {}; + + render() { + const { pathname } = this.props.location; + const params = this.props.match.params as any; + const { baseRoute } = params; + if (baseRoute === "applications") { + return ( + + + 404 + Application Not Found + + + { + pushFiltered(this.props, "/applications", ["project_id"]); + }} + > + arrow_back + Applications + + {pathname && ( + <> + | + Could not find "{pathname}" + + )} + + + ); + } else if (baseRoute === "jobs") { + return ( + + + 404 + Job Not Found + + + { + pushFiltered(this.props, "/jobs", ["project_id"]); + }} + > + arrow_back + Jobs + + {pathname && ( + <> + | + Could not find "{pathname}" + + )} + + + ); + } + return ( + + + 404 + Page Not Found + + + { + pushFiltered(this.props, "/dashboard", ["project_id"]); + }} + > + home + Return Home + + {pathname && ( + <> + | + Could not find "{pathname}" + + )} + + + ); + } +} + +export default withRouter(PageNotFound); + +const Splitter = styled.div` + margin: 0 20px; + font-size: 27px; + font-weight: 200; + color: #ffffff15; +`; + +const Flex = styled.div` + display: flex; + align-items: center; + justify-content: center; +`; + +const Helper = styled.div` + font-size: 15px; + max-width: 550px; + margin-right: -50px; +`; + +const BackButton = styled.div` + display: flex; + align-items: center; + justify-content: space-between; + cursor: pointer; + font-size: 13px; + height: 35px; + padding: 5px 16px; + padding-right: 15px; + border: 1px solid #ffffff55; + border-radius: 100px; + width: ${(props: { width: string }) => props.width}; + color: white; + background: #ffffff11; + + :hover { + background: #ffffff22; + } + + > i { + color: white; + font-size: 16px; + margin-right: 6px; + margin-left: -2px; + } +`; + +const StyledPageNotFound = styled.div` + color: #6f6f6f; + font-size: 16px; + user-select: none; + margin-top: -80px; + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +`; + +const Mega = styled.div` + font-size: 200px; + color: #ffffff06; + position: relative; + font-weight: bold; + text-align: center; + + > i { + font-size: 23px; + margin-right: 12px; + } +`; + +const Inside = styled.div` + position: absolute; + color: #6f6f6f; + top: 0; + left: 0; + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + font-weight: 400; + font-size: 20px; + + > i { + font-size: 23px; + margin-right: 12px; + } +`;