init addScreen and change locations
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { View, ScrollView, StyleSheet } from 'react-native';
|
||||
import { Text, Card } from 'react-native-paper';
|
||||
import { useLocalSearchParams } from 'expo-router';
|
||||
import { Locations } from '@/constants/Locations';
|
||||
import { locations } from '@/data/locations';
|
||||
|
||||
export default function Location() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const location = Locations.find(loc => loc.id == id);
|
||||
const location = locations.find(loc => loc.id == id);
|
||||
|
||||
if (!location) {
|
||||
return (
|
||||
@@ -14,6 +14,7 @@ export default function Location() {
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<ScrollView>
|
||||
@@ -27,7 +28,7 @@ export default function Location() {
|
||||
Opis:
|
||||
</Text>
|
||||
<Text variant="bodyMedium">
|
||||
{location.longDescription}
|
||||
{location.description}
|
||||
</Text>
|
||||
</Card.Content>
|
||||
|
||||
@@ -41,12 +42,6 @@ export default function Location() {
|
||||
<Text variant="bodyMedium" style={{marginBottom: 10}}>
|
||||
Ludność: {location.population} osób
|
||||
</Text>
|
||||
<Text variant="bodyMedium" style={{marginBottom: 10}}>
|
||||
Gęstość zaludnienia: {location.density} osób/km²
|
||||
</Text>
|
||||
<Text variant="bodyMedium" style={{marginBottom: 10}}>
|
||||
Wysokość nad poziomem morza: {location.elevation} m n.p.m.
|
||||
</Text>
|
||||
</Card.Content>
|
||||
</Card>
|
||||
</ScrollView></View>
|
||||
|
||||
Reference in New Issue
Block a user