feat(smart-app): implement complete mobile app MVP

- App.tsx: full navigation (Auth stack + Main tabs with 5 screens)
- Auth: LoginScreen, RegisterScreen, ForgotPasswordScreen
- HomeScreen: dashboard with IoT metrics, weather widget, alerts, quick actions, sensors
- MapScreen: interactive map with layer toggles (6 layers)
- MarketplaceScreen: categories (6), products (5), search
- ChatScreen: AI chat with quick prompts (4), bot responses
- ProfileScreen: user info, stats, menu (9 items), logout
- AlertsScreen: alert list with severity, acknowledge
- SensorsScreen: sensor list with type filters (6 types), search
- ZonesScreen: zone cards with stats
- SettingsScreen: language picker (FR/EN/ES/DE), privacy, about
- Stores: iotStore (sensors, zones, alerts), notificationStore, uiStore + i18n
- Hooks: useSensors, useAlerts, useNotifications, useLocation
- Components: Card, Button, LoadingSpinner, ErrorBoundary, Header
- Services: iotService, notificationService (with axios API client)
- Utils: formatters (temp, AQI, noise, dates), validators (email, password, IBAN)
- Theme: colors.ts with full design system (Blue Ocean palette)
- Ditto: fixed MongoDB connection, new JWT secrets, official gateway image
This commit is contained in:
Eric FELIXINE
2026-06-01 18:00:35 -04:00
parent 08ca495bde
commit e30ae8ed09
35578 changed files with 3703534 additions and 43 deletions

View File

@@ -0,0 +1,243 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = Header;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
var _getDefaultHeaderHeight = _interopRequireDefault(require("./getDefaultHeaderHeight"));
var _HeaderBackground = _interopRequireDefault(require("./HeaderBackground"));
var _HeaderShownContext = _interopRequireDefault(require("./HeaderShownContext"));
var _HeaderTitle = _interopRequireDefault(require("./HeaderTitle"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
const warnIfHeaderStylesDefined = styles => {
Object.keys(styles).forEach(styleProp => {
const value = styles[styleProp];
if (styleProp === 'position' && value === 'absolute') {
console.warn("position: 'absolute' is not supported on headerStyle. If you would like to render content under the header, use the 'headerTransparent' option.");
} else if (value !== undefined) {
console.warn(`${styleProp} was given a value of ${value}, this has no effect on headerStyle.`);
}
});
};
function Header(props) {
const insets = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
const frame = (0, _reactNativeSafeAreaContext.useSafeAreaFrame)();
const isParentHeaderShown = React.useContext(_HeaderShownContext.default);
// On models with Dynamic Island the status bar height is smaller than the safe area top inset.
const hasDynamicIsland = _reactNative.Platform.OS === 'ios' && insets.top > 50;
const statusBarHeight = hasDynamicIsland ? insets.top - 5 : insets.top;
const {
layout = frame,
modal = false,
title,
headerTitle: customTitle,
headerTitleAlign = _reactNative.Platform.select({
ios: 'center',
default: 'left'
}),
headerLeft,
headerLeftLabelVisible,
headerTransparent,
headerTintColor,
headerBackground,
headerRight,
headerTitleAllowFontScaling: titleAllowFontScaling,
headerTitleStyle: titleStyle,
headerLeftContainerStyle: leftContainerStyle,
headerRightContainerStyle: rightContainerStyle,
headerTitleContainerStyle: titleContainerStyle,
headerBackgroundContainerStyle: backgroundContainerStyle,
headerStyle: customHeaderStyle,
headerShadowVisible,
headerPressColor,
headerPressOpacity,
headerStatusBarHeight = isParentHeaderShown ? 0 : statusBarHeight
} = props;
const defaultHeight = (0, _getDefaultHeaderHeight.default)(layout, modal, headerStatusBarHeight);
const {
height = defaultHeight,
minHeight,
maxHeight,
backgroundColor,
borderBottomColor,
borderBottomEndRadius,
borderBottomLeftRadius,
borderBottomRightRadius,
borderBottomStartRadius,
borderBottomWidth,
borderColor,
borderEndColor,
borderEndWidth,
borderLeftColor,
borderLeftWidth,
borderRadius,
borderRightColor,
borderRightWidth,
borderStartColor,
borderStartWidth,
borderStyle,
borderTopColor,
borderTopEndRadius,
borderTopLeftRadius,
borderTopRightRadius,
borderTopStartRadius,
borderTopWidth,
borderWidth,
// @ts-expect-error: web support for shadow
boxShadow,
elevation,
shadowColor,
shadowOffset,
shadowOpacity,
shadowRadius,
opacity,
transform,
...unsafeStyles
} = _reactNative.StyleSheet.flatten(customHeaderStyle || {});
if (process.env.NODE_ENV !== 'production') {
warnIfHeaderStylesDefined(unsafeStyles);
}
const safeStyles = {
backgroundColor,
borderBottomColor,
borderBottomEndRadius,
borderBottomLeftRadius,
borderBottomRightRadius,
borderBottomStartRadius,
borderBottomWidth,
borderColor,
borderEndColor,
borderEndWidth,
borderLeftColor,
borderLeftWidth,
borderRadius,
borderRightColor,
borderRightWidth,
borderStartColor,
borderStartWidth,
borderStyle,
borderTopColor,
borderTopEndRadius,
borderTopLeftRadius,
borderTopRightRadius,
borderTopStartRadius,
borderTopWidth,
borderWidth,
// @ts-expect-error: boxShadow is only for Web
boxShadow,
elevation,
shadowColor,
shadowOffset,
shadowOpacity,
shadowRadius,
opacity,
transform
};
// Setting a property to undefined triggers default style
// So we need to filter them out
// Users can use `null` instead
for (const styleProp in safeStyles) {
// @ts-expect-error: typescript wrongly complains that styleProp cannot be used to index safeStyles
if (safeStyles[styleProp] === undefined) {
// @ts-expect-error
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete safeStyles[styleProp];
}
}
const backgroundStyle = [safeStyles, headerShadowVisible === false && {
elevation: 0,
shadowOpacity: 0,
borderBottomWidth: 0
}];
const leftButton = headerLeft ? headerLeft({
tintColor: headerTintColor,
pressColor: headerPressColor,
pressOpacity: headerPressOpacity,
labelVisible: headerLeftLabelVisible
}) : null;
const rightButton = headerRight ? headerRight({
tintColor: headerTintColor,
pressColor: headerPressColor,
pressOpacity: headerPressOpacity
}) : null;
const headerTitle = typeof customTitle !== 'function' ? props => /*#__PURE__*/React.createElement(_HeaderTitle.default, props) : customTitle;
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
pointerEvents: "box-none",
style: [_reactNative.StyleSheet.absoluteFill, {
zIndex: 0
}, backgroundContainerStyle]
}, headerBackground ? headerBackground({
style: backgroundStyle
}) : headerTransparent ? null : /*#__PURE__*/React.createElement(_HeaderBackground.default, {
style: backgroundStyle
})), /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
pointerEvents: "box-none",
style: [{
height,
minHeight,
maxHeight,
opacity,
transform
}]
}, /*#__PURE__*/React.createElement(_reactNative.View, {
pointerEvents: "none",
style: {
height: headerStatusBarHeight
}
}), /*#__PURE__*/React.createElement(_reactNative.View, {
pointerEvents: "box-none",
style: styles.content
}, /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
pointerEvents: "box-none",
style: [styles.left, headerTitleAlign === 'center' && styles.expand, {
marginStart: insets.left
}, leftContainerStyle]
}, leftButton), /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
pointerEvents: "box-none",
style: [styles.title, {
// Avoid the title from going offscreen or overlapping buttons
maxWidth: headerTitleAlign === 'center' ? layout.width - ((leftButton ? headerLeftLabelVisible !== false ? 80 : 32 : 16) + Math.max(insets.left, insets.right)) * 2 : layout.width - ((leftButton ? 72 : 16) + (rightButton ? 72 : 16) + insets.left - insets.right)
}, titleContainerStyle]
}, headerTitle({
children: title,
allowFontScaling: titleAllowFontScaling,
tintColor: headerTintColor,
style: titleStyle
})), /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
pointerEvents: "box-none",
style: [styles.right, styles.expand, {
marginEnd: insets.right
}, rightContainerStyle]
}, rightButton))));
}
const styles = _reactNative.StyleSheet.create({
content: {
flex: 1,
flexDirection: 'row',
alignItems: 'stretch'
},
title: {
marginHorizontal: 16,
justifyContent: 'center'
},
left: {
justifyContent: 'center',
alignItems: 'flex-start'
},
right: {
justifyContent: 'center',
alignItems: 'flex-end'
},
expand: {
flexGrow: 1,
flexBasis: 0
}
});
//# sourceMappingURL=Header.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,208 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = HeaderBackButton;
var _native = require("@react-navigation/native");
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _MaskedView = _interopRequireDefault(require("../MaskedView"));
var _PlatformPressable = _interopRequireDefault(require("../PlatformPressable"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function HeaderBackButton(_ref) {
let {
disabled,
allowFontScaling,
backImage,
label,
labelStyle,
labelVisible = _reactNative.Platform.OS === 'ios',
onLabelLayout,
onPress,
pressColor,
pressOpacity,
screenLayout,
tintColor: customTintColor,
titleLayout,
truncatedLabel = 'Back',
accessibilityLabel = label && label !== 'Back' ? `${label}, back` : 'Go back',
testID,
style
} = _ref;
const {
colors
} = (0, _native.useTheme)();
const [initialLabelWidth, setInitialLabelWidth] = React.useState(undefined);
const tintColor = customTintColor !== undefined ? customTintColor : _reactNative.Platform.select({
ios: colors.primary,
default: colors.text
});
const handleLabelLayout = e => {
onLabelLayout === null || onLabelLayout === void 0 ? void 0 : onLabelLayout(e);
setInitialLabelWidth(e.nativeEvent.layout.x + e.nativeEvent.layout.width);
};
const shouldTruncateLabel = () => {
return !label || initialLabelWidth && titleLayout && screenLayout && (screenLayout.width - titleLayout.width) / 2 < initialLabelWidth + 26;
};
const renderBackImage = () => {
if (backImage) {
return backImage({
tintColor
});
} else {
return /*#__PURE__*/React.createElement(_reactNative.Image, {
style: [styles.icon, Boolean(labelVisible) && styles.iconWithLabel, Boolean(tintColor) && {
tintColor
}],
source: require('../assets/back-icon.png'),
fadeDuration: 0
});
}
};
const renderLabel = () => {
const leftLabelText = shouldTruncateLabel() ? truncatedLabel : label;
if (!labelVisible || leftLabelText === undefined) {
return null;
}
const labelElement = /*#__PURE__*/React.createElement(_reactNative.View, {
style: screenLayout ?
// We make the button extend till the middle of the screen
// Otherwise it appears to cut off when translating
[styles.labelWrapper, {
minWidth: screenLayout.width / 2 - 27
}] : null
}, /*#__PURE__*/React.createElement(_reactNative.Animated.Text, {
accessible: false,
onLayout:
// This measurement is used to determine if we should truncate the label when it doesn't fit
// Only measure it when label is not truncated because we want the measurement of full label
leftLabelText === label ? handleLabelLayout : undefined,
style: [styles.label, tintColor ? {
color: tintColor
} : null, labelStyle],
numberOfLines: 1,
allowFontScaling: !!allowFontScaling
}, leftLabelText));
if (backImage || _reactNative.Platform.OS !== 'ios') {
// When a custom backimage is specified, we can't mask the label
// Otherwise there might be weird effect due to our mask not being the same as the image
return labelElement;
}
return /*#__PURE__*/React.createElement(_MaskedView.default, {
maskElement: /*#__PURE__*/React.createElement(_reactNative.View, {
style: styles.iconMaskContainer
}, /*#__PURE__*/React.createElement(_reactNative.Image, {
source: require('../assets/back-icon-mask.png'),
style: styles.iconMask
}), /*#__PURE__*/React.createElement(_reactNative.View, {
style: styles.iconMaskFillerRect
}))
}, labelElement);
};
const handlePress = () => onPress && requestAnimationFrame(onPress);
return /*#__PURE__*/React.createElement(_PlatformPressable.default, {
disabled: disabled,
accessible: true,
accessibilityRole: "button",
accessibilityLabel: accessibilityLabel,
testID: testID,
onPress: disabled ? undefined : handlePress,
pressColor: pressColor,
pressOpacity: pressOpacity,
android_ripple: androidRipple,
style: [styles.container, disabled && styles.disabled, style],
hitSlop: _reactNative.Platform.select({
ios: undefined,
default: {
top: 16,
right: 16,
bottom: 16,
left: 16
}
})
}, /*#__PURE__*/React.createElement(React.Fragment, null, renderBackImage(), renderLabel()));
}
const androidRipple = {
borderless: true,
foreground: _reactNative.Platform.OS === 'android' && _reactNative.Platform.Version >= 23,
radius: 20
};
const styles = _reactNative.StyleSheet.create({
container: {
alignItems: 'center',
flexDirection: 'row',
minWidth: _reactNative.StyleSheet.hairlineWidth,
// Avoid collapsing when title is long
..._reactNative.Platform.select({
ios: null,
default: {
marginVertical: 3,
marginHorizontal: 11
}
})
},
disabled: {
opacity: 0.5
},
label: {
fontSize: 17,
// Title and back label are a bit different width due to title being bold
// Adjusting the letterSpacing makes them coincide better
letterSpacing: 0.35
},
labelWrapper: {
// These styles will make sure that the label doesn't fill the available space
// Otherwise it messes with the measurement of the label
flexDirection: 'row',
alignItems: 'flex-start'
},
icon: _reactNative.Platform.select({
ios: {
height: 21,
width: 13,
marginLeft: 8,
marginRight: 22,
marginVertical: 12,
resizeMode: 'contain',
transform: [{
scaleX: _reactNative.I18nManager.getConstants().isRTL ? -1 : 1
}]
},
default: {
height: 24,
width: 24,
margin: 3,
resizeMode: 'contain',
transform: [{
scaleX: _reactNative.I18nManager.getConstants().isRTL ? -1 : 1
}]
}
}),
iconWithLabel: _reactNative.Platform.OS === 'ios' ? {
marginRight: 6
} : {},
iconMaskContainer: {
flex: 1,
flexDirection: 'row',
justifyContent: 'center'
},
iconMaskFillerRect: {
flex: 1,
backgroundColor: '#000'
},
iconMask: {
height: 21,
width: 13,
marginLeft: -14.5,
marginVertical: 12,
alignSelf: 'center',
resizeMode: 'contain',
transform: [{
scaleX: _reactNative.I18nManager.getConstants().isRTL ? -1 : 1
}]
}
});
//# sourceMappingURL=HeaderBackButton.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _getNamedContext = _interopRequireDefault(require("../getNamedContext"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const HeaderBackContext = (0, _getNamedContext.default)('HeaderBackContext', undefined);
var _default = HeaderBackContext;
exports.default = _default;
//# sourceMappingURL=HeaderBackContext.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["HeaderBackContext","getNamedContext","undefined"],"sourceRoot":"../../../src","sources":["Header/HeaderBackContext.tsx"],"mappings":";;;;;;AAAA;AAAiD;AAEjD,MAAMA,iBAAiB,GAAG,IAAAC,wBAAe,EACvC,mBAAmB,EACnBC,SAAS,CACV;AAAC,eAEaF,iBAAiB;AAAA"}

View File

@@ -0,0 +1,50 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = HeaderBackground;
var _native = require("@react-navigation/native");
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function HeaderBackground(_ref) {
let {
style,
...rest
} = _ref;
const {
colors
} = (0, _native.useTheme)();
return /*#__PURE__*/React.createElement(_reactNative.Animated.View, _extends({
style: [styles.container, {
backgroundColor: colors.card,
borderBottomColor: colors.border,
shadowColor: colors.border
}, style]
}, rest));
}
const styles = _reactNative.StyleSheet.create({
container: {
flex: 1,
..._reactNative.Platform.select({
android: {
elevation: 4
},
ios: {
shadowOpacity: 0.85,
shadowRadius: 0,
shadowOffset: {
width: 0,
height: _reactNative.StyleSheet.hairlineWidth
}
},
default: {
borderBottomWidth: _reactNative.StyleSheet.hairlineWidth
}
})
}
});
//# sourceMappingURL=HeaderBackground.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["HeaderBackground","style","rest","colors","useTheme","styles","container","backgroundColor","card","borderBottomColor","border","shadowColor","StyleSheet","create","flex","Platform","select","android","elevation","ios","shadowOpacity","shadowRadius","shadowOffset","width","height","hairlineWidth","default","borderBottomWidth"],"sourceRoot":"../../../src","sources":["Header/HeaderBackground.tsx"],"mappings":";;;;;;AAAA;AACA;AACA;AAOsB;AAAA;AAAA;AAOP,SAASA,gBAAgB,OAA4B;EAAA,IAA3B;IAAEC,KAAK;IAAE,GAAGC;EAAY,CAAC;EAChE,MAAM;IAAEC;EAAO,CAAC,GAAG,IAAAC,gBAAQ,GAAE;EAE7B,oBACE,oBAAC,qBAAQ,CAAC,IAAI;IACZ,KAAK,EAAE,CACLC,MAAM,CAACC,SAAS,EAChB;MACEC,eAAe,EAAEJ,MAAM,CAACK,IAAI;MAC5BC,iBAAiB,EAAEN,MAAM,CAACO,MAAM;MAChCC,WAAW,EAAER,MAAM,CAACO;IACtB,CAAC,EACDT,KAAK;EACL,GACEC,IAAI,EACR;AAEN;AAEA,MAAMG,MAAM,GAAGO,uBAAU,CAACC,MAAM,CAAC;EAC/BP,SAAS,EAAE;IACTQ,IAAI,EAAE,CAAC;IACP,GAAGC,qBAAQ,CAACC,MAAM,CAAC;MACjBC,OAAO,EAAE;QACPC,SAAS,EAAE;MACb,CAAC;MACDC,GAAG,EAAE;QACHC,aAAa,EAAE,IAAI;QACnBC,YAAY,EAAE,CAAC;QACfC,YAAY,EAAE;UACZC,KAAK,EAAE,CAAC;UACRC,MAAM,EAAEZ,uBAAU,CAACa;QACrB;MACF,CAAC;MACDC,OAAO,EAAE;QACPC,iBAAiB,EAAEf,uBAAU,CAACa;MAChC;IACF,CAAC;EACH;AACF,CAAC,CAAC"}

View File

@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _getNamedContext = _interopRequireDefault(require("../getNamedContext"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const HeaderHeightContext = (0, _getNamedContext.default)('HeaderHeightContext', undefined);
var _default = HeaderHeightContext;
exports.default = _default;
//# sourceMappingURL=HeaderHeightContext.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["HeaderHeightContext","getNamedContext","undefined"],"sourceRoot":"../../../src","sources":["Header/HeaderHeightContext.tsx"],"mappings":";;;;;;AAAA;AAAiD;AAEjD,MAAMA,mBAAmB,GAAG,IAAAC,wBAAe,EACzC,qBAAqB,EACrBC,SAAS,CACV;AAAC,eAEaF,mBAAmB;AAAA"}

View File

@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _getNamedContext = _interopRequireDefault(require("../getNamedContext"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const HeaderShownContext = (0, _getNamedContext.default)('HeaderShownContext', false);
var _default = HeaderShownContext;
exports.default = _default;
//# sourceMappingURL=HeaderShownContext.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["HeaderShownContext","getNamedContext"],"sourceRoot":"../../../src","sources":["Header/HeaderShownContext.tsx"],"mappings":";;;;;;AAAA;AAAiD;AAEjD,MAAMA,kBAAkB,GAAG,IAAAC,wBAAe,EAAC,oBAAoB,EAAE,KAAK,CAAC;AAAC,eAEzDD,kBAAkB;AAAA"}

View File

@@ -0,0 +1,49 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = HeaderTitle;
var _native = require("@react-navigation/native");
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function HeaderTitle(_ref) {
let {
tintColor,
style,
...rest
} = _ref;
const {
colors
} = (0, _native.useTheme)();
return /*#__PURE__*/React.createElement(_reactNative.Animated.Text, _extends({
accessibilityRole: "header",
"aria-level": "1",
numberOfLines: 1
}, rest, {
style: [styles.title, {
color: tintColor === undefined ? colors.text : tintColor
}, style]
}));
}
const styles = _reactNative.StyleSheet.create({
title: _reactNative.Platform.select({
ios: {
fontSize: 17,
fontWeight: '600'
},
android: {
fontSize: 20,
fontFamily: 'sans-serif-medium',
fontWeight: 'normal'
},
default: {
fontSize: 18,
fontWeight: '500'
}
})
});
//# sourceMappingURL=HeaderTitle.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["HeaderTitle","tintColor","style","rest","colors","useTheme","styles","title","color","undefined","text","StyleSheet","create","Platform","select","ios","fontSize","fontWeight","android","fontFamily","default"],"sourceRoot":"../../../src","sources":["Header/HeaderTitle.tsx"],"mappings":";;;;;;AAAA;AACA;AACA;AAOsB;AAAA;AAAA;AAOP,SAASA,WAAW,OAAuC;EAAA,IAAtC;IAAEC,SAAS;IAAEC,KAAK;IAAE,GAAGC;EAAY,CAAC;EACtE,MAAM;IAAEC;EAAO,CAAC,GAAG,IAAAC,gBAAQ,GAAE;EAE7B,oBACE,oBAAC,qBAAQ,CAAC,IAAI;IACZ,iBAAiB,EAAC,QAAQ;IAC1B,cAAW,GAAG;IACd,aAAa,EAAE;EAAE,GACbF,IAAI;IACR,KAAK,EAAE,CACLG,MAAM,CAACC,KAAK,EACZ;MAAEC,KAAK,EAAEP,SAAS,KAAKQ,SAAS,GAAGL,MAAM,CAACM,IAAI,GAAGT;IAAU,CAAC,EAC5DC,KAAK;EACL,GACF;AAEN;AAEA,MAAMI,MAAM,GAAGK,uBAAU,CAACC,MAAM,CAAC;EAC/BL,KAAK,EAAEM,qBAAQ,CAACC,MAAM,CAAC;IACrBC,GAAG,EAAE;MACHC,QAAQ,EAAE,EAAE;MACZC,UAAU,EAAE;IACd,CAAC;IACDC,OAAO,EAAE;MACPF,QAAQ,EAAE,EAAE;MACZG,UAAU,EAAE,mBAAmB;MAC/BF,UAAU,EAAE;IACd,CAAC;IACDG,OAAO,EAAE;MACPJ,QAAQ,EAAE,EAAE;MACZC,UAAU,EAAE;IACd;EACF,CAAC;AACH,CAAC,CAAC"}

View File

@@ -0,0 +1,36 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getDefaultHeaderHeight;
var _reactNative = require("react-native");
function getDefaultHeaderHeight(layout, modalPresentation, statusBarHeight) {
let headerHeight;
const isLandscape = layout.width > layout.height;
if (_reactNative.Platform.OS === 'ios') {
if (_reactNative.Platform.isPad || _reactNative.Platform.isTV) {
if (modalPresentation) {
headerHeight = 56;
} else {
headerHeight = 50;
}
} else {
if (isLandscape) {
headerHeight = 32;
} else {
if (modalPresentation) {
headerHeight = 56;
} else {
headerHeight = 44;
}
}
}
} else if (_reactNative.Platform.OS === 'android') {
headerHeight = 56;
} else {
headerHeight = 64;
}
return headerHeight + statusBarHeight;
}
//# sourceMappingURL=getDefaultHeaderHeight.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["getDefaultHeaderHeight","layout","modalPresentation","statusBarHeight","headerHeight","isLandscape","width","height","Platform","OS","isPad","isTV"],"sourceRoot":"../../../src","sources":["Header/getDefaultHeaderHeight.tsx"],"mappings":";;;;;;AAAA;AAIe,SAASA,sBAAsB,CAC5CC,MAAc,EACdC,iBAA0B,EAC1BC,eAAuB,EACf;EACR,IAAIC,YAAY;EAEhB,MAAMC,WAAW,GAAGJ,MAAM,CAACK,KAAK,GAAGL,MAAM,CAACM,MAAM;EAEhD,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;IACzB,IAAID,qBAAQ,CAACE,KAAK,IAAIF,qBAAQ,CAACG,IAAI,EAAE;MACnC,IAAIT,iBAAiB,EAAE;QACrBE,YAAY,GAAG,EAAE;MACnB,CAAC,MAAM;QACLA,YAAY,GAAG,EAAE;MACnB;IACF,CAAC,MAAM;MACL,IAAIC,WAAW,EAAE;QACfD,YAAY,GAAG,EAAE;MACnB,CAAC,MAAM;QACL,IAAIF,iBAAiB,EAAE;UACrBE,YAAY,GAAG,EAAE;QACnB,CAAC,MAAM;UACLA,YAAY,GAAG,EAAE;QACnB;MACF;IACF;EACF,CAAC,MAAM,IAAII,qBAAQ,CAACC,EAAE,KAAK,SAAS,EAAE;IACpCL,YAAY,GAAG,EAAE;EACnB,CAAC,MAAM;IACLA,YAAY,GAAG,EAAE;EACnB;EAEA,OAAOA,YAAY,GAAGD,eAAe;AACvC"}

View File

@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getHeaderTitle;
function getHeaderTitle(options, fallback) {
return typeof options.headerTitle === 'string' ? options.headerTitle : options.title !== undefined ? options.title : fallback;
}
//# sourceMappingURL=getHeaderTitle.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["getHeaderTitle","options","fallback","headerTitle","title","undefined"],"sourceRoot":"../../../src","sources":["Header/getHeaderTitle.tsx"],"mappings":";;;;;;AAEe,SAASA,cAAc,CACpCC,OAAuE,EACvEC,QAAgB,EACR;EACR,OAAO,OAAOD,OAAO,CAACE,WAAW,KAAK,QAAQ,GAC1CF,OAAO,CAACE,WAAW,GACnBF,OAAO,CAACG,KAAK,KAAKC,SAAS,GAC3BJ,OAAO,CAACG,KAAK,GACbF,QAAQ;AACd"}

View File

@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = useHeaderHeight;
var React = _interopRequireWildcard(require("react"));
var _HeaderHeightContext = _interopRequireDefault(require("./HeaderHeightContext"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function useHeaderHeight() {
const height = React.useContext(_HeaderHeightContext.default);
if (height === undefined) {
throw new Error("Couldn't find the header height. Are you inside a screen in a navigator with a header?");
}
return height;
}
//# sourceMappingURL=useHeaderHeight.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["useHeaderHeight","height","React","useContext","HeaderHeightContext","undefined","Error"],"sourceRoot":"../../../src","sources":["Header/useHeaderHeight.tsx"],"mappings":";;;;;;AAAA;AAEA;AAAwD;AAAA;AAAA;AAEzC,SAASA,eAAe,GAAG;EACxC,MAAMC,MAAM,GAAGC,KAAK,CAACC,UAAU,CAACC,4BAAmB,CAAC;EAEpD,IAAIH,MAAM,KAAKI,SAAS,EAAE;IACxB,MAAM,IAAIC,KAAK,CACb,wFAAwF,CACzF;EACH;EAEA,OAAOL,MAAM;AACf"}