File tree Expand file tree Collapse file tree 3 files changed +45
-0
lines changed
modules/categories/templates Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { Metadata } from "next"
2
+ import Link from "next/link"
3
+
4
+ export const metadata : Metadata = {
5
+ title : "404" ,
6
+ description : "Something went wrong" ,
7
+ }
8
+
9
+ export default function NotFound ( ) {
10
+ return (
11
+ < div className = "flex flex-col items-center justify-center min-h-[calc(100vh-64px)]" >
12
+ < h1 className = "text-2xl-semi text-gry-900" > Page not found</ h1 >
13
+ < p className = "text-small-regular text-gray-700" >
14
+ The page you tried to access does not exist.
15
+ </ p >
16
+ < Link href = "/" className = "mt-4 underline text-base-regular text-gray-900" >
17
+ Go to frontpage
18
+ </ Link >
19
+ </ div >
20
+ )
21
+ }
Original file line number Diff line number Diff line change
1
+ import { Metadata } from "next"
2
+ import Link from "next/link"
3
+
4
+ export const metadata : Metadata = {
5
+ title : "404" ,
6
+ description : "Something went wrong" ,
7
+ }
8
+
9
+ export default function NotFound ( ) {
10
+ return (
11
+ < div className = "flex flex-col items-center justify-center min-h-[calc(100vh-64px)]" >
12
+ < h1 className = "text-2xl-semi text-gry-900" > Page not found</ h1 >
13
+ < p className = "text-small-regular text-gray-700" >
14
+ The page you tried to access does not exist.
15
+ </ p >
16
+ < Link href = "/" className = "mt-4 underline text-base-regular text-gray-900" >
17
+ Go to frontpage
18
+ </ Link >
19
+ </ div >
20
+ )
21
+ }
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import React, { useEffect } from "react"
15
15
import { useInView } from "react-intersection-observer"
16
16
import Link from "next/link"
17
17
import UnderlineLink from "@modules/common/components/underline-link"
18
+ import { notFound } from "next/navigation"
18
19
19
20
type CategoryTemplateProps = {
20
21
categories : ProductCategoryWithChildren [ ]
@@ -27,6 +28,8 @@ const CategoryTemplate: React.FC<CategoryTemplateProps> = ({ categories }) => {
27
28
const category = categories [ categories . length - 1 ]
28
29
const parents = categories . slice ( 0 , categories . length - 1 )
29
30
31
+ if ( ! category ) notFound ( )
32
+
30
33
const {
31
34
data : infiniteData ,
32
35
hasNextPage,
You can’t perform that action at this time.
0 commit comments