mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-16 15:09:28 +00:00
28 lines
758 B
JavaScript
28 lines
758 B
JavaScript
import React from 'react'
|
|
import CONFIG_MATERY from '../config_matery'
|
|
|
|
/**
|
|
* 跳转到评论区
|
|
* @returns {JSX.Element}
|
|
* @constructor
|
|
*/
|
|
const JumpToCommentButton = () => {
|
|
if (!CONFIG_MATERY.WIDGET_TO_COMMENT) {
|
|
return <></>
|
|
}
|
|
|
|
function navToComment() {
|
|
if (document.getElementById('comment')) {
|
|
window.scrollTo({ top: document.getElementById('comment').offsetTop, behavior: 'smooth' })
|
|
}
|
|
}
|
|
|
|
return (<div
|
|
onClick={navToComment}
|
|
className='flex space-x-1 items-center justify-center cursor-pointer transform hover:scale-105 duration-200 w-7 h-7 text-center'>
|
|
<i className='fas fa-comments text-xl text-white bg-indigo-700 py-3 px-2 rounded-full' />
|
|
</div>)
|
|
}
|
|
|
|
export default JumpToCommentButton
|