Skip to content

Commit 6b33560

Browse files
committed
Add generic ErrorBlock component
Page is generic enough to be shared between pages, though it might be unlikely it will be shared? Depends on usecase.
1 parent 6a8ff03 commit 6b33560

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from 'react'
2+
import styles from '@/style/error.module.css';
3+
import { ErrorBody } from '@/api/structs';
4+
5+
interface Props {
6+
err : ErrorBody
7+
}
8+
9+
function ErrorBlock({ err }: Props) {
10+
return (
11+
<div className={styles.container}>
12+
<h1 className={styles.title}>
13+
{err.status}: We've seen better days.
14+
</h1>
15+
<p className={styles.details}>
16+
Reason: {err.error}
17+
</p>
18+
</div>
19+
)
20+
}
21+
22+
export default ErrorBlock

peerprep/style/error.module.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.container {
2+
display: flex;
3+
flex-direction: column;
4+
align-items: center;
5+
justify-content: flex-start;
6+
width: 100%;
7+
height: 100%;
8+
}
9+
10+
.title {
11+
font-size: xx-large;
12+
font-family: Consolas, monospace;
13+
}
14+
15+
.details {
16+
font-family: Consolas, monospace;
17+
}

peerprep/style/layout.module.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88

99
.container {
1010
display: flex;
11+
flex-direction: column;
1112
min-width: 100%;
12-
max-height: 90%;
13+
height: 90%;
1314
overflow-y: scroll;
1415
}
1516

0 commit comments

Comments
 (0)