Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nextjs-starter-template
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Moorthy G
nextjs-starter-template
Commits
f83de343
Commit
f83de343
authored
Aug 04, 2022
by
Moorthy G
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(404): handle 404 response
parent
938cacf0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
10 deletions
+9
-10
404.png
components/page-not-found/img/404.png
+0
-0
index.js
components/page-not-found/index.js
+1
-4
404.js
pages/404.js
+7
-0
_app.js
pages/_app.js
+1
-6
No files found.
components/page-not-found/img/404.png
View replaced file @
938cacf0
View file @
f83de343
5.53 KB
|
W:
|
H:
56 KB
|
W:
|
H:
2-up
Swipe
Onion skin
components/page-not-found/index.js
View file @
f83de343
...
...
@@ -6,10 +6,7 @@ export default function PageNotFound() {
return
(
<
div
className
=
{
styles
.
notFound
}
>
<
img
src
=
{
require
(
'./img/404.png'
)}
alt
=
""
/>
<
p
>
The
page
you
're looking for is not found</p>
<Button href="/" onClick={() => sendGA('
page
-
not
-
found
', '
cta
')}>
Back to home
</Button>
<
Button
href
=
"/"
>
Back
to
Home
<
/Button
>
<
/div
>
);
}
pages/404.js
0 → 100644
View file @
f83de343
import
PageNotFound
from
'@components/page-not-found'
;
function
FourOhFour
()
{
return
<
PageNotFound
/>
;
}
export
default
FourOhFour
;
pages/_app.js
View file @
f83de343
import
PageNotFound
from
'@components/page-not-found'
;
import
'@styles/global.scss'
;
function
MyApp
({
Component
,
pageProps
})
{
return
pageProps
.
statusCode
===
404
?
(
<
PageNotFound
/>
)
:
(
<
Component
{...
pageProps
}
/
>
);
return
<
Component
{...
pageProps
}
/>
;
}
export
default
MyApp
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment