Skip to content

Commit bf12116

Browse files
committed
Initial Commit
0 parents  commit bf12116

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+8080
-0
lines changed

.editorconfig

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[*]
2+
charset = utf-8
3+
indent_style = space
4+
indent_size = 2
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true

.env.example

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# ------------------------------------------------------------------------------
2+
# This is an example .env file.
3+
#
4+
# All of these environment vars must be defined either in your environment or in
5+
# a local .env file in order to run this app.
6+
#
7+
# @see https://github.com/rolodato/dotenv-safe for more details.
8+
# ------------------------------------------------------------------------------
9+
10+
# Optional (for fathom analytics)
11+
#NEXT_PUBLIC_FATHOM_ID=
12+
13+
# Optional (for PostHog analytics)
14+
#NEXT_PUBLIC_POSTHOG_ID=
15+
16+
# Optional (for rendering tweets more efficiently)
17+
#TWITTER_ACCESS_TOKEN=
18+
19+
# Optional (for persisting preview images to redis)
20+
# NOTE: if you want to enable redis, only REDIS_HOST and REDIS_PASSWORD are required
21+
# NOTE: don't forget to set isRedisEnabled to true in the site.config.ts file
22+
#REDIS_HOST=
23+
#REDIS_PASSWORD=
24+
#REDIS_USER='default'
25+
#REDIS_NAMESPACE='preview-images'

.eslintrc.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"plugins": ["@typescript-eslint", "react", "react-hooks"],
5+
"extends": [
6+
"eslint:recommended",
7+
"plugin:@typescript-eslint/recommended",
8+
"plugin:react/recommended",
9+
"plugin:react-hooks/recommended",
10+
"prettier"
11+
],
12+
"settings": {
13+
"react": {
14+
"version": "detect"
15+
}
16+
},
17+
"env": {
18+
"browser": true,
19+
"node": true
20+
},
21+
"rules": {
22+
"@typescript-eslint/no-explicit-any": 0,
23+
"@typescript-eslint/no-non-null-assertion": 0,
24+
"@typescript-eslint/no-unused-vars": 2,
25+
"react/prop-types": 0
26+
}
27+
}

.github/funding.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [transitive-bullshit]

.github/issue_template.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#### Description
2+
3+
<!--
4+
Please include as detailed of a description as possible, including screenshots if applicable.
5+
-->
6+
7+
#### Notion Test Page ID
8+
9+
<!--
10+
Please include the ID of at least one publicly accessible Notion page related to your issue.
11+
12+
This is extremely helpful for us to debug and fix issues.
13+
14+
Thanks!
15+
-->

.github/pull_request_template.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#### Description
2+
3+
<!--
4+
Please include as detailed of a description as possible, including screenshots if applicable.
5+
-->
6+
7+
#### Notion Test Page ID
8+
9+
<!--
10+
Please include the ID of at least one publicly accessible Notion page related to your PR.
11+
12+
This is extremely helpful for us to debug and fix issues.
13+
14+
Thanks!
15+
-->

.github/workflows/build.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
Build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
11+
- uses: actions/setup-node@v2
12+
with:
13+
node-version: 16
14+
cache: yarn
15+
16+
- run: yarn install --frozen-lockfile
17+
- name: build
18+
# TODO Enable those lines below if you use a Redis cache, you'll also need to configure GitHub Repository Secrets
19+
# env:
20+
# REDIS_HOST: ${{ secrets.REDIS_HOST }}
21+
# REDIS_PASSWORD: ${{ secrets.REDIS_PASSWORD }}
22+
run: yarn build

.gitignore

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# ide
23+
.idea
24+
25+
# debug
26+
npm-debug.log*
27+
yarn-debug.log*
28+
yarn-error.log*
29+
30+
# local env files
31+
.env
32+
.env.local
33+
.env.build
34+
.env.development.local
35+
.env.test.local
36+
.env.production.local
37+
38+
# vercel
39+
.vercel

.prettierignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.snapshots/
2+
build/
3+
dist/
4+
node_modules/
5+
.next/
6+
.vercel/
7+
8+
.demo/
9+
.renderer/

.prettierrc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"singleQuote": true,
3+
"jsxSingleQuote": true,
4+
"semi": false,
5+
"useTabs": false,
6+
"tabWidth": 2,
7+
"bracketSpacing": true,
8+
"bracketSameLine": false,
9+
"arrowParens": "always",
10+
"trailingComma": "none"
11+
}

.vscode/launch.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"type": "node",
6+
"request": "launch",
7+
"name": "next dev",
8+
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/next",
9+
"runtimeArgs": ["dev"],
10+
"cwd": "${workspaceFolder}",
11+
"port": 9229,
12+
"smartStep": true,
13+
"console": "integratedTerminal",
14+
"skipFiles": ["<node_internals>/**"],
15+
"env": {
16+
"NODE_OPTIONS": "--inspect"
17+
}
18+
},
19+
{
20+
"type": "node",
21+
"request": "attach",
22+
"name": "Next.js App",
23+
"skipFiles": ["<node_internals>/**"],
24+
"port": 9229
25+
}
26+
]
27+
}

.vscode/settings.json

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"typescript.tsdk": "./node_modules/typescript/lib",
3+
"files.exclude": {
4+
"**/logs": true,
5+
"**/*.log": true,
6+
"**/npm-debug.log*": true,
7+
"**/yarn-debug.log*": true,
8+
"**/yarn-error.log*": true,
9+
"**/pids": true,
10+
"**/*.pid": true,
11+
"**/*.seed": true,
12+
"**/*.pid.lock": true,
13+
"**/.dummy": true,
14+
"**/lib-cov": true,
15+
"**/coverage": true,
16+
"**/.nyc_output": true,
17+
"**/.grunt": true,
18+
"**/.snapshots/": true,
19+
"**/bower_components": true,
20+
"**/.lock-wscript": true,
21+
"build/Release": true,
22+
"**/node_modules/": true,
23+
"**/jspm_packages/": true,
24+
"**/typings/": true,
25+
"**/.npm": true,
26+
"**/.eslintcache": true,
27+
"**/.node_repl_history": true,
28+
"**/*.tgz": true,
29+
"**/.yarn-integrity": true,
30+
"**/.next/": true,
31+
"**/dist/": true,
32+
"**/build/": true,
33+
"**/.now/": true,
34+
"**/.vercel/": true,
35+
"**/.google.json": true
36+
}
37+
}

components/ErrorPage.tsx

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import * as React from 'react'
2+
import { PageHead } from './PageHead'
3+
4+
import styles from './styles.module.css'
5+
6+
export const ErrorPage: React.FC<{ statusCode: number }> = ({ statusCode }) => {
7+
const title = 'Error'
8+
9+
return (
10+
<>
11+
<PageHead title={title} />
12+
13+
<div className={styles.container}>
14+
<main className={styles.main}>
15+
<h1>Error Loading Page</h1>
16+
17+
{statusCode && <p>Error code: {statusCode}</p>}
18+
19+
<img src='/error.png' alt='Error' className={styles.errorImage} />
20+
</main>
21+
</div>
22+
</>
23+
)
24+
}

components/Footer.tsx

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
import * as React from 'react'
2+
import { FaTwitter } from '@react-icons/all-files/fa/FaTwitter'
3+
import { FaZhihu } from '@react-icons/all-files/fa/FaZhihu'
4+
import { FaGithub } from '@react-icons/all-files/fa/FaGithub'
5+
import { FaLinkedin } from '@react-icons/all-files/fa/FaLinkedin'
6+
import { IoSunnyOutline } from '@react-icons/all-files/io5/IoSunnyOutline'
7+
import { IoMoonSharp } from '@react-icons/all-files/io5/IoMoonSharp'
8+
9+
import { useDarkMode } from 'lib/use-dark-mode'
10+
import * as config from 'lib/config'
11+
12+
import styles from './styles.module.css'
13+
14+
// TODO: merge the data and icons from PageSocial with the social links in Footer
15+
16+
export const FooterImpl: React.FC = () => {
17+
const [hasMounted, setHasMounted] = React.useState(false)
18+
const { isDarkMode, toggleDarkMode } = useDarkMode()
19+
20+
const onToggleDarkMode = React.useCallback(
21+
(e) => {
22+
e.preventDefault()
23+
toggleDarkMode()
24+
},
25+
[toggleDarkMode]
26+
)
27+
28+
React.useEffect(() => {
29+
setHasMounted(true)
30+
}, [])
31+
32+
return (
33+
<footer className={styles.footer}>
34+
<div className={styles.copyright}>Copyright 2022 {config.author}</div>
35+
36+
<div className={styles.settings}>
37+
{hasMounted && (
38+
<a
39+
className={styles.toggleDarkMode}
40+
href='#'
41+
role='button'
42+
onClick={onToggleDarkMode}
43+
title='Toggle dark mode'
44+
>
45+
{isDarkMode ? <IoMoonSharp /> : <IoSunnyOutline />}
46+
</a>
47+
)}
48+
</div>
49+
50+
<div className={styles.social}>
51+
{config.twitter && (
52+
<a
53+
className={styles.twitter}
54+
href={`https://twitter.com/${config.twitter}`}
55+
title={`Twitter @${config.twitter}`}
56+
target='_blank'
57+
rel='noopener noreferrer'
58+
>
59+
<FaTwitter />
60+
</a>
61+
)}
62+
63+
{config.zhihu && (
64+
<a
65+
className={styles.zhihu}
66+
href={`https://zhihu.com/people/${config.zhihu}`}
67+
title={`Zhihu @${config.zhihu}`}
68+
target='_blank'
69+
rel='noopener noreferrer'
70+
>
71+
<FaZhihu />
72+
</a>
73+
)}
74+
75+
{config.github && (
76+
<a
77+
className={styles.github}
78+
href={`https://github.com/${config.github}`}
79+
title={`GitHub @${config.github}`}
80+
target='_blank'
81+
rel='noopener noreferrer'
82+
>
83+
<FaGithub />
84+
</a>
85+
)}
86+
87+
{config.linkedin && (
88+
<a
89+
className={styles.linkedin}
90+
href={`https://www.linkedin.com/in/${config.linkedin}`}
91+
title={`LinkedIn ${config.author}`}
92+
target='_blank'
93+
rel='noopener noreferrer'
94+
>
95+
<FaLinkedin />
96+
</a>
97+
)}
98+
</div>
99+
</footer>
100+
)
101+
}
102+
103+
export const Footer = React.memo(FooterImpl)

0 commit comments

Comments
 (0)