Added map screen + other stuff
This commit is contained in:
@@ -7,7 +7,7 @@ import { HapticTab } from '@/components/haptic-tab';
|
||||
import { IconSymbol } from '@/components/ui/icon-symbol';
|
||||
import { Colors } from '@/constants/theme';
|
||||
import { useColorScheme } from '@/hooks/use-color-scheme';
|
||||
import TabTwoScreen from './index';
|
||||
import TabTwoScreen from './mapScreen';
|
||||
import HomeScreen from './bonjourFL';
|
||||
|
||||
const Tabs = createBottomTabNavigator();
|
||||
@@ -31,14 +31,15 @@ export default function TabLayout() {
|
||||
}}
|
||||
/>
|
||||
<Tabs.Screen
|
||||
name="explore"
|
||||
name="mapScreen"
|
||||
options={{
|
||||
title: 'Explore',
|
||||
title: 'MapScreen',
|
||||
tabBarIcon: ({ color }) => <IconSymbol size={28} name="paperplane.fill" color={color} />,
|
||||
}}
|
||||
>
|
||||
{() => <TabTwoScreen/>}
|
||||
</Tabs.Screen>
|
||||
|
||||
</Tabs.Navigator>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ export default function BonjourScreen() {
|
||||
/>
|
||||
|
||||
<View style={styles.footer}>
|
||||
<Button title="Retour" onPress={() => router.back()} />
|
||||
<Button title="Retour" onPress={() => router.push("/(tabs)/mapScreen") } />
|
||||
</View>
|
||||
</View>
|
||||
)
|
||||
|
||||
41
app/(tabs)/mapScreen.tsx
Normal file
41
app/(tabs)/mapScreen.tsx
Normal file
@@ -0,0 +1,41 @@
|
||||
// MapScreen.tsx
|
||||
import React from 'react';
|
||||
import { StyleSheet, View, Dimensions } from 'react-native';
|
||||
import MapView, { Marker, PROVIDER_DEFAULT } from 'react-native-maps';
|
||||
|
||||
const MapScreen: React.FC = () => {
|
||||
const region = {
|
||||
latitude: 48.8566,
|
||||
longitude: 2.3522,
|
||||
latitudeDelta: 0.05,
|
||||
longitudeDelta: 0.05,
|
||||
};
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<MapView
|
||||
provider={PROVIDER_DEFAULT} // OpenStreetMap
|
||||
style={styles.map}
|
||||
region={region}
|
||||
>
|
||||
<Marker
|
||||
coordinate={{ latitude: 48.8566, longitude: 2.3522 }}
|
||||
title="Paris"
|
||||
description="Capitale de la France"
|
||||
/>
|
||||
</MapView>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
},
|
||||
map: {
|
||||
width: Dimensions.get('window').width,
|
||||
height: Dimensions.get('window').height,
|
||||
},
|
||||
});
|
||||
|
||||
export default MapScreen;
|
||||
Reference in New Issue
Block a user