mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-19 23:16:48 +00:00
theme-commerce
This commit is contained in:
21
themes/commerce/components/TocDrawerButton.js
Normal file
21
themes/commerce/components/TocDrawerButton.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import { useGlobal } from '@/lib/global'
|
||||
import CONFIG from '../config'
|
||||
|
||||
/**
|
||||
* 点击召唤目录抽屉
|
||||
* 当屏幕下滑500像素后会出现该控件
|
||||
* @param props 父组件传入props
|
||||
* @returns {JSX.Element}
|
||||
* @constructor
|
||||
*/
|
||||
const TocDrawerButton = (props) => {
|
||||
const { locale } = useGlobal()
|
||||
if (!CONFIG.WIDGET_TOC) {
|
||||
return <></>
|
||||
}
|
||||
return (<div onClick={props.onClick} className='py-2 px-3 cursor-pointer transform duration-200 flex justify-center items-center w-7 h-7 text-center' title={locale.POST.TOP} >
|
||||
<i className='fas fa-list-ol text-xs'/>
|
||||
</div>)
|
||||
}
|
||||
|
||||
export default TocDrawerButton
|
||||
Reference in New Issue
Block a user