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.
42 lines
1.0 KiB
TypeScript
42 lines
1.0 KiB
TypeScript
import { LayoutChangeEvent, StyleSheet } from 'react-native';
|
|
import type { RefObject } from 'react';
|
|
import { WebView, type WebViewMessageEvent } from 'react-native-webview';
|
|
import GAUSSIAN_SPLATS_HTML from '@/assets/webview/gaussian-splats.html';
|
|
|
|
type GaussianSplatWebViewProps = {
|
|
onMessage: (event: WebViewMessageEvent) => void;
|
|
onError: () => void;
|
|
webViewRef: RefObject<WebView | null>;
|
|
onLayout?: (event: LayoutChangeEvent) => void;
|
|
};
|
|
|
|
export const GaussianSplatWebView = ({
|
|
onMessage,
|
|
onError,
|
|
webViewRef,
|
|
onLayout,
|
|
}: GaussianSplatWebViewProps) => {
|
|
const html = typeof GAUSSIAN_SPLATS_HTML === 'string' ? GAUSSIAN_SPLATS_HTML : '';
|
|
|
|
return (
|
|
<WebView
|
|
ref={webViewRef}
|
|
source={{ html }}
|
|
originWhitelist={['*']}
|
|
allowFileAccess={false}
|
|
javaScriptEnabled
|
|
onMessage={onMessage}
|
|
onError={onError}
|
|
onLayout={onLayout}
|
|
style={styles.webView}
|
|
/>
|
|
);
|
|
};
|
|
|
|
const styles = StyleSheet.create({
|
|
webView: {
|
|
flex: 1,
|
|
backgroundColor: '#0A0E1A',
|
|
},
|
|
});
|