-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
90 lines (87 loc) · 1.52 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
88
89
90
import React from 'react';
import {
View,
Text,
StyleSheet,
Image
} from 'react-native';
import ChatBot from 'react-native-chatbot';
const style = StyleSheet.create({
container: {
flex: 1,
// alignItems: 'center',
// justifyContent: 'center'
},
text: {
fontSize: 25
}
});
const steps = [
{
id: '1',
message: 'hello how are you?',
trigger: '2'
},
{
id: '2',
message: 'SUBSCRIBE to TekNik GG',
trigger: '3'
},
{
id: '3',
user: true,
trigger: '4' //this step calls
},
{
id: '4',
message: "about this video is asking by Brian Brian Am i correct?",
trigger: '5'
},
{
id: '5',
options: [
{ value: 'yes', label: 'yes', trigger: '6' },
{ value: 'no', label: 'no', trigger: '7' }
]
},
{
id: '6',
message: 'You choose yes!!!',
trigger: ({ value, steps }) => {
if(steps['8'] === undefined) {
return '8';
} else {
return '9';
}
}
},
{
id: '7',
message: 'You choose no!!!',
trigger: '8'
},
{
id: '8',
message: 'can we move to next custom component',
trigger: '5'
},
{
id: '9',
component: <Image source={require('./teknikgg.png')} style={{ width: 300, height: 180 }} />,
trigger: '10'
},
{
id: '10',
message: 'ThankYou For Watching...',
end: true
}
]
export default class App extends React.Component {
render() {
return (
<View style={style.container}>
<ChatBot steps={steps} />
</View>
);
}
}