theme-commerce

This commit is contained in:
tangly1024
2024-03-24 22:19:23 +08:00
parent 89dbf49cc8
commit 2bf1183be2
54 changed files with 2823 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
import CONFIG from '../config'
/**
* 跳转到评论区
* @returns {JSX.Element}
* @constructor
*/
const JumpToCommentButton = () => {
if (!CONFIG.WIDGET_TO_COMMENT) {
return <></>
}
function navToComment() {
if (document.getElementById('comment')) {
window.scrollTo({ top: document.getElementById('comment').offsetTop, behavior: 'smooth' })
}
// 兼容性不好
// const commentElement = document.getElementById('comment')
// if (commentElement) {
// commentElement?.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'nearest' })
}
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' />
</div>)
}
export default JumpToCommentButton