Rename MainFramework to HomeFramework. Move tools to independent path.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React from 'react'
|
||||
import '@/assets/css/components/home/home.scss'
|
||||
import FitFullScreen from '@/components/common/FitFullScreen'
|
||||
import { MainFrameworkContext } from '@/pages/MainFramework'
|
||||
import { HomeFrameworkContext } from '@/pages/HomeFramework'
|
||||
import Slogan from '@/components/home/Slogan'
|
||||
import OxygenToolbox from '@/components/home/OxygenToolbox'
|
||||
import Indicator from '@/components/common/Indicator'
|
||||
@@ -13,7 +13,7 @@ const Home: React.FC = () => {
|
||||
navbarHiddenState: { navbarHidden, setNavbarHidden },
|
||||
showDropdownMenuState: { setShowDropdownMenu },
|
||||
preventScrollState: { setPreventScroll }
|
||||
} = useContext(MainFrameworkContext)
|
||||
} = useContext(HomeFrameworkContext)
|
||||
|
||||
const fitFullScreenRef = useRef<HTMLDivElement>(null)
|
||||
const scrollTimeout = useRef(0)
|
||||
|
||||
@@ -7,7 +7,7 @@ import Icon from '@ant-design/icons'
|
||||
import { COLOR_FONT_SECONDARY } from '@/constants/Common.constants.ts'
|
||||
import { NavLink } from 'react-router-dom'
|
||||
|
||||
export const MainFrameworkContext = createContext<{
|
||||
export const HomeFrameworkContext = createContext<{
|
||||
navbarHiddenState: {
|
||||
navbarHidden: boolean
|
||||
setNavbarHidden: (newValue: boolean) => void
|
||||
@@ -53,7 +53,7 @@ export const MainFrameworkContext = createContext<{
|
||||
hideScrollbarRef: createRef()
|
||||
})
|
||||
|
||||
const MainFramework: React.FC = () => {
|
||||
const HomeFramework: React.FC = () => {
|
||||
const routeId = useMatches()[1].id
|
||||
const routeChildren = router.routes[0].children?.find((value) => value.id === routeId)?.children
|
||||
|
||||
@@ -187,7 +187,7 @@ const MainFramework: React.FC = () => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<MainFrameworkContext.Provider
|
||||
<HomeFrameworkContext.Provider
|
||||
value={{
|
||||
navbarHiddenState: { navbarHidden, setNavbarHidden },
|
||||
preventScrollState: { preventScroll, setPreventScroll },
|
||||
@@ -215,11 +215,11 @@ const MainFramework: React.FC = () => {
|
||||
>
|
||||
<Outlet />
|
||||
</Suspense>
|
||||
</MainFrameworkContext.Provider>
|
||||
</HomeFrameworkContext.Provider>
|
||||
</div>
|
||||
</HideScrollbar>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default MainFramework
|
||||
export default HomeFramework
|
||||
Reference in New Issue
Block a user