- 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
84 lines
1.5 KiB
Plaintext
84 lines
1.5 KiB
Plaintext
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#import "RCTSurfaceView.h"
|
|
#import "RCTSurfaceView+Internal.h"
|
|
|
|
#import "RCTDefines.h"
|
|
#import "RCTSurface.h"
|
|
#import "RCTSurfaceRootView.h"
|
|
|
|
@implementation RCTSurfaceView {
|
|
RCTSurfaceRootView *_Nullable _rootView;
|
|
RCTSurfaceStage _stage;
|
|
}
|
|
|
|
RCT_NOT_IMPLEMENTED(-(instancetype)init)
|
|
RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
|
|
RCT_NOT_IMPLEMENTED(-(nullable instancetype)initWithCoder : (NSCoder *)coder)
|
|
|
|
- (instancetype)initWithSurface:(RCTSurface *)surface
|
|
{
|
|
if (self = [super initWithFrame:CGRectZero]) {
|
|
_stage = surface.stage;
|
|
_surface = surface;
|
|
}
|
|
|
|
return self;
|
|
}
|
|
|
|
#pragma mark - Internal Interface
|
|
|
|
- (void)setRootView:(RCTSurfaceRootView *_Nullable)rootView
|
|
{
|
|
if (_rootView == rootView) {
|
|
return;
|
|
}
|
|
|
|
[_rootView removeFromSuperview];
|
|
_rootView = rootView;
|
|
[self _updateStage];
|
|
}
|
|
|
|
- (RCTSurfaceRootView *)rootView
|
|
{
|
|
return _rootView;
|
|
}
|
|
|
|
#pragma mark - stage
|
|
|
|
- (void)setStage:(RCTSurfaceStage)stage
|
|
{
|
|
if (stage == _stage) {
|
|
return;
|
|
}
|
|
|
|
_stage = stage;
|
|
|
|
[self _updateStage];
|
|
}
|
|
|
|
- (RCTSurfaceStage)stage
|
|
{
|
|
return _stage;
|
|
}
|
|
|
|
#pragma mark - Private
|
|
|
|
- (void)_updateStage
|
|
{
|
|
if (RCTSurfaceStageIsRunning(_stage)) {
|
|
if (_rootView && _rootView.superview != self) {
|
|
[self addSubview:_rootView];
|
|
}
|
|
} else {
|
|
[_rootView removeFromSuperview];
|
|
}
|
|
}
|
|
|
|
@end
|