init addScreen and change locations

This commit is contained in:
Patryk
2025-04-13 09:04:31 +02:00
parent ccf7ff2955
commit 6e8a235ed4
8 changed files with 169 additions and 96 deletions

View File

@@ -1,22 +1,22 @@
import { View, StyleSheet, FlatList } from 'react-native';
import { useTheme, Card, Text, Button} from 'react-native-paper';
import { Link } from 'expo-router';
import { Locations } from '@/constants/Locations';
import { locations } from '@/data/locations';
export default function Index() {
const theme = useTheme();
console.log(locations);
return (
<View style={[styles.container, {backgroundColor: theme.colors.background}]}>
<FlatList
data={Locations}
data={locations}
keyExtractor={(item) => item.name}
renderItem={({ item }) => (
<Card style={{ margin: 10}}>
<Card.Cover style={{ marginBottom:10 }} source={{ uri: item.image }} />
<Card.Content style={{ marginBottom:10 }}>
<Text variant="titleLarge">{item.name}</Text>
<Text variant="bodyMedium">{item.description}</Text>
<Text variant="bodyMedium">{item.description.split('.')[0]}...</Text>
</Card.Content>
<Card.Actions>
<Link href={`/location/${item.id}`} asChild>