mirror of
https://github.com/ruvnet/RuView
synced 2026-07-22 17:23:19 +00:00
fdc7142dfa
- 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.
29 lines
853 B
TypeScript
29 lines
853 B
TypeScript
import { ComponentPropsWithoutRef } from 'react';
|
|
import { StyleProp, Text, TextStyle } from 'react-native';
|
|
import { useTheme } from '../hooks/useTheme';
|
|
import { colors } from '../theme/colors';
|
|
import { typography } from '../theme/typography';
|
|
|
|
type TextPreset = keyof typeof typography;
|
|
type ColorKey = keyof typeof colors;
|
|
|
|
type ThemedTextProps = Omit<ComponentPropsWithoutRef<typeof Text>, 'style'> & {
|
|
preset?: TextPreset;
|
|
color?: ColorKey;
|
|
style?: StyleProp<TextStyle>;
|
|
};
|
|
|
|
export const ThemedText = ({
|
|
preset = 'bodyMd',
|
|
color = 'textPrimary',
|
|
style,
|
|
...props
|
|
}: ThemedTextProps) => {
|
|
const { colors, typography } = useTheme();
|
|
|
|
const presetStyle = (typography as Record<TextPreset, TextStyle>)[preset];
|
|
const colorStyle = { color: colors[color] };
|
|
|
|
return <Text {...props} style={[presetStyle, colorStyle, style]} />;
|
|
};
|