回顶按钮

This commit is contained in:
tangly1024
2022-02-15 11:31:14 +08:00
parent ad736e1ef9
commit 6c8c0133fd
5 changed files with 9 additions and 10 deletions

View File

@@ -12,12 +12,12 @@ import CONFIG_MEDIUM from '../config_medium'
* @returns {JSX.Element}
* @constructor
*/
const JumpToTopButton = ({ showPercent = false, percent }) => {
const JumpToTopButton = ({ showPercent = false, percent, className }) => {
if (!CONFIG_MEDIUM.WIDGET_TO_TOP) {
return <></>
}
const { locale } = useGlobal()
return (<div className='flex space-x-1 items-center cursor-pointer' onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })} >
return (<div className={'flex space-x-1 items-center cursor-pointer w-full justify-center ' + className } onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })} >
<div title={locale.POST.TOP} >
<FontAwesomeIcon icon={faArrowUp} />
</div>