mirror of
https://github.com/ruvnet/RuView
synced 2026-08-03 19:21:42 +00:00
feat: Implement RSSI service for iOS and Web platforms
- Added IosRssiService to handle synthetic RSSI data for iOS. - Created WebRssiService to simulate RSSI scanning on the web. - Defined shared types for WifiNetwork and RssiService in rssi.service.ts. - Introduced simulation service to generate synthetic sensing data. - Implemented WebSocket service for real-time data handling with reconnection logic. - Established Zustand stores for managing application state related to MAT and pose data. - Developed theme context and utility functions for consistent styling and formatting. - Added type definitions for various application entities including API responses and sensing data. - Created utility functions for color mapping and URL validation. - Configured TypeScript settings for the mobile application.
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
import AsyncStorage from '@react-native-async-storage/async-storage';
|
||||
import { create } from 'zustand';
|
||||
import { createJSONStorage, persist } from 'zustand/middleware';
|
||||
|
||||
export type Theme = 'light' | 'dark' | 'system';
|
||||
|
||||
export interface SettingsState {
|
||||
serverUrl: string;
|
||||
rssiScanEnabled: boolean;
|
||||
theme: Theme;
|
||||
alertSoundEnabled: boolean;
|
||||
setServerUrl: (url: string) => void;
|
||||
setRssiScanEnabled: (value: boolean) => void;
|
||||
setTheme: (theme: Theme) => void;
|
||||
setAlertSoundEnabled: (value: boolean) => void;
|
||||
}
|
||||
|
||||
export const useSettingsStore = create<SettingsState>()(
|
||||
persist(
|
||||
(set) => ({
|
||||
serverUrl: 'http://localhost:3000',
|
||||
rssiScanEnabled: false,
|
||||
theme: 'system',
|
||||
alertSoundEnabled: true,
|
||||
|
||||
setServerUrl: (url) => {
|
||||
set({ serverUrl: url });
|
||||
},
|
||||
|
||||
setRssiScanEnabled: (value) => {
|
||||
set({ rssiScanEnabled: value });
|
||||
},
|
||||
|
||||
setTheme: (theme) => {
|
||||
set({ theme });
|
||||
},
|
||||
|
||||
setAlertSoundEnabled: (value) => {
|
||||
set({ alertSoundEnabled: value });
|
||||
},
|
||||
}),
|
||||
{
|
||||
name: 'wifi-densepose-settings',
|
||||
storage: createJSONStorage(() => AsyncStorage),
|
||||
},
|
||||
),
|
||||
);
|
||||
Reference in New Issue
Block a user