Optimize layout and stylesheet
This commit is contained in:
@@ -1,33 +1,18 @@
|
||||
import { PropsWithChildren } from 'react'
|
||||
import HideScrollbar, { HideScrollbarElement } from '@/components/common/HideScrollbar'
|
||||
|
||||
export interface SidebarScrollElement {
|
||||
refreshLayout(): void
|
||||
}
|
||||
|
||||
const Scroll = forwardRef<SidebarScrollElement, PropsWithChildren>((props, ref) => {
|
||||
useImperativeHandle<SidebarScrollElement, SidebarScrollElement>(ref, () => {
|
||||
return {
|
||||
refreshLayout() {
|
||||
hideScrollbarRef.current?.refreshLayout()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const hideScrollbarRef = useRef<HideScrollbarElement>(null)
|
||||
import HideScrollbar from '@/components/common/HideScrollbar'
|
||||
|
||||
const Scroll = (props: PropsWithChildren) => {
|
||||
return (
|
||||
<div className={'scroll'}>
|
||||
<HideScrollbar
|
||||
isShowVerticalScrollbar={true}
|
||||
scrollbarWidth={2}
|
||||
autoHideWaitingTime={800}
|
||||
ref={hideScrollbarRef}
|
||||
>
|
||||
{props.children}
|
||||
</HideScrollbar>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
export default Scroll
|
||||
|
||||
Reference in New Issue
Block a user