-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
87 lines (80 loc) · 2.59 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import React, { Component } from 'react';
import { StyleSheet, Text, View, Image, TouchableOpacity, ImageBackground } from 'react-native';
import { Dialogflow_V2 } from 'react-native-dialogflow';
import { dialogflowConfig } from './env.js';
import Welcome from './components/welcome'
import SplashScreen from 'react-native-splash-screen';
import Icon from 'react-native-vector-icons/FontAwesome';
import Bot from './components/bot.js';
class App extends Component {
constructor(props) {
super(props);
this.state = {
showBot: false
}
}
componentDidMount() {
// console.log('moutned');
Dialogflow_V2.setConfiguration(
dialogflowConfig.client_email,
dialogflowConfig.private_key,
Dialogflow_V2.LANG_ENGLISH_US,
dialogflowConfig.project_id
);
SplashScreen.hide();
}
toggleBot = () => {
this.setState({showBot: !this.state.showBot});
}
render() {
return (
<View style={{flex: 1, backgroundColor: 'rgb(0,73,144)'}}>
<View style={{justifyContent: 'center', alignItems: 'center', position: 'absolute'}} >
<Image style={{left: 38, top: 100}} source={require('./data/photo/logoWhite.png')} />
</View>
{this.state.showBot ?
<Bot/>
:
null
}
<TouchableOpacity
style={{
borderWidth:1,
borderColor:'rgba(0,0,0,0.2)',
alignItems:'center',
justifyContent:'center',
width:70,
position: 'absolute',
bottom: 10,
right: 10,
height:70,
backgroundColor:'#fff',
borderRadius:100,
}}
onPress={this.toggleBot}
>
<Icon name="comment" size={30} color="rgb(0,73,144)" />
</TouchableOpacity>
<TouchableOpacity
style={{
borderWidth:1,
borderColor:'rgba(0,0,0,0.2)',
alignItems:'center',
justifyContent:'center',
width:70,
position: 'absolute',
top: 50,
right: 10,
height:70,
backgroundColor:'#fff',
borderRadius:100,
}}
onPress={this.toggleBot}
>
<Icon name="shopping-cart" size={30} color="rgb(0,73,144)" />
</TouchableOpacity>
</View>
);
}
}
export default App;