import { Feather } from "@expo/vector-icons"; import React, { useRef, useState } from "react"; import { ActivityIndicator, Platform, Pressable, StyleSheet, Text, View, } from "react-native"; import { WebView } from "react-native-webview"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { Colors } from "@/constants/colors"; const C = Colors.dark; function getMatrixUrl(): string { const domain = process.env.EXPO_PUBLIC_DOMAIN ?? ""; if (!domain) return "http://localhost:8080/tower"; const stripped = domain.replace(/^https?:\/\//, "").replace(/\/$/, ""); const proto = stripped.startsWith("localhost") ? "http" : "https"; return `${proto}://${stripped}/tower`; } export default function MatrixScreen() { const insets = useSafeAreaInsets(); const topPad = Platform.OS === "web" ? 67 : insets.top; const [loading, setLoading] = useState(true); const [error, setError] = useState(false); const webviewRef = useRef(null); const matrixUrl = getMatrixUrl(); if (Platform.OS === "web") { return ( The Matrix Timmy's 3D command center