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,66 @@
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
import * as React from 'react';
import { NativeModules, Platform, Switch as NativeSwitch } from 'react-native';
import { getSwitchColor } from './utils';
import { useInternalTheme } from '../../core/theming';
const version = NativeModules.PlatformConstants ? NativeModules.PlatformConstants.reactNativeVersion : undefined;
/**
* Switch is a visual toggle between two mutually exclusive states — on and off.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { Switch } from 'react-native-paper';
*
* const MyComponent = () => {
* const [isSwitchOn, setIsSwitchOn] = React.useState(false);
*
* const onToggleSwitch = () => setIsSwitchOn(!isSwitchOn);
*
* return <Switch value={isSwitchOn} onValueChange={onToggleSwitch} />;
* };
*
* export default MyComponent;
* ```
*/
const Switch = ({
value,
disabled,
onValueChange,
color,
theme: themeOverrides,
...rest
}) => {
const theme = useInternalTheme(themeOverrides);
const {
checkedColor,
onTintColor,
thumbTintColor
} = getSwitchColor({
theme,
disabled,
value,
color
});
const props = version && version.major === 0 && version.minor <= 56 ? {
onTintColor,
thumbTintColor
} : Platform.OS === 'web' ? {
activeTrackColor: onTintColor,
thumbColor: thumbTintColor,
activeThumbColor: checkedColor
} : {
thumbColor: thumbTintColor,
trackColor: {
true: onTintColor,
false: onTintColor
}
};
return /*#__PURE__*/React.createElement(NativeSwitch, _extends({
value: value,
disabled: disabled,
onValueChange: disabled ? undefined : onValueChange
}, props, rest));
};
export default Switch;
//# sourceMappingURL=Switch.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","NativeModules","Platform","Switch","NativeSwitch","getSwitchColor","useInternalTheme","version","PlatformConstants","reactNativeVersion","undefined","value","disabled","onValueChange","color","theme","themeOverrides","rest","checkedColor","onTintColor","thumbTintColor","props","major","minor","OS","activeTrackColor","thumbColor","activeThumbColor","trackColor","true","false","createElement","_extends"],"sourceRoot":"../../../../src","sources":["components/Switch/Switch.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SACEC,aAAa,EACbC,QAAQ,EAERC,MAAM,IAAIC,YAAY,QAEjB,cAAc;AAErB,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,gBAAgB,QAAQ,oBAAoB;AAGrD,MAAMC,OAAO,GAAGN,aAAa,CAACO,iBAAiB,GAC3CP,aAAa,CAACO,iBAAiB,CAACC,kBAAkB,GAClDC,SAAS;AA0Bb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMP,MAAM,GAAGA,CAAC;EACdQ,KAAK;EACLC,QAAQ;EACRC,aAAa;EACbC,KAAK;EACLC,KAAK,EAAEC,cAAc;EACrB,GAAGC;AACE,CAAC,KAAK;EACX,MAAMF,KAAK,GAAGT,gBAAgB,CAACU,cAAc,CAAC;EAC9C,MAAM;IAAEE,YAAY;IAAEC,WAAW;IAAEC;EAAe,CAAC,GAAGf,cAAc,CAAC;IACnEU,KAAK;IACLH,QAAQ;IACRD,KAAK;IACLG;EACF,CAAC,CAAC;EAEF,MAAMO,KAAK,GACTd,OAAO,IAAIA,OAAO,CAACe,KAAK,KAAK,CAAC,IAAIf,OAAO,CAACgB,KAAK,IAAI,EAAE,GACjD;IACEJ,WAAW;IACXC;EACF,CAAC,GACDlB,QAAQ,CAACsB,EAAE,KAAK,KAAK,GACrB;IACEC,gBAAgB,EAAEN,WAAW;IAC7BO,UAAU,EAAEN,cAAc;IAC1BO,gBAAgB,EAAET;EACpB,CAAC,GACD;IACEQ,UAAU,EAAEN,cAAc;IAC1BQ,UAAU,EAAE;MACVC,IAAI,EAAEV,WAAW;MACjBW,KAAK,EAAEX;IACT;EACF,CAAC;EAEP,oBACEnB,KAAA,CAAA+B,aAAA,CAAC3B,YAAY,EAAA4B,QAAA;IACXrB,KAAK,EAAEA,KAAM;IACbC,QAAQ,EAAEA,QAAS;IACnBC,aAAa,EAAED,QAAQ,GAAGF,SAAS,GAAGG;EAAc,GAChDQ,KAAK,EACLJ,IAAI,CACT,CAAC;AAEN,CAAC;AAED,eAAed,MAAM","ignoreList":[]}

View File

@@ -0,0 +1,93 @@
import { Platform } from 'react-native';
import setColor from 'color';
import { grey400, grey800, grey50, grey700, white, black } from '../../styles/themes/v2/colors';
const getCheckedColor = ({
theme,
color
}) => {
if (color) {
return color;
}
if (theme.isV3) {
return theme.colors.primary;
}
return theme.colors.accent;
};
const getThumbTintColor = ({
theme,
disabled,
value,
checkedColor
}) => {
const isIOS = Platform.OS === 'ios';
if (isIOS) {
return undefined;
}
if (disabled) {
if (theme.dark) {
return grey800;
}
return grey400;
}
if (value) {
return checkedColor;
}
if (theme.dark) {
return grey400;
}
return grey50;
};
const getOnTintColor = ({
theme,
disabled,
value,
checkedColor
}) => {
const isIOS = Platform.OS === 'ios';
if (isIOS) {
return checkedColor;
}
if (disabled) {
if (theme.dark) {
if (theme.isV3) {
return setColor(white).alpha(0.06).rgb().string();
}
return setColor(white).alpha(0.1).rgb().string();
}
return setColor(black).alpha(0.12).rgb().string();
}
if (value) {
return setColor(checkedColor).alpha(0.5).rgb().string();
}
if (theme.dark) {
return grey700;
}
return 'rgb(178, 175, 177)';
};
export const getSwitchColor = ({
theme,
disabled,
value,
color
}) => {
const checkedColor = getCheckedColor({
theme,
color
});
return {
onTintColor: getOnTintColor({
theme,
disabled,
value,
checkedColor
}),
thumbTintColor: getThumbTintColor({
theme,
disabled,
value,
checkedColor
}),
checkedColor
};
};
//# sourceMappingURL=utils.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["Platform","setColor","grey400","grey800","grey50","grey700","white","black","getCheckedColor","theme","color","isV3","colors","primary","accent","getThumbTintColor","disabled","value","checkedColor","isIOS","OS","undefined","dark","getOnTintColor","alpha","rgb","string","getSwitchColor","onTintColor","thumbTintColor"],"sourceRoot":"../../../../src","sources":["components/Switch/utils.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,OAAOC,QAAQ,MAAM,OAAO;AAE5B,SACEC,OAAO,EACPC,OAAO,EACPC,MAAM,EACNC,OAAO,EACPC,KAAK,EACLC,KAAK,QACA,+BAA+B;AAStC,MAAMC,eAAe,GAAGA,CAAC;EACvBC,KAAK;EACLC;AAIF,CAAC,KAAK;EACJ,IAAIA,KAAK,EAAE;IACT,OAAOA,KAAK;EACd;EAEA,IAAID,KAAK,CAACE,IAAI,EAAE;IACd,OAAOF,KAAK,CAACG,MAAM,CAACC,OAAO;EAC7B;EAEA,OAAOJ,KAAK,CAACG,MAAM,CAACE,MAAM;AAC5B,CAAC;AAED,MAAMC,iBAAiB,GAAGA,CAAC;EACzBN,KAAK;EACLO,QAAQ;EACRC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