Untitled
unknown
plain_text
a month ago
1.3 kB
4
Indexable
import React, { useState } from "react"; import { View, Text, Button, TextInput, Switch } from "react-native"; const App = () => { const [isPremium, setIsPremium] = useState(false); const [pickup, setPickup] = useState(""); const [destination, setDestination] = useState(""); const handleRideRequest = () => { alert(`Tur bestilt fra ${pickup} til ${destination}`); }; return ( <View style={{ flex: 1, justifyContent: "center", alignItems: "center", padding: 20 }}> <Text style={{ fontSize: 20, fontWeight: "bold" }}>Velkommen til SplitRide!</Text> <TextInput placeholder="Startpunkt" value={pickup} onChangeText={setPickup} style={{ borderWidth: 1, padding: 8, margin: 10, width: "80%" }} /> <TextInput placeholder="Destinasjon" value={destination} onChangeText={setDestination} style={{ borderWidth: 1, padding: 8, margin: 10, width: "80%" }} /> <Button title="Bestill tur" onPress={handleRideRequest} /> <View style={{ flexDirection: "row", alignItems: "center", marginTop: 20 }}> <Text>Premium Medlem</Text> <Switch value={isPremium} onValueChange={setIsPremium} /> </View> </View> ); }; export default App;
Editor is loading...
Leave a Comment