- 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
52 lines
2.1 KiB
JavaScript
52 lines
2.1 KiB
JavaScript
import * as Font from 'expo-font';
|
|
import React from 'react';
|
|
import { Text, } from 'react-native';
|
|
import createIconSet from './vendor/react-native-vector-icons/lib/create-icon-set';
|
|
import createIconButtonComponent from './vendor/react-native-vector-icons/lib/icon-button';
|
|
export { DEFAULT_ICON_COLOR, DEFAULT_ICON_SIZE, } from './vendor/react-native-vector-icons/lib/create-icon-set';
|
|
export default function (glyphMap, fontName, expoAssetId, fontStyle) {
|
|
const font = { [fontName]: expoAssetId };
|
|
const RNVIconComponent = createIconSet(glyphMap, fontName, null, fontStyle);
|
|
return class Icon extends React.Component {
|
|
static defaultProps = RNVIconComponent.defaultProps;
|
|
static Button = createIconButtonComponent(Icon);
|
|
static glyphMap = glyphMap;
|
|
static getRawGlyphMap = () => glyphMap;
|
|
static getFontFamily = () => fontName;
|
|
static loadFont = () => Font.loadAsync(font);
|
|
static font = font;
|
|
_mounted = false;
|
|
_icon;
|
|
state = {
|
|
fontIsLoaded: Font.isLoaded(fontName),
|
|
};
|
|
async componentDidMount() {
|
|
this._mounted = true;
|
|
if (!this.state.fontIsLoaded) {
|
|
await Font.loadAsync(font);
|
|
/* eslint-disable react/no-did-mount-set-state */
|
|
this._mounted && this.setState({ fontIsLoaded: true });
|
|
}
|
|
}
|
|
componentWillUnmount() {
|
|
this._mounted = false;
|
|
}
|
|
setNativeProps(props) {
|
|
if (this._icon) {
|
|
this._icon.setNativeProps(props);
|
|
}
|
|
}
|
|
render() {
|
|
if (__DEV__ && this.props.name && !(this.props.name in glyphMap)) {
|
|
console.warn(`"${this.props.name}" is not a valid icon name for family "${fontName}"`);
|
|
}
|
|
if (!this.state.fontIsLoaded) {
|
|
return <Text />;
|
|
}
|
|
return (<RNVIconComponent ref={(view) => {
|
|
this._icon = view;
|
|
}} {...this.props}/>);
|
|
}
|
|
};
|
|
}
|
|
//# sourceMappingURL=createIconSet.js.map
|