-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSub.js
More file actions
54 lines (50 loc) · 1.72 KB
/
Sub.js
File metadata and controls
54 lines (50 loc) · 1.72 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import React, { Component } from 'react'
import { Text, StyleSheet, View } from 'react-native'
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'
import AntDesign from 'react-native-vector-icons/AntDesign'
import Feather from 'react-native-vector-icons/Feather'
let Tab=createBottomTabNavigator()
function Home({navigation}){
return<View style={styles.subView}>
<Text style={styles.txt}>Home</Text>
<AntDesign name="wifi" color={"green"} size={60} onPress={()=>navigation.navigate("Settings",{screen:'Wifi'})}/>
<Feather name="bluetooth" color={"blue"} size={60} onPress={()=>navigation.navigate("Settings",{screen:"BlueTooth"})}/>
</View>
}
function About(){
return <View style={styles.subView}>
<Text style={styles.txt}>About</Text>
</View>
}
function Settings(){
function _screen({route}){
let iconName;
return {
tabBarIcon:({color})=>{
switch(route.name){
case 'Wifi': return <AntDesign name={'wifi'} size={20} color={color}/>
case 'BlueTooth': return <Feather name={'bluetooth'} size={20} color={color}/>
}
}
}
}
return <Tab.Navigator screenOptions={_screen}>
<Tab.Screen name="Wifi" component={Wifi}/>
<Tab.Screen name="BlueTooth" component={BlueTooth}/>
</Tab.Navigator>
}
function Wifi(){
return <View style={styles.subView}>
<Text style={styles.txt}>Wifi</Text>
</View>
}
function BlueTooth(){
return <View style={styles.subView}>
<Text style={styles.txt}>BlueTooth</Text>
</View>
}
const styles = StyleSheet.create({
txt:{fontSize:60},
subView:{marginTop:0}
})
export {Home,About,Settings}