Skip to content

Commit

Permalink
Merge pull request #195 from discipl/upgrageSdk42
Browse files Browse the repository at this point in the history
Upgrage sdk42
  • Loading branch information
bkaptijn authored Sep 30, 2021
2 parents 9cd63ae + 2832b65 commit 4cc72bf
Show file tree
Hide file tree
Showing 7 changed files with 26,699 additions and 6,760 deletions.
5 changes: 3 additions & 2 deletions validator-frontend/App.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from 'react';
import { Platform, StatusBar, StyleSheet, View } from 'react-native';
import { AppLoading } from 'expo';
import AppLoading from 'expo-app-loading';
import * as Font from 'expo-font';
import { Ionicons } from '@expo/vector-icons';

import AppNavigator from './navigation/AppNavigator';

export default class App extends React.Component {
Expand All @@ -23,7 +24,7 @@ export default class App extends React.Component {
return (
<View style={styles.container}>
{Platform.OS === 'ios' && <StatusBar barStyle="default" />}
<AppNavigator />
<AppNavigator/>
</View>
);
}
Expand Down
1 change: 0 additions & 1 deletion validator-frontend/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"description": "A very interesting project.",
"slug": "waardepapieren_app",
"privacy": "public",
"sdkVersion": "36.0.0",
"platforms": [
"ios",
"android"
Expand Down
16 changes: 9 additions & 7 deletions validator-frontend/navigation/AppNavigator.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { createSwitchNavigator } from 'react-navigation';

import React from 'react'
import { NavigationContainer } from '@react-navigation/native';
import MainTabNavigator from './MainTabNavigator';

export default createSwitchNavigator({
// You could add another route here for authentication.
// Read more at https://reactnavigation.org/docs/en/auth-flow.html
Main: MainTabNavigator,
});
export default function AppNavigator() {
return (
<NavigationContainer>
<MainTabNavigator/>
</NavigationContainer>
);
};
77 changes: 51 additions & 26 deletions validator-frontend/navigation/MainTabNavigator.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,66 @@
import React from 'react'
import { createBottomTabNavigator, createStackNavigator } from 'react-navigation'
import { AntDesign, Ionicons } from '@expo/vector-icons'
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'
import { createNativeStackNavigator } from '@react-navigation/native-stack'
import { AntDesign, MaterialIcons } from '@expo/vector-icons'
import HomeScreen from '../screens/HomeScreen'
import ScanScreen from '../screens/ScanScreen'

import * as Localization from 'expo-localization';
import i18n from 'i18n-js';
import * as en from '../lang/en.json';
import * as nl from '../lang/nl.json';
import * as Localization from 'expo-localization'
import i18n from 'i18n-js'
import * as en from '../lang/en.json'
import * as nl from '../lang/nl.json'

i18n.fallbacks = true;
i18n.translations = { nl, en };
i18n.locale = Localization.locale;

const HomeStack = createStackNavigator({
Home: HomeScreen,
})
const HomeStack = createNativeStackNavigator();

HomeStack.navigationOptions = {
tabBarLabel: i18n.t("navigationHome"),
tabBarIcon: ({ focused }) => (
<AntDesign name="home" size={24} color="blue"/>
),
function MyHomeStack() {
return (
<HomeStack.Navigator>
<HomeStack.Screen
name="HomeStack"
component={HomeScreen}
options={{ headerShown: false }}
/>
</HomeStack.Navigator>
);
}

const ScanStack = createStackNavigator({
Scan: ScanScreen,
})
const ScanStack = createNativeStackNavigator();

ScanStack.navigationOptions = {
tabBarLabel: i18n.t("navigationScan"),
tabBarIcon: ({ focused }) => (
<Ionicons name="md-qr-scanner" size={24} color="blue"/>
),
function MyScanStack() {
return (
<ScanStack.Navigator>
<ScanStack.Screen
name="ScanStack"
component={ScanScreen}
options={{ headerShown: false }}
/>
</ScanStack.Navigator>
);
}

export default createBottomTabNavigator({
HomeStack,
ScanStack
})
const Tab = createBottomTabNavigator();

export default function MainTabNavigator() {
return (
<Tab.Navigator>
<Tab.Screen name="Home" component={MyHomeStack} options={{
tabBarLabel: i18n.t("navigationHome"),
tabBarIcon: ({ focused }) => (
<AntDesign name="home" size={24} color="blue"/>
),
headerShown:false
}}/>
<Tab.Screen name="Scan" component={MyScanStack} options={{
tabBarLabel: i18n.t("navigationScan"),
tabBarIcon: ({ focused }) => (
<MaterialIcons name="qr-code-scanner" size={24} color="blue"/>
),
headerShown:false
}} />
</Tab.Navigator>
);
}
Loading

0 comments on commit 4cc72bf

Please sign in to comment.