-
-
Notifications
You must be signed in to change notification settings - Fork 430
Expand file tree
/
Copy pathTooltip.js
More file actions
68 lines (62 loc) · 1.6 KB
/
Tooltip.js
File metadata and controls
68 lines (62 loc) · 1.6 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// @flow
import React from 'react';
import { View, Text, Image, TouchableOpacity } from 'react-native';
import Button from './Button';
import styles from './style';
import type { Step } from '../types';
type Props = {
isFirstStep: boolean,
isLastStep: boolean,
handleNext: func,
handlePrev: func,
handleStop: func,
currentStep: Step,
};
const Tooltip = ({
isFirstStep,
isLastStep,
handleNext,
handlePrev,
handleStop,
currentStep,
}: Props) => {
return (
<View>
<View style={styles.extraComponentContainer}>
{currentStep.extraComponent}
</View>
<View style={styles.imageContainer}>
<Image style={{ flex: 1 }} source={currentStep.imageSource} />
</View>
<View style={styles.tooltipContainer}>
<Text testID="stepDescription" style={styles.tooltipText}>{currentStep.text}</Text>
</View>
<View style={[styles.bottomBar]}>
{
!isLastStep ?
<TouchableOpacity onPress={handleStop}>
<Button>Skip</Button>
</TouchableOpacity>
: null
}
{
!isFirstStep ?
<TouchableOpacity onPress={handlePrev}>
<Button>Previous</Button>
</TouchableOpacity>
: null
}
{
!isLastStep ?
<TouchableOpacity onPress={handleNext}>
<Button>Next</Button>
</TouchableOpacity> :
<TouchableOpacity onPress={handleStop}>
<Button>Finish</Button>
</TouchableOpacity>
}
</View>
</View>
)
};
export default Tooltip;