编译修复
This commit is contained in:
tangly1024
2021-12-17 14:53:18 +08:00
parent f154f24f88
commit 636d355234
5 changed files with 0 additions and 13 deletions

View File

@@ -3,14 +3,12 @@ import { loadUserThemeFromCookies, saveTheme, useGlobal } from '@/lib/global'
import { faMoon, faSun } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
let windowTop = 0
export default function FloatDarkModeButton () {
const [show, switchShow] = useState(false)
const scrollListener = () => {
const scrollY = window.pageYOffset
// const shouldShow = scrollY > 100 && scrollY < windowTop
const shouldShow = scrollY > 100
windowTop = scrollY
if (shouldShow !== show) {
switchShow(shouldShow)
}

View File

@@ -4,8 +4,6 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faArrowUp } from '@fortawesome/free-solid-svg-icons'
import smoothscroll from 'smoothscroll-polyfill'
let windowTop = 0
/**
* 跳转到网页顶部
* 当屏幕下滑500像素后会出现该控件
@@ -27,7 +25,6 @@ const JumpToTopButton = ({ targetRef, showPercent = true }) => {
if (per > 100) per = 100
// const shouldShow = scrollY > 100 && per > 0 && scrollY < windowTop
const shouldShow = scrollY > 100 && per > 0
windowTop = scrollY
if (shouldShow !== show) {
switchShow(shouldShow)

View File

@@ -3,7 +3,6 @@ import { useGlobal } from '@/lib/global'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faListOl } from '@fortawesome/free-solid-svg-icons'
let windowTop = 0
/**
* 点击召唤目录抽屉
* 当屏幕下滑500像素后会出现该控件
@@ -16,9 +15,7 @@ const TocDrawerButton = (props) => {
const [show, switchShow] = useState(false)
const scrollListener = () => {
const scrollY = window.pageYOffset
// const shouldShow = scrollY > 100 && scrollY < windowTop
const shouldShow = scrollY > 100
windowTop = scrollY
if (shouldShow !== show) {
switchShow(shouldShow)

View File

@@ -1,11 +1,9 @@
import { useRef } from 'react'
import SideBarDrawer from '@/components/SideBarDrawer'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import BLOG from '@/blog.config'
import Link from 'next/link'
import Image from 'next/image'
import { useGlobal } from '@/lib/global'
import { faSearch } from '@fortawesome/free-solid-svg-icons'
const TopNav = ({ tags, currentTag, post, posts, categories, currentCategory }) => {
const drawer = useRef()

View File

@@ -2,12 +2,9 @@ import { getAllCategories, getAllPosts, getAllTags } from '@/lib/notion'
import BLOG from '@/blog.config'
import BaseLayout from '@/layouts/BaseLayout'
import { getNotionPageData } from '@/lib/notion/getNotionData'
import StickyBar from '@/components/StickyBar'
import React, { useEffect } from 'react'
import { useGlobal } from '@/lib/global'
import BlogPostArchive from '@/components/BlogPostArchive'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faArchive } from '@fortawesome/free-solid-svg-icons'
export async function getStaticProps () {
const from = 'index'