home list view

This commit is contained in:
Patryk
2025-04-07 22:30:23 +02:00
parent 9e215d6203
commit 1ad9fcd7e7
4 changed files with 58 additions and 5 deletions

View File

@@ -19,11 +19,12 @@ export default function TabLayout() {
borderBottomWidth:0
},
headerTintColor: theme.colors.primary,
tabBarItemStyle: { flex: 1 },
}}>
<Tabs.Screen name="index" options={{ title: 'Home',tabBarIcon: ({ color, focused }) => (
<Ionicons name={focused ? 'home-sharp' : 'home-outline'} color={color} size={24} />
), }} />
<Tabs.Screen name="location" options={{ title: 'Location' ,tabBarIcon: ({ color, focused }) => (
<Tabs.Screen name="location" options={{ title: 'Location' ,tabBarButton: ()=> null,tabBarIcon: ({ color, focused }) => (
<Ionicons name={focused ? 'location-sharp' : 'location-outline'} color={color} size={24} />
),}} />
<Tabs.Screen name="formScreen" options={{title: 'Create/Edit' ,tabBarIcon: ({ color, focused }) => (

View File

@@ -1,11 +1,31 @@
import { Text, View, StyleSheet } from 'react-native';
import { useTheme } from 'react-native-paper';
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';
export default function Index() {
const theme = useTheme();
return (
<View style={[styles.container, {backgroundColor: theme.colors.background}]}>
<FlatList
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>
</Card.Content>
<Card.Actions>
<Link href="/location/{item.id}" asChild>
<Button>Zobacz więcej</Button>
</Link>
</Card.Actions>
</Card>
)}>
</FlatList>
</View>
);
}