forked from rescript-react-native/rescript-react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtouchableOpacity.re
More file actions
88 lines (86 loc) · 2.56 KB
/
touchableOpacity.re
File metadata and controls
88 lines (86 loc) · 2.56 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
80
81
82
83
84
85
86
87
88
[@bs.module "react-native"]
external view: ReasonReact.reactClass = "TouchableOpacity";
[@bs.send]
external setOpacityTo: (ReasonReact.reactRef, float, int) => unit =
"setOpacityTo";
let make =
(
~accessible=?,
~accessibilityLabel=?,
~accessibilityComponentType=?,
~accessibilityTraits=?,
~delayLongPress=?,
~delayPressIn=?,
~delayPressOut=?,
~disabled=?,
~hitSlop=?,
~style=?,
~onLayout=?,
~onPress=?,
~onLongPress=?,
~onPressIn=?,
~onPressOut=?,
~pressRetentionOffset=?,
~activeOpacity=?,
~focusedOpacity=?,
~tvParallaxProperties=?,
) =>
ReasonReact.wrapJsForReason(
~reactClass=view,
~props={
"accessible": accessible,
"accessibilityLabel": accessibilityLabel,
"delayLongPress": delayLongPress,
"delayPressIn": delayPressIn,
"delayPressOut": delayPressOut,
"disabled": disabled,
"hitSlop": hitSlop,
"style": style,
"onLayout": onLayout,
"onPress": onPress,
"onLongPress": onLongPress,
"onPressIn": onPressIn,
"onPressOut": onPressOut,
"pressRetentionOffset": pressRetentionOffset,
"accessibilityComponentType":
UtilsRN.option_map(
x =>
switch (x) {
| `none => "none"
| `button => "button"
| `radiobutton_checked => "radiobutton_checked-none"
| `radiobutton_unchecked => "radiobutton_unchecked"
},
accessibilityComponentType,
),
"accessibilityTraits":
UtilsRN.option_map(
traits => {
let to_string =
fun
| `none => "none"
| `button => "button"
| `link => "link"
| `header => "header"
| `search => "search"
| `image => "image"
| `selected => "selected"
| `plays => "plays"
| `key => "key"
| `text => "text"
| `summary => "summary"
| `disabled => "disabled"
| `frequentUpdates => "frequentUpdates"
| `startsMedia => "startsMedia"
| `adjustable => "adjustable"
| `allowsDirectInteraction => "allowsDirectInteraction"
| `pageTurn => "pageTurn";
traits |> List.map(to_string) |> Array.of_list;
},
accessibilityTraits,
),
"focusedOpacity": focusedOpacity,
"activeOpacity": activeOpacity,
"tvParallaxProperties": tvParallaxProperties,
},
);