rn-custom-style-sheet
Version:
React Native component to select a specific value from a range of values.
53 lines (52 loc) • 2.44 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.initialThemeState = exports.ThemeContext = void 0;
var _react = require("react");
var _reactNative = require("react-native");
var _BreakPoint = require("../../BreakPoint");
var _Reducer = require("../Reducer");
var _Utils = require("../Utils");
const window = _reactNative.Dimensions.get('window');
const initialThemeState = exports.initialThemeState = {
appThemeName: '',
appThemeMode: _Reducer.AppThemeModeEnum.System,
systemThemeMode: _Reducer.AppThemeModeEnum.System,
orientation: _Reducer.OrientationEnum.Portrait,
isSupportedOrientation: false,
isUsedBuiltInAspectRatioFunction: false,
withPortraitBehaviorInLandscapeMode: false,
deviceForMediaQuery: undefined,
screenResolution: {
windowWidth: window.width,
windowHeight: window.height,
shortDimension: Math.min(window.width, window.height),
longDimension: Math.max(window.width, window.height)
},
guideLineLayout: {
width: 375,
height: 812
},
guideLineBreakpoint: {
values: _BreakPoint.breakpointValue,
unit: _Utils.UnitEnum.Px,
step: 0,
keys: Object.keys((0, _BreakPoint.sortBreakpointValues)(_BreakPoint.breakpointValue))
},
currentBreakpointIndex: -1,
generalScreenResolution: {
baseWidth: Math.min(window.width, window.height) / 375,
baseHeight: Math.max(window.width, window.height) / 812,
baseSizeRatio: (Math.min(window.width, window.height) / 375 + Math.max(window.width, window.height) / 812) / 2,
isTablet: _reactNative.Platform.OS === 'ios' && _reactNative.Platform.isPad || (Math.min(window.width, window.height) / 375 + Math.max(window.width, window.height) / 812) / 2 > 1.2,
threshold: _reactNative.Platform.OS === 'ios' && _reactNative.Platform.isPad || (Math.min(window.width, window.height) / 375 + Math.max(window.width, window.height) / 812) / 2 > 1.2 ? 0.4 : 0.5,
baseSizeWithThreshold: (Math.min(window.width, window.height) / 375 + Math.max(window.width, window.height) / 812) * (_reactNative.Platform.OS === 'ios' && _reactNative.Platform.isPad || (Math.min(window.width, window.height) / 375 + Math.max(window.width, window.height) / 812) / 2 > 1.2 ? 0.4 : 0.5)
}
};
const ThemeContext = exports.ThemeContext = /*#__PURE__*/(0, _react.createContext)({
state: initialThemeState,
dispatch: () => null,
storage: undefined
});
//# sourceMappingURL=ThemeContext.js.map