- 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
48 lines
2.8 KiB
JavaScript
48 lines
2.8 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.withAndroidImagePickerPermissions = void 0;
|
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
const pkg = require('expo-image-picker/package.json');
|
|
const CAMERA_USAGE = 'Allow $(PRODUCT_NAME) to access your camera';
|
|
const MICROPHONE_USAGE = 'Allow $(PRODUCT_NAME) to access your microphone';
|
|
const READ_PHOTOS_USAGE = 'Allow $(PRODUCT_NAME) to access your photos';
|
|
const withAndroidImagePickerPermissions = (config, { cameraPermission, microphonePermission } = {}) => {
|
|
if (microphonePermission !== false) {
|
|
config = config_plugins_1.AndroidConfig.Permissions.withPermissions(config, ['android.permission.RECORD_AUDIO']);
|
|
}
|
|
// If the user manually sets any of the permissions to `false`, then we should block the permissions to ensure no
|
|
// package can add them.
|
|
config = config_plugins_1.AndroidConfig.Permissions.withBlockedPermissions(config, [
|
|
microphonePermission === false && 'android.permission.RECORD_AUDIO',
|
|
cameraPermission === false && 'android.permission.CAMERA',
|
|
].filter(Boolean));
|
|
// NOTE(EvanBacon): It's unclear if we should block the WRITE_EXTERNAL_STORAGE/READ_EXTERNAL_STORAGE permissions since
|
|
// they're used for many other things besides image picker.
|
|
return config;
|
|
};
|
|
exports.withAndroidImagePickerPermissions = withAndroidImagePickerPermissions;
|
|
const withImagePicker = (config, { photosPermission, cameraPermission, microphonePermission } = {}) => {
|
|
config_plugins_1.IOSConfig.Permissions.createPermissionsPlugin({
|
|
NSPhotoLibraryUsageDescription: READ_PHOTOS_USAGE,
|
|
NSCameraUsageDescription: CAMERA_USAGE,
|
|
NSMicrophoneUsageDescription: MICROPHONE_USAGE,
|
|
})(config, {
|
|
NSPhotoLibraryUsageDescription: photosPermission,
|
|
NSCameraUsageDescription: cameraPermission,
|
|
NSMicrophoneUsageDescription: microphonePermission,
|
|
});
|
|
if (microphonePermission !== false) {
|
|
config = config_plugins_1.AndroidConfig.Permissions.withPermissions(config, ['android.permission.RECORD_AUDIO']);
|
|
}
|
|
// If the user manually sets any of the permissions to `false`, then we should block the permissions to ensure no
|
|
// package can add them.
|
|
config = config_plugins_1.AndroidConfig.Permissions.withBlockedPermissions(config, [
|
|
microphonePermission === false && 'android.permission.RECORD_AUDIO',
|
|
cameraPermission === false && 'android.permission.CAMERA',
|
|
].filter(Boolean));
|
|
// NOTE(EvanBacon): It's unclear if we should block the WRITE_EXTERNAL_STORAGE/READ_EXTERNAL_STORAGE permissions since
|
|
// they're used for many other things besides image picker.
|
|
return config;
|
|
};
|
|
exports.default = (0, config_plugins_1.createRunOncePlugin)(withImagePicker, pkg.name, pkg.version);
|