- 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
46 lines
1.5 KiB
JavaScript
46 lines
1.5 KiB
JavaScript
import { CurrentRenderContext } from '@react-navigation/core';
|
|
import * as React from 'react';
|
|
import ServerContext from './ServerContext';
|
|
/**
|
|
* Container component for server rendering.
|
|
*
|
|
* @param props.location Location object to base the initial URL for SSR.
|
|
* @param props.children Child elements to render the content.
|
|
* @param props.ref Ref object which contains helper methods.
|
|
*/
|
|
export default /*#__PURE__*/React.forwardRef(function ServerContainer(_ref, ref) {
|
|
let {
|
|
children,
|
|
location
|
|
} = _ref;
|
|
React.useEffect(() => {
|
|
console.error("'ServerContainer' should only be used on the server with 'react-dom/server' for SSR.");
|
|
}, []);
|
|
const current = {};
|
|
if (ref) {
|
|
const value = {
|
|
getCurrentOptions() {
|
|
return current.options;
|
|
}
|
|
};
|
|
|
|
// We write to the `ref` during render instead of `React.useImperativeHandle`
|
|
// This is because `useImperativeHandle` will update the ref after 'commit',
|
|
// and there's no 'commit' phase during SSR.
|
|
// Mutating ref during render is unsafe in concurrent mode, but we don't care about it for SSR.
|
|
if (typeof ref === 'function') {
|
|
ref(value);
|
|
} else {
|
|
// @ts-expect-error: the TS types are incorrect and say that ref.current is readonly
|
|
ref.current = value;
|
|
}
|
|
}
|
|
return /*#__PURE__*/React.createElement(ServerContext.Provider, {
|
|
value: {
|
|
location
|
|
}
|
|
}, /*#__PURE__*/React.createElement(CurrentRenderContext.Provider, {
|
|
value: current
|
|
}, children));
|
|
});
|
|
//# sourceMappingURL=ServerContainer.js.map
|