diff --git a/app/(tabs)/_layout.tsx b/app/(tabs)/_layout.tsx deleted file mode 100644 index 675c127..0000000 --- a/app/(tabs)/_layout.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import { Tabs } from 'expo-router'; -import React from 'react'; -import { Platform } from 'react-native'; - -import { HapticTab } from '../components/HapticTab'; -import { IconSymbol } from '../components/ui/IconSymbol'; -import TabBarBackground from '../components/ui/TabBarBackground'; -import { Colors } from '..//constants/Colors'; -import { useColorScheme } from '../hooks/useColorScheme'; - -export default function TabLayout() { - const colorScheme = useColorScheme(); - - return ( - - , - }} - /> - , - }} - /> - - ); -} diff --git a/app/components/EnvironmentCard.tsx b/app/components/EnvironmentCard.tsx index a389b1a..7b1b1b9 100644 --- a/app/components/EnvironmentCard.tsx +++ b/app/components/EnvironmentCard.tsx @@ -1,22 +1,26 @@ -import { View, Text, StyleSheet } from 'react-native'; +import { View, Text, StyleSheet, Pressable } from 'react-native'; interface EnvironmentCardProps { name: string; publicUrl: string; status: number; url: string; + id: number; + onPress: () => void; } -export default function EnvironmentCard({ name, publicUrl, status, url }: EnvironmentCardProps) { +export default function EnvironmentCard({ name, publicUrl, status, url, id, onPress }: EnvironmentCardProps) { return ( - - {name} - {publicUrl && Public URL: {publicUrl}} - {status === 1 && Status: Running} - {status === 2 && Status: Stopped} - {status === 3 && Status: Pending} - URL: {url} - + + + {name} + {publicUrl && Public URL: {publicUrl}} + {status === 1 && Status: Running} + {status === 2 && Status: Stopped} + {status === 3 && Status: Pending} + URL: {url} + + ); } diff --git a/app/envs/[env].tsx b/app/envs/[env].tsx new file mode 100644 index 0000000..a17e0f4 --- /dev/null +++ b/app/envs/[env].tsx @@ -0,0 +1,14 @@ +import { Text, View } from 'react-native'; +import { useLocalSearchParams, useGlobalSearchParams, Link } from 'expo-router'; + +export default function Route() { + const glob = useGlobalSearchParams(); + const local = useLocalSearchParams(); + + return ( + + Glob: {local.env} + Local: {glob.env} + + ); +} diff --git a/app/envs/_layout.tsx b/app/envs/_layout.tsx new file mode 100644 index 0000000..cbc9b8e --- /dev/null +++ b/app/envs/_layout.tsx @@ -0,0 +1,5 @@ +import { Slot } from 'expo-router'; + +export default function HomeLayout() { + return ; +} diff --git a/app/envs/index.tsx b/app/envs/index.tsx new file mode 100644 index 0000000..6643985 --- /dev/null +++ b/app/envs/index.tsx @@ -0,0 +1,9 @@ +import { View, Text } from "react-native"; + +export default function EnvIndex() { + return ( + + Environments + + ); +} \ No newline at end of file diff --git a/app/index.tsx b/app/index.tsx index 63b4d3a..3ff99ce 100644 --- a/app/index.tsx +++ b/app/index.tsx @@ -1,6 +1,7 @@ import { Text, View, ScrollView } from "react-native"; import {SafeAreaView, SafeAreaProvider} from 'react-native-safe-area-context'; import { useState, useEffect } from "react"; +import { useRouter } from "expo-router"; import LoginForm from "./components/LoginForm"; import LogoutButton from "./components/LogoutButton"; @@ -14,6 +15,7 @@ interface Environment { PublicURL: string; Status: number; URL: string; + Id: number; } export default function Index() { @@ -28,6 +30,7 @@ export default function Index() { } function MainContent() { + const router = useRouter(); const { isAuthenticated, domain, username, authData } = useAuth(); const [environmentData, setEnvironmentData] = useState(null); const [isLoading, setIsLoading] = useState(false); @@ -75,6 +78,11 @@ function MainContent() { publicUrl={environment.PublicURL} status={environment.Status} url={environment.URL} + id={environment.Id} + onPress={() => router.push({ + pathname: `/envs/[env]`, + params: { env: environment.Id } + })} /> ))} diff --git a/package-lock.json b/package-lock.json index c62127d..fb756a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "expo-font": "~13.0.1", "expo-haptics": "~14.0.0", "expo-linking": "~7.0.3", - "expo-router": "~4.0.9", + "expo-router": "~4.0.11", "expo-splash-screen": "~0.29.13", "expo-status-bar": "~2.0.0", "expo-symbols": "~0.2.0", @@ -8443,9 +8443,9 @@ } }, "node_modules/expo-router": { - "version": "4.0.9", - "resolved": "https://registry.npmjs.org/expo-router/-/expo-router-4.0.9.tgz", - "integrity": "sha512-bZupRd2nUWolihwhW2kqTTAVyhMaHJbtEFn49bOHtrfl0gkIHld+IecUIh+eJW6QTAcTOHCu5gVHLoJeM0mwjA==", + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/expo-router/-/expo-router-4.0.11.tgz", + "integrity": "sha512-2Qrd/fk98kC+CTg1umbuUaBaGkpdGStPpkSR99SoAjX6KWC1WhNMCv0hGFn7cRmSNOWQzgIfLGLERhRY1o4myw==", "license": "MIT", "dependencies": { "@expo/metro-runtime": "4.0.0", diff --git a/package.json b/package.json index 2456035..c8ce6da 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "expo-font": "~13.0.1", "expo-haptics": "~14.0.0", "expo-linking": "~7.0.3", - "expo-router": "~4.0.9", + "expo-router": "~4.0.11", "expo-splash-screen": "~0.29.13", "expo-status-bar": "~2.0.0", "expo-symbols": "~0.2.0",