Skip to content

Commit 70fc52b

Browse files
committed
feat:debounce demo;icon
1 parent 8bcdfb9 commit 70fc52b

File tree

5 files changed

+41
-35
lines changed

5 files changed

+41
-35
lines changed

app/components/NavBar.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
1-
import Link from "next/link";
2-
import styles from "../styles/Nav.module.css";
3-
import ThemeToggle from "./ThemeToggle";
1+
import Link from 'next/link';
2+
import styles from '../styles/Nav.module.css';
3+
import ThemeToggle from './ThemeToggle';
44

55
const NavBar = () => {
66
return (
77
<div className={styles.container}>
88
<Link
9-
href="/"
9+
href='/'
1010
className={styles.signature}
1111
>
1212
Lee
1313
</Link>
1414
<nav className={styles.nav}>
1515
{/* Mobile Icon */}
16-
<Link href="/blog">
16+
<Link href='/blog'>
1717
<span className={`iconfont ${styles.mobile} ${styles.icon}`}>
1818
&#xe634;
1919
</span>
2020
</Link>
21-
<Link href="/project">
21+
<Link href='/project'>
2222
<span className={`iconfont ${styles.mobile} ${styles.icon}`}>
23-
&#xe650;
23+
&#xe8d9;
2424
</span>
2525
</Link>
2626

2727
{/* Laptop Link */}
2828
<Link
29-
href="/"
29+
href='/'
3030
className={`${styles.link} ${styles.laptop}`}
3131
>
3232
Me
3333
</Link>
3434
<Link
35-
href="/blog"
35+
href='/blog'
3636
className={`${styles.link} ${styles.laptop}`}
3737
>
3838
Blog
3939
</Link>
4040
<Link
41-
href="/project"
41+
href='/project'
4242
className={`${styles.link} ${styles.laptop}`}
4343
>
4444
Projects
4545
</Link>
4646

4747
{/* Other Icon */}
4848
<Link
49-
href="https://github.com/LeeZ1Q"
50-
rel="noreferrer"
51-
target="_blank"
49+
href='https://github.com/LeeZ1Q'
50+
rel='noreferrer'
51+
target='_blank'
5252
className={`iconfont ${styles.icon}`}
5353
>
54-
&#xe885;
54+
&#xe972;
5555
</Link>
5656
<Link
57-
href="https://space.bilibili.com/67972196"
58-
rel="noreferrer"
59-
target="_blank"
57+
href='https://space.bilibili.com/67972196'
58+
rel='noreferrer'
59+
target='_blank'
6060
className={`iconfont ${styles.icon}`}
6161
>
6262
&#xe66d;

app/components/ThemeToggle.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
"use client";
1+
'use client';
22

3-
import React, { useEffect, useState } from "react";
4-
import { useTheme } from "next-themes";
5-
import styles from "../styles/Nav.module.css";
3+
import React, { useEffect, useState } from 'react';
4+
import { useTheme } from 'next-themes';
5+
import styles from '../styles/Nav.module.css';
66

77
const ThemeToggle = () => {
88
const [mounted, setMounted] = useState(false);
@@ -11,13 +11,13 @@ const ThemeToggle = () => {
1111
useEffect(() => setMounted(true), []);
1212

1313
if (!mounted)
14-
return <span className={`iconfont ${styles.icon} loading`}> &#xe635;</span>;
14+
return <span className={`iconfont ${styles.icon} loading`}> &#xe600;</span>;
1515

1616
const toggleTheme = () => {
17-
if (theme === "light") {
18-
setTheme("dark");
17+
if (theme === 'light') {
18+
setTheme('dark');
1919
} else {
20-
setTheme("light");
20+
setTheme('light');
2121
}
2222
};
2323

@@ -26,7 +26,7 @@ const ThemeToggle = () => {
2626
className={`iconfont ${styles.icon}`}
2727
onClick={toggleTheme}
2828
>
29-
&#xe635;
29+
{theme === 'light' ? '\ue600' : '\ue6dc'}
3030
</span>
3131
);
3232
};

app/project/page.js

+14-8
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const Project = () => {
2222
<Item
2323
name='mini-react'
2424
description='A mini React that implements React core concepts.'
25-
icon='&#xe64b;'
25+
icon='&#xe712;'
2626
repo='https://github.com/LeeZ1Q/mini-react'
2727
/>
2828
<Item
@@ -31,16 +31,10 @@ const Project = () => {
3131
icon='&#xe66c;'
3232
repo='https://github.com/LeeZ1Q/mini-redux'
3333
/>
34-
<Item
35-
name='react-dnd-playground'
36-
description='React drag and drop examples playground.'
37-
icon='&#xe704;'
38-
repo='https://github.com/LeeZ1Q/react-dnd-playground'
39-
/>
4034
<Item
4135
name='Book Finder'
4236
description='A Book Searching Website using Google Book API.'
43-
icon='&#xe61f;'
37+
icon='&#xe605;'
4438
repo='https://github.com/LeeZ1Q/bookfinder'
4539
/>
4640
<Item
@@ -52,6 +46,18 @@ const Project = () => {
5246
</div>
5347
<p className={styles.title}>Demo</p>
5448
<div className={styles.list}>
49+
<Item
50+
name='debounce-throttle-demo'
51+
description='A playground to try debouncing and throtting.'
52+
icon='&#xe653;'
53+
repo='https://github.com/LeeZ1Q/debounce-throttle-playground'
54+
/>
55+
<Item
56+
name='react-dnd-playground'
57+
description='React drag and drop examples playground.'
58+
icon='&#xe704;'
59+
repo='https://github.com/LeeZ1Q/react-dnd-playground'
60+
/>
5561
<Item
5662
name='dark-mode-toggle'
5763
description='A dark mode demo.'

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
"eslint": "8.40.0",
2929
"eslint-config-next": "13.4.2"
3030
}
31-
}
31+
}

public/iconfont.ttf

92 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)