- 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
58 lines
1.6 KiB
JavaScript
58 lines
1.6 KiB
JavaScript
import { Animated } from 'react-native';
|
|
import color from 'color';
|
|
import { MD2DarkTheme } from './themes/v2/DarkTheme';
|
|
export const isAnimatedValue = it => it instanceof Animated.Value;
|
|
export default function overlay(elevation, surfaceColor = (_MD2DarkTheme$colors => (_MD2DarkTheme$colors = MD2DarkTheme.colors) === null || _MD2DarkTheme$colors === void 0 ? void 0 : _MD2DarkTheme$colors.surface)()) {
|
|
if (isAnimatedValue(elevation)) {
|
|
const inputRange = [0, 1, 2, 3, 8, 24];
|
|
|
|
// @ts-expect-error: TS doesn't seem to refine the type correctly
|
|
return elevation.interpolate({
|
|
inputRange,
|
|
outputRange: inputRange.map(elevation => {
|
|
return calculateColor(surfaceColor, elevation);
|
|
})
|
|
});
|
|
}
|
|
|
|
// @ts-expect-error: TS doesn't seem to refine the type correctly
|
|
return calculateColor(surfaceColor, elevation);
|
|
}
|
|
function calculateColor(surfaceColor, elevation = 1) {
|
|
let overlayTransparency;
|
|
if (elevation >= 1 && elevation <= 24) {
|
|
overlayTransparency = elevationOverlayTransparency[elevation];
|
|
} else if (elevation > 24) {
|
|
overlayTransparency = elevationOverlayTransparency[24];
|
|
} else {
|
|
overlayTransparency = elevationOverlayTransparency[1];
|
|
}
|
|
return color(surfaceColor).mix(color('white'), overlayTransparency * 0.01).hex();
|
|
}
|
|
const elevationOverlayTransparency = {
|
|
1: 5,
|
|
2: 7,
|
|
3: 8,
|
|
4: 9,
|
|
5: 10,
|
|
6: 11,
|
|
7: 11.5,
|
|
8: 12,
|
|
9: 12.5,
|
|
10: 13,
|
|
11: 13.5,
|
|
12: 14,
|
|
13: 14.25,
|
|
14: 14.5,
|
|
15: 14.75,
|
|
16: 15,
|
|
17: 15.12,
|
|
18: 15.24,
|
|
19: 15.36,
|
|
20: 15.48,
|
|
21: 15.6,
|
|
22: 15.72,
|
|
23: 15.84,
|
|
24: 16
|
|
};
|
|
//# sourceMappingURL=overlay.js.map
|