mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-06 15:10:29 +00:00
跳到评论区
This commit is contained in:
4
.github/ISSUE_TEMPLATE/bug_report.md
vendored
4
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: Bug report
|
name: Bug report (Bug反馈)
|
||||||
about: Create a report to help Nobelium get better.
|
about: Create a report to help Nobelium get better.
|
||||||
title: ''
|
title: ''
|
||||||
labels: bug
|
labels: bug
|
||||||
assignees: craigary
|
assignees: tangly1024
|
||||||
---
|
---
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
6
.github/ISSUE_TEMPLATE/deployment-error.md
vendored
6
.github/ISSUE_TEMPLATE/deployment-error.md
vendored
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: Deployment error
|
name: Deployment error (部署错误)
|
||||||
about: Do you need help to install Nobelium?
|
about: Do you need help to install NotionNext?
|
||||||
title: ''
|
title: ''
|
||||||
labels: deployment
|
labels: deployment
|
||||||
assignees: craigary
|
assignees: tangly1024
|
||||||
---
|
---
|
||||||
|
|||||||
4
.github/ISSUE_TEMPLATE/feature_request.md
vendored
4
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: Feature request
|
name: Feature request (新特性建议)
|
||||||
about: Suggest an idea for Nobelium.
|
about: Suggest an idea for Nobelium.
|
||||||
title: ''
|
title: ''
|
||||||
labels: enhancement
|
labels: enhancement
|
||||||
assignees: craigary
|
assignees: tangly1024
|
||||||
---
|
---
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import React, { useEffect } from 'react'
|
import React from 'react'
|
||||||
import CONFIG_HEXO from '../config_hexo'
|
import CONFIG_HEXO from '../config_hexo'
|
||||||
let wrapperTop = 0
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 跳转到评论区
|
* 跳转到评论区
|
||||||
@@ -12,26 +11,16 @@ const JumpToCommentButton = () => {
|
|||||||
return <></>
|
return <></>
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateHeaderHeight() {
|
|
||||||
setTimeout(() => {
|
|
||||||
if (window) {
|
|
||||||
const wrapperElement = document.getElementById('comment')
|
|
||||||
wrapperTop = wrapperElement?.offsetTop
|
|
||||||
}
|
|
||||||
}, 500)
|
|
||||||
}
|
|
||||||
function navToComment() {
|
function navToComment() {
|
||||||
window.scrollTo({ top: wrapperTop, behavior: 'smooth' })
|
if (document.getElementById('comment')) {
|
||||||
|
window.scrollTo({ top: document.getElementById('comment').offsetTop, behavior: 'smooth' })
|
||||||
|
}
|
||||||
// 兼容性不好
|
// 兼容性不好
|
||||||
// const commentElement = document.getElementById('comment')
|
// const commentElement = document.getElementById('comment')
|
||||||
// if (commentElement) {
|
// if (commentElement) {
|
||||||
// commentElement?.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'nearest' })
|
// commentElement?.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'nearest' })
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
updateHeaderHeight()
|
|
||||||
})
|
|
||||||
|
|
||||||
return (<div className='flex space-x-1 items-center justify-center transform hover:scale-105 duration-200 w-7 h-7 text-center' onClick={navToComment} >
|
return (<div className='flex space-x-1 items-center justify-center transform hover:scale-105 duration-200 w-7 h-7 text-center' onClick={navToComment} >
|
||||||
<i className='fas fa-comment text-xs' />
|
<i className='fas fa-comment text-xs' />
|
||||||
</div>)
|
</div>)
|
||||||
|
|||||||
Reference in New Issue
Block a user