init
This commit is contained in:
15
src/hooks/use-appshell-height.ts
Normal file
15
src/hooks/use-appshell-height.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { useMemo } from "react";
|
||||
import { useIsMobile } from "./use-is-mobile";
|
||||
import useHeaderConfig from "@/features/core/hooks/use-header-config";
|
||||
const useAppShellHeight = () => {
|
||||
const isMobile = useIsMobile();
|
||||
const headerConfig = useHeaderConfig();
|
||||
|
||||
const height = useMemo(() =>
|
||||
`calc(100dvh - var(--app-shell-header-height, 0px) - ${isMobile && !headerConfig.collapsed ? '4rem' : '0px'} - 1.285rem)`,
|
||||
[isMobile, headerConfig.collapsed]);
|
||||
|
||||
return height;
|
||||
}
|
||||
|
||||
export default useAppShellHeight;
|
||||
Reference in New Issue
Block a user