- 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.4 KiB
JavaScript
52 lines
2.4 KiB
JavaScript
import * as React from 'react';
|
|
import { Keyboard, Platform } from 'react-native';
|
|
export default function useIsKeyboardShown({
|
|
onShow,
|
|
onHide
|
|
}) {
|
|
React.useEffect(() => {
|
|
let willShowSubscription;
|
|
let willHideSubscription;
|
|
let didShowSubscription;
|
|
let didHideSubscription;
|
|
if (Platform.OS === 'ios') {
|
|
willShowSubscription = Keyboard.addListener('keyboardWillShow', onShow);
|
|
willHideSubscription = Keyboard.addListener('keyboardWillHide', onHide);
|
|
} else {
|
|
didShowSubscription = Keyboard.addListener('keyboardDidShow', onShow);
|
|
didHideSubscription = Keyboard.addListener('keyboardDidHide', onHide);
|
|
}
|
|
return () => {
|
|
if (Platform.OS === 'ios') {
|
|
var _willShowSubscription, _willHideSubscription;
|
|
if ((_willShowSubscription = willShowSubscription) !== null && _willShowSubscription !== void 0 && _willShowSubscription.remove) {
|
|
willShowSubscription.remove();
|
|
} else {
|
|
// @ts-expect-error: We keep deprecated listener remove method for backwards compat with old RN versions
|
|
Keyboard.removeListener('keyboardWillShow', onShow);
|
|
}
|
|
if ((_willHideSubscription = willHideSubscription) !== null && _willHideSubscription !== void 0 && _willHideSubscription.remove) {
|
|
willHideSubscription.remove();
|
|
} else {
|
|
// @ts-expect-error: We keep deprecated listener remove method for backwards compat with old RN versions
|
|
Keyboard.removeListener('keyboardWillHide', onHide);
|
|
}
|
|
} else {
|
|
var _didShowSubscription, _didHideSubscription;
|
|
if ((_didShowSubscription = didShowSubscription) !== null && _didShowSubscription !== void 0 && _didShowSubscription.remove) {
|
|
didShowSubscription.remove();
|
|
} else {
|
|
// @ts-expect-error: We keep deprecated listener remove method for backwards compat with old RN versions
|
|
Keyboard.removeListener('keyboardDidShow', onShow);
|
|
}
|
|
if ((_didHideSubscription = didHideSubscription) !== null && _didHideSubscription !== void 0 && _didHideSubscription.remove) {
|
|
didHideSubscription.remove();
|
|
} else {
|
|
// @ts-expect-error: We keep deprecated listener remove method for backwards compat with old RN versions
|
|
Keyboard.removeListener('keyboardDidHide', onHide);
|
|
}
|
|
}
|
|
};
|
|
}, [onHide, onShow]);
|
|
}
|
|
//# sourceMappingURL=useIsKeyboardShown.js.map
|