UNPKG

@chayns-components/core

Version:

A set of beautiful React components for developing your own applications with chayns.

34 lines 767 B
import { getWindowMetrics, useWindowMetrics } from 'chayns-api'; export const getUsableHeight = async () => { let usableHeight; const { bottomBarHeight, offsetTop, windowHeight } = await getWindowMetrics(); usableHeight = windowHeight; if (bottomBarHeight) { usableHeight -= bottomBarHeight; } if (offsetTop) { usableHeight -= offsetTop; } return usableHeight; }; export const useUsableHeight = () => { let usableHeight; const { bottomBarHeight, offsetTop, windowHeight } = useWindowMetrics(); usableHeight = windowHeight; if (bottomBarHeight) { usableHeight -= bottomBarHeight; } if (offsetTop) { usableHeight -= offsetTop; } return usableHeight; }; //# sourceMappingURL=pageProvider.js.map