-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
87 lines (82 loc) · 2.12 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import { HeadElem as Head } from '../components/Head';
import Link from 'next/link';
import ThumbnailGrid from '../components/ThumbnailGrid';
import Thumbnail from '../components/Thumbnail';
import { statuses } from '../lib/statuses';
import useReducedMotion from '../lib/useReducedMotion';
export default function Home({ statusObj }) {
const reducedMotion = useReducedMotion(false);
return (
<div className="app">
<Head metadata={metadata} />
<header>
<p className="header__title">HTTBey Status Codes</p>
</header>
<main className="main__content">
<p>
HTTBey Status Codes is an easy to reference database of HTTP Status Codes with
their definitions and helpful code references all in one place. Visit an
individual status code via <code>httbey.com/status/[code]</code> or browse the
list below.
</p>
<ThumbnailGrid>
{Object.values(statusObj).map((status, idx) => {
return (
<Link key={idx} className="status" href={`/status/${status.code}`}>
<Thumbnail status={status} reducedMotion={reducedMotion} />
</Link>
);
})}
</ThumbnailGrid>
</main>
<footer>
<p className="footer__note">
Curated by{' '}
<Link
href=""
target="_blank"
className="footer__link"
rel="noopener noreferrer"
>
Mina
</Link>
• Not affliated with Parkwood Entertainment
</p>
</footer>
</div>
);
}
export async function getStaticProps() {
const statusObj = statuses;
return {
props: {
statusObj,
},
};
}
const metadata = {
title: 'HTTBey Status Codes',
description: 'Beyoncé-inspired HTTP Status Codes',
generator: 'Next.js',
url: 'https://httbey.com',
openGraph: {
title: 'HTTBey Status Codes',
description: 'Beyoncé-inspired HTTP Status Codes',
image: {
src: '/og-image.jpg',
alt: 'HTTBey Status Codes',
},
locale: 'en_US',
type: 'website',
},
twitter: {
card: 'summary_large_image',
title: 'HTTBey Status Codes',
description: 'Beyoncé-inspired HTTP Status Codes',
site: 'https://httbey.com',
image: {
src: '/og-image.jpg',
alt: 'HTTBey Status Codes',
},
},
};