-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
79 lines (74 loc) · 1.84 KB
/
Copy pathApp.tsx
File metadata and controls
79 lines (74 loc) · 1.84 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
69
70
71
72
73
74
75
76
77
78
79
import { StyleSheet, View, Text } from 'react-native';
import InteractiveTutorial, { TARGETS } from './InteractiveTutorial';
import {
addBorderRadius,
addSize,
useUiElement,
} from 'react-native-interactive-tutorial';
import useTutorialRunner from './useTutorialRunner';
import { SafeAreaProvider } from 'react-native-safe-area-context';
export default function Root() {
return (
<SafeAreaProvider>
<InteractiveTutorial>
<App />
</InteractiveTutorial>
</SafeAreaProvider>
);
}
function App() {
useTutorialRunner();
const target1 = useUiElement(TARGETS.Target1, (_) => addBorderRadius(_, 10));
const target2 = useUiElement(TARGETS.Target2, (_) =>
addSize(addBorderRadius(_, 10), 30)
);
const target3 = useUiElement(TARGETS.Target3, (_) => addBorderRadius(_, 10));
return (
<View style={[styles.root, styles.column]}>
<View style={styles.column}>
<View style={styles.row}>
<View
style={[styles.column, styles.card]}
ref={target1.ref}
onLayout={target1.onLayout}
>
<Text>Target 1</Text>
</View>
<View
style={[styles.column, styles.card]}
ref={target2.ref}
onLayout={target2.onLayout}
>
<Text>Target 3</Text>
</View>
</View>
<View
ref={target3.ref}
onLayout={target3.onLayout}
style={[styles.column, styles.card, { flex: 2 }]}
>
<Text>Target 2</Text>
</View>
</View>
</View>
);
}
const styles = StyleSheet.create({
root: {
padding: 50,
},
column: {
flexDirection: 'column',
flex: 1,
},
row: {
flexDirection: 'row',
flex: 1,
},
card: {
borderWidth: 1,
padding: 10,
justifyContent: 'center',
alignItems: 'center',
},
});