Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import * as React from 'react';
- import { Text, View } from 'react-native';
- import { NavigationContainer } from '@react-navigation/native';
- import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
- import Icon from 'react-native-vector-icons/FontAwesome';
- import Position from './src/components/Map';
- import MapView from 'react-native-maps';
- const initialLocation = {
- latitude: -7.288787,
- longitude: 112.814824,
- latitudeDelta: 0.00922,
- longitudeDelta: 0.00421
- }
- function Feed() {
- return (
- <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
- <Text>Feed!</Text>
- </View>
- );
- }
- function Profile() {
- return (
- <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
- <Text>Profile!</Text>
- </View>
- );
- }
- function Map() {
- return (
- <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
- <MapView
- initialRegion={initialLocation}
- />
- </View>
- );
- }
- function Transaction() {
- return (
- <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
- <Text>Transaction!</Text>
- </View>
- )
- }
- const Tab = createBottomTabNavigator();
- function MyTabs() {
- return (
- <Tab.Navigator
- initialRouteName="Feed"
- tabBarOptions={{
- activeTintColor: '#e91e63',
- }}
- >
- <Tab.Screen
- name="Feed"
- component={Feed}
- options={{
- tabBarLabel: 'Home',
- tabBarIcon: ({ color, size }) => (
- <Icon name="home" color={color} size={size} />
- ),
- }}
- />
- <Tab.Screen
- name="Map"
- component={Map}
- options={{
- tabBarLabel: 'Park',
- tabBarIcon: ({ color, size }) => (
- <Icon name="map-marker" color={color} size={size} />
- ),
- }}
- />
- <Tab.Screen
- name="Transaction"
- component={Transaction}
- options={{
- tabBarLabel: 'Transaction',
- tabBarIcon: ({ color, size }) => (
- <Icon name="camera" color={color} size={size} />
- ),
- }}
- />
- <Tab.Screen
- name="Profile"
- component={Profile}
- options={{
- tabBarLabel: 'Profile',
- tabBarIcon: ({ color, size }) => (
- <Icon name="user" color={color} size={size} />
- ),
- }}
- />
- </Tab.Navigator>
- );
- }
- export default function App() {
- return (
- <NavigationContainer>
- <MyTabs />
- </NavigationContainer>
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement