-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEVPROD-7675: Avoid exposing /login route in non-development builds (#…
…195)
- Loading branch information
Showing
9 changed files
with
42 additions
and
13 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
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,15 +1,15 @@ | ||
import { CustomStoryObj, CustomMeta } from "test_utils/types"; | ||
|
||
import NotFound from "./NotFound"; | ||
import NotFoundSvg from "./NotFoundSvg"; | ||
|
||
export default { | ||
component: NotFound, | ||
} satisfies CustomMeta<typeof NotFound>; | ||
component: NotFoundSvg, | ||
} satisfies CustomMeta<typeof NotFoundSvg>; | ||
|
||
export const Default404: CustomStoryObj<typeof NotFound> = { | ||
export const Default404: CustomStoryObj<typeof NotFoundSvg> = { | ||
render: () => ( | ||
<div style={{ height: "100%", width: "100%" }}> | ||
<NotFound /> | ||
<NotFoundSvg /> | ||
</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,7 +1,11 @@ | ||
import notFound from "./notFound.svg"; | ||
import { Suspense, lazy } from "react"; | ||
|
||
const NotFound = () => ( | ||
<img src={notFound} alt="Page not found" data-cy="404" /> | ||
const NotFoundSvg = lazy(() => import("./NotFoundSvg")); | ||
|
||
const NotFound: React.FC = () => ( | ||
<Suspense fallback={<div>Loading</div>}> | ||
<NotFoundSvg /> | ||
</Suspense> | ||
); | ||
|
||
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import notFound from "./notFound.svg"; | ||
|
||
// It's not possible to lazy load an SVG, so we wrap the SVG in a React component. | ||
const NotFoundSvg: React.FC = () => ( | ||
<img | ||
alt="Page not found" | ||
data-cy="404" | ||
src={notFound} | ||
style={{ height: "inherit", width: "100%", objectFit: "cover" }} | ||
/> | ||
); | ||
|
||
export default NotFoundSvg; |
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
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