Football.txt
unknown
plain_text
2 years ago
2.2 kB
16
Indexable
import React, { useState } from 'react';
import { View, Text, TouchableOpacity, StyleSheet, Image } from 'react-native';
const routesData = [
{ name: 'Slant', description: 'A short, quick route towards the middle of the field.' },
{ name: 'Post', description: 'A deeper route towards the end zone, often used for scoring.' },
{ name: 'Go', description: 'A straight route down the field, often used for deep passes.' },
{ name: 'Out', description: 'A route where the receiver runs towards the sideline before turning outwards.' },
{ name: 'Corner', description: 'A diagonal route towards the corner of the end zone.' },
];
const FootballRoutesApp = () => {
const [selectedRoute, setSelectedRoute] = useState(null);
const selectRoute = (route) => {
setSelectedRoute(route);
};
return (
<View style={styles.container}>
<Text style={styles.title}>Football Routes App</Text>
<Text style={styles.subtitle}>Select a Route:</Text>
{routesData.map((route, index) => (
<TouchableOpacity
key={index}
style={styles.routeButton}
onPress={() => selectRoute(route)}
>
<Text style={styles.routeButtonText}>{route.name}</Text>
</TouchableOpacity>
))}
{selectedRoute && (
<View style={styles.selectedRouteContainer}>
<Text style={styles.selectedRouteTitle}>{selectedRoute.name}</Text>
<Text style={styles.selectedRouteDescription}>{selectedRoute.description}</Text>
</View>
)}
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
title: {
fontSize: 24,
fontWeight: 'bold',
marginBottom: 20,
},
subtitle: {
fontSize: 18,
marginBottom: 10,
},
routeButton: {
backgroundColor: '#3498db',
padding: 10,
borderRadius: 5,
marginBottom: 10,
},
routeButtonText: {
color: '#fff',
fontSize: 16,
},
selectedRouteContainer: {
marginTop: 20,
alignItems: 'center',
},
selectedRouteTitle: {
fontSize: 20,
fontWeight: 'bold',
marginBottom: 10,
},
selectedRouteDescription: {
fontSize: 16,
},
});
export default FootballRoutesApp;
Editor is loading...
Leave a Comment