Files
ruvnet--RuView/ui/mobile/src/screens/SettingsScreen/RssiToggle.tsx
T
ruv fdc7142dfa 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.
2026-03-02 10:30:33 -05:00

37 lines
1.2 KiB
TypeScript

import { Platform, Switch, View } from 'react-native';
import { ThemedText } from '@/components/ThemedText';
import { colors } from '@/theme/colors';
import { spacing } from '@/theme/spacing';
type RssiToggleProps = {
enabled: boolean;
onChange: (value: boolean) => void;
};
export const RssiToggle = ({ enabled, onChange }: RssiToggleProps) => {
return (
<View>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
<View style={{ flex: 1 }}>
<ThemedText preset="bodyMd">RSSI Scan</ThemedText>
<ThemedText preset="bodySm" style={{ color: colors.textSecondary }}>
Scan for nearby Wi-Fi signals from Android devices
</ThemedText>
</View>
<Switch
value={enabled}
onValueChange={onChange}
trackColor={{ true: colors.accent, false: colors.surfaceAlt }}
thumbColor={colors.textPrimary}
/>
</View>
{Platform.OS === 'ios' && (
<ThemedText preset="bodySm" style={{ color: colors.textSecondary, marginTop: spacing.xs }}>
iOS: RSSI scan is currently limited using stub data.
</ThemedText>
)}
</View>
);
};