Skip to content

Commit 3f3a8f8

Browse files
authored
Migrating Typescript, Changing avatar using notion avatar, Adding theme config and github template (morethanmin#36)
* feat: refactor gtag, theme effect * refector: delete unused component * fix: build error * feat: update avatar * feat: Removing About from feed * feat: updating usrename * chore: migrating typescript * chore: writing github template * feat: add theme configuration * chore: update config and issue template * feat: migrating typescript * feat: migarating typescript * feat: migrating typescript
1 parent 8a69149 commit 3f3a8f8

Some content is hidden

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

71 files changed

+781
-777
lines changed

.eslintrc.js

-8
This file was deleted.

.eslintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["next/core-web-vitals"]
3+
}

.github/CODE_OF_CONDUCT.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Nothing
File renamed without changes.

.github/ISSUE_TEMPLATE/bug.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
name: bug
3+
about: Suggest an idea for this project
4+
title: ""
5+
labels: "🐛 bug"
6+
assignees: ""
7+
---
8+
9+
## **Overview**

.github/ISSUE_TEMPLATE/feature.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
name: feature
3+
about: Suggest an idea for this project
4+
title: ""
5+
labels: "✨ feature"
6+
assignees: ""
7+
---
8+
9+
## **Overview**

.github/PULL_REQUEST_TEMPLATE.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## Overview
2+
3+
## PR Checklist
4+
5+
- [ ] I read and included theses actions below
6+
7+
1. I have read the [Contributing Guide](https://github.com/morethanmin/morethan-log/blob/main/.github/CONTRIBUTING.md)
8+
2. I have written documents and tests, if needed.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Static Blog and Resume using Notion and Next.js, deployed on Vercel.
44

55
<img width="1712" alt="image" src="https://user-images.githubusercontent.com/72514247/206892232-8a92d9f5-7106-4fe8-aab3-d25f9426f304.png">
66

7-
- Demo Blog: https://morethan-log.vercel.app
7+
- Demo Blog: https://morethan-log.vercel.app
88
- Demo Resume: https://morethan-log.vercel.app/resume
99

1010
## Features

jsconfig.json

-12
This file was deleted.

morethan-log.config.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const CONFIG = {
22
// profile setting
33
profile: {
4-
name: 'morethan-log',
5-
image: '/profile.png',
4+
name: 'morethanmin',
5+
image: '/avatar.svg', // If you want to create your own notion avatar, check out https://notion-avatar.vercel.app
66
discription: 'frontend developer',
77
linkedin: 'morethanmin',
88
email: 'morethanmin.dev@gmail.com',
@@ -19,6 +19,7 @@ const CONFIG = {
1919
blog: {
2020
title: 'morethan-log',
2121
description: 'welcome to morethan-log!',
22+
theme: 'auto' // ['light', 'dark', 'auto']
2223
},
2324

2425
// CONFIG configration

next-env.d.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
"react-notion-x": "^4.11.0"
2727
},
2828
"devDependencies": {
29+
"@types/gtag.js": "^0.0.12",
30+
"@types/node": "^18.11.15",
31+
"@types/react": "^18.0.26",
32+
"@types/react-dom": "^18.0.9",
2933
"autoprefixer": "^10.4.0",
3034
"eslint": "<8.0.0",
3135
"eslint-config-next": "^12.0.3",
@@ -38,6 +42,7 @@
3842
"next-sitemap": "^3.1.32",
3943
"postcss": "^8.3.11",
4044
"prettier": "^2.7.1",
41-
"tailwindcss": "^3.1.4"
45+
"tailwindcss": "^3.1.4",
46+
"typescript": "^4.9.4"
4247
}
4348
}

public/avatar.svg

+1
Loading

public/profile-hover.png

-221 KB
Binary file not shown.

public/profile.png

-76.8 KB
Binary file not shown.

public/sitemap.xml

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
3-
<url><loc>https://morethan-log.vercel.app</loc><lastmod>2022-12-09T07:44:02.922Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
4-
<url><loc>https://morethan-log.vercel.app/apollo-gettings-started-mutate</loc><lastmod>2022-12-09T07:44:02.922Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
5-
<url><loc>https://morethan-log.vercel.app/apollo-gettings-started-query</loc><lastmod>2022-12-09T07:44:02.922Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
6-
<url><loc>https://morethan-log.vercel.app/resume</loc><lastmod>2022-12-09T07:44:02.922Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
7-
<url><loc>https://morethan-log.vercel.app/about-graphql</loc><lastmod>2022-12-09T07:44:02.922Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
8-
<url><loc>https://morethan-log.vercel.app/how-to-apply-ga-to-next.js</loc><lastmod>2022-12-09T07:44:02.922Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
9-
<url><loc>https://morethan-log.vercel.app/about-opensource-license</loc><lastmod>2022-12-09T07:44:02.922Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
10-
<url><loc>https://morethan-log.vercel.app/about</loc><lastmod>2022-12-09T07:44:02.922Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
3+
<url><loc>https://morethan-log.vercel.app</loc><lastmod>2022-12-17T09:56:57.445Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
4+
<url><loc>https://morethan-log.vercel.app/hot-to-make-sitemap-in-next-js</loc><lastmod>2022-12-17T09:56:57.445Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
5+
<url><loc>https://morethan-log.vercel.app/apollo-gettings-started-mutate</loc><lastmod>2022-12-17T09:56:57.445Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
6+
<url><loc>https://morethan-log.vercel.app/apollo-gettings-started-query</loc><lastmod>2022-12-17T09:56:57.445Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
7+
<url><loc>https://morethan-log.vercel.app/resume</loc><lastmod>2022-12-17T09:56:57.445Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
8+
<url><loc>https://morethan-log.vercel.app/about-graphql</loc><lastmod>2022-12-17T09:56:57.445Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
9+
<url><loc>https://morethan-log.vercel.app/how-to-apply-ga-to-next.js</loc><lastmod>2022-12-17T09:56:57.445Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
10+
<url><loc>https://morethan-log.vercel.app/about-opensource-license</loc><lastmod>2022-12-17T09:56:57.445Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
11+
<url><loc>https://morethan-log.vercel.app/about</loc><lastmod>2022-12-17T09:56:57.445Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
1112
</urlset>

src/components/Layout/Footer.jsx

-26
This file was deleted.

src/components/Layout/Header/Logo.tsx

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React from 'react'
2+
import Link from 'next/link'
3+
import CONFIG from 'morethan-log.config'
4+
5+
type Props = {}
6+
7+
const Logo: React.FC<Props> = () => {
8+
return (
9+
<Link href="/">
10+
<a aria-label={CONFIG.blog.title}>
11+
<div className="flex items-center">
12+
<div className="ml-2 text-black dark:text-white header-name">
13+
{CONFIG.blog.title}
14+
</div>
15+
</div>
16+
</a>
17+
</Link>
18+
)
19+
}
20+
21+
export default Logo

src/components/Layout/Header/NavBar.jsx

-32
This file was deleted.
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import Link from 'next/link'
2+
3+
const NavBar: React.FC = () => {
4+
const links = [{ id: 1, name: 'About', to: '/about' }]
5+
return (
6+
<div className="flex-shrink-0">
7+
<ul className="flex flex-row">
8+
{links.map((link) => (
9+
<li
10+
key={link.id}
11+
className="block ml-4 text-black dark:text-gray-50 nav"
12+
>
13+
<Link href={link.to}>
14+
<a>{link.name}</a>
15+
</Link>
16+
</li>
17+
))}
18+
</ul>
19+
</div>
20+
)
21+
}
22+
23+
export default NavBar
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import CONFIG from '@/morethan-log.config'
2+
import { getTheme, ThemeType } from '@/src/hooks/useThemeEffect'
3+
import React, { useEffect, useState } from 'react'
4+
5+
type Props = {}
6+
7+
const ThemeToggle: React.FC<Props> = () => {
8+
const [theme, setTheme] = useState<ThemeType>()
9+
10+
useEffect(() => {
11+
if (typeof window === 'object') {
12+
setTheme(getTheme())
13+
}
14+
}, [])
15+
16+
const handleClick = () => {
17+
const changedTheme = getTheme() !== 'dark' ? 'dark' : 'light'
18+
localStorage.setItem('theme', changedTheme)
19+
setTheme(changedTheme)
20+
changedTheme === 'dark'
21+
? document.documentElement.classList.add('dark')
22+
: document.documentElement.classList.remove('dark')
23+
}
24+
25+
if (CONFIG.blog.theme !== 'auto') return null
26+
return (
27+
<div className={`cursor-pointer dark:text-gray-50`} onClick={handleClick}>
28+
{theme}
29+
</div>
30+
)
31+
}
32+
33+
export default ThemeToggle

src/components/Layout/Header/index.jsx

-58
This file was deleted.

0 commit comments

Comments
 (0)