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

108 lines
2.5 KiB
C++

/*
* 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.
*/
#pragma once
#include <react/bridging/Base.h>
#include <memory>
#include <optional>
namespace facebook::react {
template <>
struct Bridging<std::nullptr_t> {
static std::nullptr_t fromJs(jsi::Runtime& rt, const jsi::Value& value) {
if (value.isNull() || value.isUndefined()) {
return nullptr;
} else {
throw jsi::JSError(rt, "Cannot convert value to nullptr");
}
}
static std::nullptr_t toJs(jsi::Runtime&, std::nullptr_t) {
return nullptr;
}
};
template <typename T>
struct Bridging<std::optional<T>> {
static std::optional<T> fromJs(
jsi::Runtime& rt,
const jsi::Value& value,
const std::shared_ptr<CallInvoker>& jsInvoker) {
if (value.isNull() || value.isUndefined()) {
return {};
}
return bridging::fromJs<T>(rt, value, jsInvoker);
}
template <typename U>
static std::optional<T> fromJs(
jsi::Runtime& rt,
const std::optional<U>& value,
const std::shared_ptr<CallInvoker>& jsInvoker) {
if (value) {
return bridging::fromJs<T>(rt, *value, jsInvoker);
}
return {};
}
static jsi::Value toJs(
jsi::Runtime& rt,
const std::optional<T>& value,
const std::shared_ptr<CallInvoker>& jsInvoker) {
if (value) {
return bridging::toJs(rt, *value, jsInvoker);
}
return jsi::Value::null();
}
};
template <typename T>
struct Bridging<
std::shared_ptr<T>,
std::enable_if_t<!std::is_base_of_v<jsi::HostObject, T>>> {
static jsi::Value toJs(
jsi::Runtime& rt,
const std::shared_ptr<T>& ptr,
const std::shared_ptr<CallInvoker>& jsInvoker) {
if (ptr) {
return bridging::toJs(rt, *ptr, jsInvoker);
}
return jsi::Value::null();
}
};
template <typename T>
struct Bridging<std::unique_ptr<T>> {
static jsi::Value toJs(
jsi::Runtime& rt,
const std::unique_ptr<T>& ptr,
const std::shared_ptr<CallInvoker>& jsInvoker) {
if (ptr) {
return bridging::toJs(rt, *ptr, jsInvoker);
}
return jsi::Value::null();
}
};
template <typename T>
struct Bridging<std::weak_ptr<T>> {
static jsi::Value toJs(
jsi::Runtime& rt,
const std::weak_ptr<T>& weakPtr,
const std::shared_ptr<CallInvoker>& jsInvoker) {
if (auto ptr = weakPtr.lock()) {
return bridging::toJs(rt, *ptr, jsInvoker);
}
return jsi::Value::null();
}
};
} // namespace facebook::react