generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add link to home page from error pages (#719)
- Loading branch information
Showing
6 changed files
with
97 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import NotAuthorized from "./not-authorized"; | ||
import { NotFound } from "./not-found"; | ||
import NotFound from "./not-found"; | ||
|
||
export { NotFound }; | ||
|
||
export default NotAuthorized; | ||
export { NotAuthorized }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import { FC } from "react"; | ||
import { Footer, Header } from "../../containers/layout"; | ||
import { BsPersonFillSlash } from "react-icons/bs"; | ||
import { Link } from "react-router-dom"; | ||
|
||
const NotAuthorized: FC = () => { | ||
return ( | ||
|
@@ -10,8 +11,19 @@ const NotAuthorized: FC = () => { | |
<div className="error-container"> | ||
<div className="message"> | ||
<BsPersonFillSlash /> | ||
<h1 className="comp-padding-top-25">Sorry, you are not authorized to access this site</h1>If you think you | ||
should have access, please contact <a href="mailto:[email protected]">[email protected]</a> | ||
<div className="message-details"> | ||
<h1 className="comp-padding-top-25">Sorry, you are not authorized to access this site.</h1> | ||
|
||
<p> | ||
If you believe you should have access, return to the <Link to="/complaints/">home page</Link> to try | ||
logging in again. | ||
</p> | ||
|
||
<p> | ||
If the problem persists, contact the Compliance & Enforcement Digital Services team at{" "} | ||
<a href="mailto:[email protected]">[email protected]</a>. | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
35 changes: 33 additions & 2 deletions
35
frontend/src/app/components/containers/pages/not-found.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,34 @@ | ||
export const NotFound = () => { | ||
return <h1>The page or content you are looking for is not found.</h1>; | ||
import { FC } from "react"; | ||
import { Footer, Header } from "../../containers/layout"; | ||
import { BsFileEarmarkX } from "react-icons/bs"; | ||
import { Link } from "react-router-dom"; | ||
|
||
const NotFound: FC = () => { | ||
return ( | ||
<div className="comp-app-container"> | ||
<Header /> | ||
|
||
<div className="error-container"> | ||
<div className="message"> | ||
<BsFileEarmarkX /> | ||
<div className="message-details"> | ||
<h1 className="comp-padding-top-25">The page or content you are looking for could not be found.</h1> | ||
|
||
<p> | ||
Return to the <Link to="/complaints/">home page</Link> to try again. | ||
</p> | ||
|
||
<p> | ||
If the problem persists, contact the Compliance & Enforcement Digital Services team at{" "} | ||
<a href="mailto:[email protected]">[email protected]</a>. | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<Footer /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default NotFound; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,9 +55,20 @@ const GenericErrorBoundary: FC<props> = ({ children }) => { | |
<div className="message"> | ||
<TbFaceIdError /> | ||
{/* <br /> */} | ||
<h1 className="comp-padding-top-25">System error</h1>Please refresh the page to try again. If you still have | ||
problems, contact the Compliance & Enforcement Digital Services team at{" "} | ||
<a href="mailto:[email protected]">[email protected]</a> | ||
<div className="message-details"> | ||
<h1 className="comp-padding-top-25">System error</h1> | ||
|
||
{/* <!-- The link in this section can't use react router as it | ||
sits above the Routes in index.ts --> */} | ||
<p> | ||
Refresh the page or return to the <a href="/">home page</a> to try again. | ||
</p> | ||
|
||
<p> | ||
If the problem persists, contact the Compliance & Enforcement Digital Services team at{" "} | ||
<a href="mailto:[email protected]">[email protected]</a>. | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,42 @@ | ||
.error-container { | ||
margin-top: auto; | ||
position: relative; | ||
display: flex; | ||
align-items: center; /* Center items */ | ||
justify-content: center; /* Center horizontally */ | ||
height: 100vh; /* Full height of the viewport */ | ||
|
||
.message { | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
display: flex; | ||
flex-direction: column; /* Stack all children vertically */ | ||
align-items: center; /* Center items */ | ||
text-align: center; /* Center text on small screens */ | ||
|
||
svg { | ||
height: 175px; | ||
height: 175px; /* Set size of icon */ | ||
width: 175px; | ||
float: left; | ||
padding-right: 25px; | ||
margin-bottom: 25px; /* Space between SVG and text on mobile */ | ||
} | ||
} | ||
} | ||
|
||
/* Media query for larger screens */ | ||
@media (min-width: 768px) { | ||
.error-container { | ||
flex-direction: row; /* Align horizontally on larger screens */ | ||
|
||
.message { | ||
flex-direction: row; /* Align horizontally on larger screens*/ | ||
align-items: center; /* Align SVG and text vertically */ | ||
text-align: left; /* Align text to the left on larger screens */ | ||
|
||
svg { | ||
margin-bottom: 0; /* Remove bottom margin */ | ||
margin-right: 25px; /* Space between SVG and text */ | ||
} | ||
|
||
/* We want the title and subsequent paragraphs to stack beside the icon */ | ||
.message-details { | ||
flex-direction: column; /* Align all messages vertically */ | ||
} | ||
} | ||
} | ||
} |