-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
70 lines (63 loc) · 1.54 KB
/
App.js
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
Platform,
StyleSheet,
Text,
View,
ScrollView,
} from 'react-native';
import ScrollableTabView from 'react-native-scrollable-tab-view';
import { Home, Chat, Profile } from './src/views';
import CustomTabBar from './src/components/custom_tab_bar';
import { Tinder, User, Message } from './src/assets';
export default class App extends Component {
static navigatorStyle = {
navBarHidden: true,
}
constructor(props) {
super(props);
this.props.navigator.setOnNavigatorEvent(this.onNavigatorEvent.bind(this));
this.state = {
visible: true
}
console.disableYellowBox = true;
}
onNavigatorEvent(event) {
if (event.id === 'willAppear') {
this.setState({
visible: true
});
}
if (event.id === 'willDisappear') {
this.setState({
visible: false
});
}
}
render() {
return (
<ScrollableTabView
prerenderingSiblingsNumber={ 2 }
renderTabBar={ () => <CustomTabBar /> }
locked
initialPage={1}
style={{flex: this.state.visible ? 1 : 0}}
>
<Profile tabLabel={User} navigator={this.props.navigator} />
<Home tabLabel={Tinder} navigator={this.props.navigator} />
<Chat tabLabel={Message} navigator={this.props.navigator} />
</ScrollableTabView>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#F5FCFF',
},
});