mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-13 23:16:47 +00:00
bugfix:
编译修复
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user