diff --git a/app.json b/app.json index 61698d5..ccd26b6 100644 --- a/app.json +++ b/app.json @@ -7,6 +7,7 @@ "icon": "./assets/images/icon.png", "scheme": "myapp", "userInterfaceStyle": "automatic", + "jsEngine": "hermes", "newArchEnabled": true, "ios": { "supportsTablet": true diff --git a/app/components/EnvironmentCard.tsx b/app/components/EnvironmentCard.tsx index f952ce4..a389b1a 100644 --- a/app/components/EnvironmentCard.tsx +++ b/app/components/EnvironmentCard.tsx @@ -1,19 +1,43 @@ -import { View, StyleSheet, Text, Pressable } from "react-native"; +import { View, Text, StyleSheet } from 'react-native'; +interface EnvironmentCardProps { + name: string; + publicUrl: string; + status: number; + url: string; +} -export default function EnvironmentCard() { - return ( - console.log('Environment card pressed')} style={styles.container}> - I'm pressable! - - ); +export default function EnvironmentCard({ name, publicUrl, status, url }: EnvironmentCardProps) { + return ( + + {name} + {publicUrl && Public URL: {publicUrl}} + {status === 1 && Status: Running} + {status === 2 && Status: Stopped} + {status === 3 && Status: Pending} + URL: {url} + + ); } const styles = StyleSheet.create({ - container: { - backgroundColor: '#fff', - padding: 16, - margin: 8, - borderRadius: 8, + card: { + backgroundColor: 'white', + borderRadius: 8, + padding: 16, + marginBottom: 16, + shadowColor: '#000', + shadowOffset: { + width: 0, + height: 2, }, + shadowOpacity: 0.25, + shadowRadius: 3.84, + elevation: 5, + }, + title: { + fontSize: 18, + fontWeight: 'bold', + marginBottom: 8, + }, }); \ No newline at end of file diff --git a/app/index.tsx b/app/index.tsx index 74eb8d2..63b4d3a 100644 --- a/app/index.tsx +++ b/app/index.tsx @@ -6,10 +6,16 @@ import LoginForm from "./components/LoginForm"; import LogoutButton from "./components/LogoutButton"; import EnvironmentCard from "./components/EnvironmentCard"; - import { AuthProvider } from "./context/AuthContext"; import { useAuth } from "./context/AuthContext"; +interface Environment { + Name: string; + PublicURL: string; + Status: number; + URL: string; +} + export default function Index() { return ( @@ -23,7 +29,7 @@ export default function Index() { function MainContent() { const { isAuthenticated, domain, username, authData } = useAuth(); - const [environmentData, setEnvironmentData] = useState(null); + const [environmentData, setEnvironmentData] = useState(null); const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(null); @@ -60,12 +66,20 @@ function MainContent() { return ( - - - - - - + + + {environmentData && environmentData.map((environment, index) => ( + + ))} + + + ); }