@@ -5,15 +5,18 @@ import {
5
5
Button ,
6
6
ActivityIndicator ,
7
7
StyleSheet ,
8
- useColorScheme ,
8
+ // useColorScheme,
9
9
} from "react-native" ;
10
10
import MapView , { Marker , PROVIDER_GOOGLE } from "react-native-maps" ;
11
11
import { useLocation } from "../hooks/useLocation" ;
12
+ import { useNavigation } from "@react-navigation/native" ;
12
13
13
14
export default function LocationComponent ( ) {
14
15
const { location, address, error, loading, fetchLocation } = useLocation ( ) ;
15
- const colorScheme = useColorScheme ( ) ; // Get the current color scheme
16
- const textColor = colorScheme === "dark" ? "#ffffff" : "#000000" ; // Dynamic text color
16
+ //const colorScheme = useColorScheme(); // Get the current color scheme
17
+ //const textColor = colorScheme === "dark" ? "#ffffff" : "#000000"; // Dynamic text color
18
+ const textColor = "#ffffff" ;
19
+ console . log ( "Navigation context:" , useNavigation ( ) ) ;
17
20
18
21
return (
19
22
< View style = { styles . container } >
@@ -34,7 +37,7 @@ export default function LocationComponent() {
34
37
{ /* Native Map */ }
35
38
< View style = { styles . mapContainer } >
36
39
< MapView
37
- provider = { PROVIDER_GOOGLE }
40
+ // provider={PROVIDER_GOOGLE}
38
41
style = { styles . map }
39
42
region = {
40
43
location
@@ -91,10 +94,13 @@ const styles = StyleSheet.create({
91
94
} ,
92
95
mapContainer : {
93
96
width : "100%" ,
94
- height : 300 ,
97
+ height : 300 , // Ensure a fixed height
95
98
marginTop : 16 ,
99
+ borderRadius : 10 ,
100
+ overflow : "hidden" ,
96
101
} ,
97
102
map : {
98
- flex : 1 ,
103
+ width : "100%" , // Explicit width
104
+ height : "100%" , // Explicit height
99
105
} ,
100
106
} ) ;
0 commit comments