-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMapScreen.js
More file actions
31 lines (27 loc) · 909 Bytes
/
MapScreen.js
File metadata and controls
31 lines (27 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { useNavigation } from '@react-navigation/native'
import React, { useEffect } from 'react'
import { View } from 'react-native'
import { useSelector } from 'react-redux'
import tailwind from 'tailwind-react-native-classnames'
import tw from 'tailwind-react-native-classnames'
import Map from '../components/Map'
import MapNavigator from '../navigation/MapNavigator'
import { selectOrigin } from '../redux/slices/navSlice'
const MapScreen = () => {
const origin = useSelector(selectOrigin)
const navigation = useNavigation()
useEffect(() => {
if(!origin) navigation.replace('Home')
}, [])
return (
<View style={tw`bg-white h-full`}>
<View style={tailwind`h-1/2`}>
<Map />
</View>
<View style={tailwind`h-1/2`}>
<MapNavigator />
</View>
</View>
)
}
export default MapScreen