UNPKG

@chayns-components/core

Version:

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

42 lines (41 loc) 986 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.useUsableHeight = exports.getUsableHeight = void 0; var _chaynsApi = require("chayns-api"); const getUsableHeight = async () => { let usableHeight; const { bottomBarHeight, offsetTop, windowHeight } = await (0, _chaynsApi.getWindowMetrics)(); usableHeight = windowHeight; if (bottomBarHeight) { usableHeight -= bottomBarHeight; } if (offsetTop) { usableHeight -= offsetTop; } return usableHeight; }; exports.getUsableHeight = getUsableHeight; const useUsableHeight = () => { let usableHeight; const { bottomBarHeight, offsetTop, windowHeight } = (0, _chaynsApi.useWindowMetrics)(); usableHeight = windowHeight; if (bottomBarHeight) { usableHeight -= bottomBarHeight; } if (offsetTop) { usableHeight -= offsetTop; } return usableHeight; }; exports.useUsableHeight = useUsableHeight; //# sourceMappingURL=pageProvider.js.map