@crossed/sheet
Version:
A Cross Platform(Android & iOS) ActionSheet with a robust and flexible api, native performance and zero dependency code for react native. Create anything you want inside ActionSheet.
40 lines (39 loc) • 971 B
JavaScript
import { Platform, StatusBar } from "react-native";
function getDeviceHeight(statusBarTranslucent, heightProps) {
if (Platform.OS === "ios")
return heightProps;
const currentStatusbarHeight = StatusBar.currentHeight || 0;
const height = heightProps + currentStatusbarHeight - 3;
if (!statusBarTranslucent) {
return height - currentStatusbarHeight;
}
return height;
}
const getElevation = (elevation) => {
return {
elevation,
shadowColor: "black",
shadowOffset: { width: 0.3 * elevation, height: 0.5 * elevation },
shadowOpacity: 0.2,
shadowRadius: 0.7 * elevation
};
};
const SUPPORTED_ORIENTATIONS = [
"portrait",
"portrait-upside-down",
"landscape",
"landscape-left",
"landscape-right"
];
const waitAsync = (ms) => new Promise((resolve) => {
setTimeout(() => {
resolve(null);
}, ms);
});
export {
SUPPORTED_ORIENTATIONS,
getDeviceHeight,
getElevation,
waitAsync
};
//# sourceMappingURL=utils.js.map