Add scrollbar to HideScrollbar (in development)
This commit is contained in:
@@ -13,17 +13,33 @@ export const MainFrameworkContext = createContext<{
|
||||
preventScroll: boolean
|
||||
setPreventScroll: (newValue: boolean) => void
|
||||
}
|
||||
showVerticalScrollbarState: {
|
||||
showVerticalScrollbar: boolean
|
||||
setShowVerticalScrollbar: (newValue: boolean) => void
|
||||
}
|
||||
showHorizontalScrollbarState: {
|
||||
showHorizontalScrollbar: boolean
|
||||
setShowHorizontalScrollbar: (newValue: boolean) => void
|
||||
}
|
||||
hideScrollbarRef: React.RefObject<HideScrollbarElement>
|
||||
}>({
|
||||
navbarHiddenState: {
|
||||
navbarHidden: false,
|
||||
setNavbarHidden: () => undefined
|
||||
},
|
||||
hideScrollbarRef: createRef(),
|
||||
preventScrollState: {
|
||||
preventScroll: false,
|
||||
setPreventScroll: () => undefined
|
||||
}
|
||||
},
|
||||
showVerticalScrollbarState: {
|
||||
showVerticalScrollbar: false,
|
||||
setShowVerticalScrollbar: () => undefined
|
||||
},
|
||||
showHorizontalScrollbarState: {
|
||||
showHorizontalScrollbar: false,
|
||||
setShowHorizontalScrollbar: () => undefined
|
||||
},
|
||||
hideScrollbarRef: createRef()
|
||||
})
|
||||
|
||||
const MainFramework: React.FC = () => {
|
||||
@@ -36,6 +52,8 @@ const MainFramework: React.FC = () => {
|
||||
|
||||
const [navbarHidden, setNavbarHidden] = useState(true)
|
||||
const [preventScroll, setPreventScroll] = useState(false)
|
||||
const [showVerticalScrollbar, setShowVerticalScrollbar] = useState(false)
|
||||
const [showHorizontalScrollbar, setShowHorizontalScrollbar] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
setNavbarHidden(false)
|
||||
@@ -73,6 +91,14 @@ const MainFramework: React.FC = () => {
|
||||
value={{
|
||||
navbarHiddenState: { navbarHidden, setNavbarHidden },
|
||||
preventScrollState: { preventScroll, setPreventScroll },
|
||||
showVerticalScrollbarState: {
|
||||
showVerticalScrollbar,
|
||||
setShowVerticalScrollbar
|
||||
},
|
||||
showHorizontalScrollbarState: {
|
||||
showHorizontalScrollbar,
|
||||
setShowHorizontalScrollbar
|
||||
},
|
||||
hideScrollbarRef
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user