Files
Eric FELIXINE e30ae8ed09 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
2026-06-01 18:00:35 -04:00

86 lines
2.2 KiB
JavaScript

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
import type {ColorValue} from '../StyleSheet/StyleSheet';
import View from '../Components/View/View';
import normalizeColor from '../StyleSheet/normalizeColor';
import {type RectOrSize, normalizeRect} from '../StyleSheet/Rect';
import * as React from 'react';
type Props = $ReadOnly<{|
color: ColorValue,
hitSlop: ?RectOrSize,
|}>;
/**
* Displays a debug overlay to visualize press targets when enabled via the
* React Native Inspector. Calls to this module should be guarded by `__DEV__`,
* for example:
*
* return (
* <View>
* {children}
* {__DEV__ ? (
* <PressabilityDebugView color="..." hitSlop={props.hitSlop} />
* ) : null}
* </View>
* );
*
*/
export function PressabilityDebugView(props: Props): React.Node {
if (__DEV__) {
if (isEnabled()) {
const normalizedColor = normalizeColor(props.color);
if (typeof normalizedColor !== 'number') {
return null;
}
const baseColor =
'#' + (normalizedColor ?? 0).toString(16).padStart(8, '0');
const hitSlop = normalizeRect(props.hitSlop);
return (
<View
pointerEvents="none"
style={
// eslint-disable-next-line react-native/no-inline-styles
{
backgroundColor: baseColor.slice(0, -2) + '0F', // 15%
borderColor: baseColor.slice(0, -2) + '55', // 85%
borderStyle: 'dashed',
borderWidth: 1,
bottom: -(hitSlop?.bottom ?? 0),
left: -(hitSlop?.left ?? 0),
position: 'absolute',
right: -(hitSlop?.right ?? 0),
top: -(hitSlop?.top ?? 0),
}
}
/>
);
}
}
return null;
}
let isDebugEnabled = false;
export function isEnabled(): boolean {
if (__DEV__) {
return isDebugEnabled;
}
return false;
}
export function setEnabled(value: boolean): void {
if (__DEV__) {
isDebugEnabled = value;
}
}