router config changes
This commit is contained in:
@@ -1,18 +1,19 @@
|
||||
import { useMemo } from "react";
|
||||
import { useIsMobile } from "./use-is-mobile";
|
||||
import useHeaderConfig from "@/features/core/hooks/use-header-config";
|
||||
import useRouterConfig from "@/features/core/hooks/use-router-config";
|
||||
|
||||
const useAppShellHeight = () => {
|
||||
const isMobile = useIsMobile();
|
||||
const headerConfig = useHeaderConfig();
|
||||
const { header } = useRouterConfig();
|
||||
|
||||
const height = useMemo(() => {
|
||||
const appShellBottomPadding = isMobile ? '70px' : '0px';
|
||||
const pageBottomPadding = '20px';
|
||||
const mobileNavbar = isMobile && !headerConfig.collapsed ? '4rem' : '0px';
|
||||
const mobileNavbar = isMobile && !header.collapsed ? '4rem' : '0px';
|
||||
const pullablePadding = '1.285rem';
|
||||
|
||||
return `calc(100dvh - var(--app-shell-header-height, 0px) - ${mobileNavbar} - ${pullablePadding} - ${appShellBottomPadding} - ${pageBottomPadding})`;
|
||||
}, [isMobile, headerConfig.collapsed]);
|
||||
}, [isMobile, header.collapsed]);
|
||||
|
||||
return height;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user