UNPKG

react-native-classic-header

Version:

Fully customizable Classic Header View for React Native

72 lines (71 loc) 2.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports._shadowStyle = exports._innerContainer = exports._container = void 0; const react_native_1 = require("react-native"); const react_native_helpers_1 = require("@freakycoder/react-native-helpers"); function _container(height, width, backgroundColor, statusBarHidden) { return { width: width || "100%", ...react_native_1.Platform.select({ ios: { top: 0, height: react_native_helpers_1.isIPhoneNotchFamily() ? height || 60 : height || (statusBarHidden ? 50 : 70), }, android: { top: 0, height: height || (statusBarHidden ? 60 : 70), }, }), backgroundColor: backgroundColor || "white", }; } exports._container = _container; function _innerContainer(statusBarHidden) { return { flexDirection: "row", alignItems: "center", justifyContent: "center", ...react_native_1.Platform.select({ ios: { top: react_native_helpers_1.isIPhoneNotchFamily() ? 16 : statusBarHidden ? 0 : 24, }, android: { top: statusBarHidden ? 16 : 24, }, }), }; } exports._innerContainer = _innerContainer; function _shadowStyle(shadowColor) { return { ...react_native_1.Platform.select({ ios: { shadowRadius: 5, shadowOpacity: 0.15, shadowOffset: { width: 1, height: 7 }, shadowColor: shadowColor || "#757575", }, android: { elevation: 6, }, }), }; } exports._shadowStyle = _shadowStyle; exports.default = react_native_1.StyleSheet.create({ leftComponentStyle: { left: 16, position: "absolute", }, rightComponentStyle: { right: 16, position: "absolute", }, titleTextStyle: { fontSize: 18, textAlign: "center", color: "rgba(110, 157, 251, 1.0)", }, });