-
Notifications
You must be signed in to change notification settings - Fork 17
/
TourButton.js
76 lines (73 loc) · 2.27 KB
/
TourButton.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
import React from 'react'
import { TouchableOpacity, Text } from 'react-native'
import { showTipTour } from '../Tip'
import { useNavigation } from '@react-navigation/core'
const TourButton = () => {
const navigation = useNavigation()
return (
<TouchableOpacity
onPress={() => showTipTour([
{
id: 'center',
prevId: 'top-right',
nextId: 'bottom-left'
},
{
id: 'bottom-left',
prevId: 'center',
nextId: 'bottom-right'
},
{
id: 'bottom-right',
prevId: 'bottom-left',
nextId: 'tab1'
},
{
id: 'tab1',
prevId: 'bottom-right',
nextId: 'tab2'
},
{
id: 'tab2',
prevId: 'tab1',
nextId: 'heart',
delay: 300,
nextAction: () => navigation.navigate('AnotherScreen'),
prevAction: () => navigation.navigate('HomeScreen')
},
{
id: 'heart',
prevId: 'tab2',
nextId: 'top-left',
delay: 300,
nextAction: () => navigation.navigate('HomeScreen')
},
{
id: 'top-left',
prevId: 'heart',
delay: 300,
prevAction: () => navigation.navigate('AnotherScreen')
}
])}
style={{
position: 'absolute',
top: 180,
left: 20,
borderWidth: 1,
borderRadius: 5
}}
>
<Text
style={{
padding: 10,
borderRadius: 5,
fontWeight: 'bold',
fontSize: 16,
color: 'black',
textTransform: 'uppercase'
}}
>Start tip tour</Text>
</TouchableOpacity>
)
}
export default TourButton