forked from anime-kun32/anime-website
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added error handling and placeholder components to AnimeNavListHover, MangaNavListHover, and NewsNavListHover components; updated consumetNews API to return null on error
- Loading branch information
1 parent
e8cd1a3
commit 3e071f2
Showing
6 changed files
with
89 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ export default { | |
|
||
console.log(err) | ||
|
||
return err | ||
return null | ||
|
||
} | ||
|
||
|
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
47 changes: 47 additions & 0 deletions
47
app/layout/header/components/ErrorPlaceholder/component.module.css
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,47 @@ | ||
.error_container { | ||
|
||
z-index: 2; | ||
position: absolute; | ||
top: 69px; | ||
left: 0; | ||
|
||
padding-top: 32px; | ||
padding-bottom: 64px; | ||
padding-left: 64px; | ||
padding-right: 64px; | ||
|
||
background-color: var(--black-100); | ||
|
||
min-height: 340px; | ||
max-height: 60vh; | ||
width: 100%; | ||
|
||
} | ||
|
||
.error_container .wrapper { | ||
|
||
box-shadow: inset 0px 0px 20px 1px var(--background); | ||
|
||
max-width: var(--breakpoint-xxl); | ||
margin: auto; | ||
padding: 24px; | ||
|
||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
border-radius: 4px; | ||
|
||
} | ||
|
||
.error_container .wrapper { | ||
background-color: var(--white-100); | ||
} | ||
|
||
.error_container p { | ||
|
||
font-weight: 500; | ||
color: var(--black-100) !important; | ||
|
||
} |
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,20 @@ | ||
import React from 'react' | ||
import Image from 'next/image'; | ||
import ErrorImg from "@/public/error-img-2.png" | ||
import styles from "./component.module.css" | ||
|
||
export default function ErrorPlaceholder() { | ||
return ( | ||
<div className={styles.error_container}> | ||
|
||
<div className={styles.wrapper}> | ||
<div className={styles.img_container}> | ||
<Image src={ErrorImg} alt='Error' height={200} /> | ||
</div> | ||
|
||
<p>A error happened while loading this section.</p> | ||
</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
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