- 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
65 lines
1.9 KiB
JavaScript
65 lines
1.9 KiB
JavaScript
/**
|
|
* @hidden
|
|
*
|
|
* Does any required processing of a notification response from native code
|
|
* before it is passed to a notification response listener, or to the
|
|
* last notification response hook.
|
|
*
|
|
* @param response The raw response passed in from native code
|
|
* @returns the mapped response.
|
|
*/
|
|
export const mapNotificationResponse = (response) => {
|
|
return {
|
|
...response,
|
|
notification: mapNotification(response.notification),
|
|
};
|
|
};
|
|
/**
|
|
* @hidden
|
|
*
|
|
* Does any required processing of a notification from native code
|
|
* before it is passed to a notification listener.
|
|
*
|
|
* @param notification The raw notification passed in from native code
|
|
* @returns the mapped notification.
|
|
*/
|
|
export const mapNotification = (notification) => ({
|
|
...notification,
|
|
request: mapNotificationRequest(notification.request),
|
|
});
|
|
/**
|
|
* @hidden
|
|
*
|
|
* Does any required processing of a notification request from native code
|
|
* before it is passed to other JS code.
|
|
*
|
|
* @param request The raw request passed in from native code
|
|
* @returns the mapped request.
|
|
*/
|
|
export const mapNotificationRequest = (request) => ({
|
|
...request,
|
|
content: mapNotificationContent(request.content),
|
|
});
|
|
/**
|
|
* @hidden
|
|
* Does any required processing of notification content from native code
|
|
* before being passed to other JS code.
|
|
*
|
|
* @param content The raw content passed in from native code
|
|
* @returns the mapped content.
|
|
*/
|
|
export const mapNotificationContent = (content) => {
|
|
const mappedContent = { ...content };
|
|
try {
|
|
const dataString = mappedContent['dataString'];
|
|
if (typeof dataString === 'string') {
|
|
mappedContent.data = JSON.parse(dataString);
|
|
delete mappedContent.dataString;
|
|
}
|
|
}
|
|
catch (e) {
|
|
console.log(`Error in notification: ${e}`);
|
|
}
|
|
return mappedContent;
|
|
};
|
|
//# sourceMappingURL=mapNotificationResponse.js.map
|