From 52f5953653ced34875b10b069ecf6b0247bd9baf Mon Sep 17 00:00:00 2001 From: Pouria Delfanazari Date: Fri, 15 Dec 2023 17:23:56 -0800 Subject: [PATCH 1/2] Add a custom 404 page --- src/app/not-found.tsx | 33 +++++++++++++++++++ src/containers/thread/PostThreadContainer.tsx | 1 - src/lib/utils/feed.ts | 1 + 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 src/app/not-found.tsx diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx new file mode 100644 index 00000000..ff11b926 --- /dev/null +++ b/src/app/not-found.tsx @@ -0,0 +1,33 @@ +import Image from "next/image"; +import Link from "next/link"; + +export default function NotFound() { + return ( +
+
+ Ouranos logo + Ouranos text +
+

+ The page you are looking for could not be found +

+ + Return home + +
+ ); +} diff --git a/src/containers/thread/PostThreadContainer.tsx b/src/containers/thread/PostThreadContainer.tsx index f3d041d7..b6c80741 100644 --- a/src/containers/thread/PostThreadContainer.tsx +++ b/src/containers/thread/PostThreadContainer.tsx @@ -15,7 +15,6 @@ import Button from "@/components/actions/button/Button"; import { useRouter } from "next/navigation"; import FeedPostSkeleton from "@/components/contentDisplay/feedPost/FeedPostSkeleton"; import FeedAlert from "@/components/feedback/feedAlert/FeedAlert"; -import { ThreadViewResult } from "../../../types/feed"; import { sortThread } from "@/lib/utils/feed"; interface Props { diff --git a/src/lib/utils/feed.ts b/src/lib/utils/feed.ts index d4d2a333..efd6984d 100644 --- a/src/lib/utils/feed.ts +++ b/src/lib/utils/feed.ts @@ -207,6 +207,7 @@ export const sortThread = ( return Math.random() - 0.5; } + // this is applied in addition to the sort if (threadPrefs.prioritizeFollowedUsers) { const aIsFollowed = a.post.author.viewer?.following; const bIsFollowed = b.post.author.viewer?.following; From 1f4c7c7718cba94948491be5bc2ea654345eb617 Mon Sep 17 00:00:00 2001 From: Pouria Delfanazari Date: Fri, 15 Dec 2023 17:28:12 -0800 Subject: [PATCH 2/2] Remove link from 404 page --- src/app/not-found.tsx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx index ff11b926..24282eaa 100644 --- a/src/app/not-found.tsx +++ b/src/app/not-found.tsx @@ -22,12 +22,6 @@ export default function NotFound() {

The page you are looking for could not be found

- - Return home - ); }