Files
Eric FELIXINE e30ae8ed09 feat(smart-app): implement complete mobile app MVP
- 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
2026-06-01 18:00:35 -04:00

110 lines
2.5 KiB
Objective-C

#import "RNManualHandler.h"
#if !TARGET_OS_OSX
@interface RNManualRecognizer : UIGestureRecognizer
- (id)initWithGestureHandler:(RNGestureHandler *)gestureHandler;
@end
@implementation RNManualRecognizer {
__weak RNGestureHandler *_gestureHandler;
BOOL _shouldSendBeginEvent;
}
- (id)initWithGestureHandler:(RNGestureHandler *)gestureHandler
{
if ((self = [super initWithTarget:gestureHandler action:@selector(handleGesture:)])) {
_gestureHandler = gestureHandler;
_shouldSendBeginEvent = YES;
}
return self;
}
- (void)touchesBegan:(NSSet<RNGHUITouch *> *)touches withEvent:(UIEvent *)event
{
[_gestureHandler setCurrentPointerType:event];
[super touchesBegan:touches withEvent:event];
[_gestureHandler.pointerTracker touchesBegan:touches withEvent:event];
if (_shouldSendBeginEvent) {
[_gestureHandler handleGesture:self];
_shouldSendBeginEvent = NO;
}
}
- (void)touchesMoved:(NSSet<RNGHUITouch *> *)touches withEvent:(UIEvent *)event
{
[super touchesMoved:touches withEvent:event];
[_gestureHandler.pointerTracker touchesMoved:touches withEvent:event];
if ([self shouldFail]) {
self.state = (self.state == UIGestureRecognizerStatePossible) ? UIGestureRecognizerStateFailed
: UIGestureRecognizerStateCancelled;
[self reset];
}
}
- (void)touchesEnded:(NSSet<RNGHUITouch *> *)touches withEvent:(UIEvent *)event
{
[super touchesEnded:touches withEvent:event];
[_gestureHandler.pointerTracker touchesEnded:touches withEvent:event];
}
- (void)touchesCancelled:(NSSet<RNGHUITouch *> *)touches withEvent:(UIEvent *)event
{
[super touchesCancelled:touches withEvent:event];
[_gestureHandler.pointerTracker touchesCancelled:touches withEvent:event];
}
- (void)reset
{
[_gestureHandler.pointerTracker reset];
[super reset];
[_gestureHandler reset];
_shouldSendBeginEvent = YES;
}
- (BOOL)shouldFail
{
if (_gestureHandler.shouldCancelWhenOutside && ![_gestureHandler containsPointInView]) {
return YES;
} else {
return NO;
}
}
@end
@implementation RNManualGestureHandler
- (instancetype)initWithTag:(NSNumber *)tag
{
if ((self = [super initWithTag:tag])) {
_recognizer = [[RNManualRecognizer alloc] initWithGestureHandler:self];
}
return self;
}
@end
#else
@implementation RNManualGestureHandler
- (instancetype)initWithTag:(NSNumber *)tag
{
RCTLogWarn(@"ManualGestureHandler is not supported on macOS");
if ((self = [super initWithTag:tag])) {
_recognizer = [NSGestureRecognizer alloc];
}
return self;
}
@end
#endif