-
-
Notifications
You must be signed in to change notification settings - Fork 243
Expand file tree
/
Copy pathTourGuideZone.tsx
More file actions
61 lines (58 loc) 路 1.25 KB
/
Copy pathTourGuideZone.tsx
File metadata and controls
61 lines (58 loc) 路 1.25 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
import * as React from 'react'
import { StyleProp, ViewStyle } from 'react-native'
import { BorderRadiusObject, Shape } from '../types'
import { Step } from './Step'
import { Wrapper } from './Wrapper'
export interface TourGuideZoneProps {
zone: number
tourKey?: string
isTourGuide?: boolean
text?: string
shape?: Shape
maskOffset?: number
borderRadius?: number
children?: React.ReactNode
style?: StyleProp<ViewStyle>
keepTooltipPosition?: boolean
tooltipBottomOffset?: number
tooltipLeftOffset?: number
borderRadiusObject?: BorderRadiusObject
}
export const TourGuideZone = ({
isTourGuide = true,
tourKey = '_default',
zone,
children,
shape,
text,
maskOffset,
borderRadius,
style,
keepTooltipPosition,
tooltipBottomOffset,
tooltipLeftOffset,
borderRadiusObject,
}: TourGuideZoneProps) => {
if (!isTourGuide) {
return <>{children}</>
}
return (
<Step
text={text ?? `Zone ${zone}`}
order={zone}
name={`${zone}`}
{...{
tourKey,
shape,
maskOffset,
borderRadius,
keepTooltipPosition,
tooltipBottomOffset,
tooltipLeftOffset,
borderRadiusObject,
}}
>
<Wrapper {...{ style }}>{children}</Wrapper>
</Step>
)
}