Skip to content

Commit b4221e0

Browse files
MoOxcknitt
authored andcommitted
reason-react-native: fixes & improvements on Touchables (#433)
1 parent e639687 commit b4221e0

10 files changed

Lines changed: 124 additions & 46 deletions

‎reason-react-native/src/components/TouchableHighlight.md‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,25 @@ external make:
1313
(
1414
~ref: ref=?,
1515
// TouchableHighlight props
16+
~activeOpacity: float=?,
17+
~hasTVPreferredFocus: bool=?,
18+
~onHideUnderlay: unit => unit=?,
19+
~onShowUnderlay: unit => unit=?,
20+
~style: Style.t=?,
21+
~tvParallaxProperties: TV.parallax=?,
22+
~underlayColor: string=?,
23+
// TouchableWithoutFeedback props
1624
~accessible: bool=?,
17-
~accessibilityLabel: string=?,
1825
~accessibilityComponentType: [@bs.string] [
1926
| `none
2027
| `button
2128
| `radiobutton_checked
2229
| `radiobutton_unchecked
2330
]
2431
=?,
32+
~accessibilityHint: string=?,
33+
~accessibilityIgnoresInvertColors: bool=?,
34+
~accessibilityLabel: string=?,
2535
~accessibilityRole: [@bs.string] [
2636
| `none
2737
| `button
@@ -37,6 +47,7 @@ external make:
3747
]
3848
=?,
3949
~accessibilityStates: array(AccessibilityState.t)=?,
50+
~accessibilityTraits: array(AccessibilityTrait.t)=?,
4051
~delayLongPress: int=?,
4152
~delayPressIn: int=?,
4253
~delayPressOut: int=?,
@@ -48,13 +59,6 @@ external make:
4859
~onPressIn: Event.pressEvent => unit=?,
4960
~onPressOut: Event.pressEvent => unit=?,
5061
~pressRetentionOffset: Types.edgeInsets=?,
51-
~activeOpacity: float=?,
52-
~onHideUnderlay: unit => unit=?,
53-
~onShowUnderlay: unit => unit=?,
54-
~style: Style.t=?,
55-
~underlayColor: string=?,
56-
~hasTVPreferredFocus: bool=?,
57-
~tvParallaxProperties: Js.t({.})=?,
5862
~testID: string=?,
5963
~children: React.element=?
6064
) =>

‎reason-react-native/src/components/TouchableHighlight.re‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,25 @@ external make:
66
(
77
~ref: ref=?,
88
// TouchableHighlight props
9+
~activeOpacity: float=?,
10+
~hasTVPreferredFocus: bool=?,
11+
~onHideUnderlay: unit => unit=?,
12+
~onShowUnderlay: unit => unit=?,
13+
~style: Style.t=?,
14+
~tvParallaxProperties: TV.parallax=?,
15+
~underlayColor: string=?,
16+
// TouchableWithoutFeedback props
917
~accessible: bool=?,
10-
~accessibilityLabel: string=?,
1118
~accessibilityComponentType: [@bs.string] [
1219
| `none
1320
| `button
1421
| `radiobutton_checked
1522
| `radiobutton_unchecked
1623
]
1724
=?,
25+
~accessibilityHint: string=?,
26+
~accessibilityIgnoresInvertColors: bool=?,
27+
~accessibilityLabel: string=?,
1828
~accessibilityRole: [@bs.string] [
1929
| `none
2030
| `button
@@ -30,6 +40,7 @@ external make:
3040
]
3141
=?,
3242
~accessibilityStates: array(AccessibilityState.t)=?,
43+
~accessibilityTraits: array(AccessibilityTrait.t)=?,
3344
~delayLongPress: int=?,
3445
~delayPressIn: int=?,
3546
~delayPressOut: int=?,
@@ -41,13 +52,6 @@ external make:
4152
~onPressIn: Event.pressEvent => unit=?,
4253
~onPressOut: Event.pressEvent => unit=?,
4354
~pressRetentionOffset: Types.edgeInsets=?,
44-
~activeOpacity: float=?,
45-
~onHideUnderlay: unit => unit=?,
46-
~onShowUnderlay: unit => unit=?,
47-
~style: Style.t=?,
48-
~underlayColor: string=?,
49-
~hasTVPreferredFocus: bool=?,
50-
~tvParallaxProperties: Js.t({.})=?,
5155
~testID: string=?,
5256
~children: React.element=?
5357
) =>

‎reason-react-native/src/components/TouchableNativeFeedback.md‎

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,36 @@ external make:
3030
(
3131
~ref: ref=?,
3232
// TouchableNativeFeedback props
33+
~background: Background.t=?,
34+
~useForeground: bool=?,
35+
// TouchableWithoutFeedback props
3336
~accessible: bool=?,
34-
~accessibilityLabel: string=?,
3537
~accessibilityComponentType: [@bs.string] [
3638
| `none
3739
| `button
3840
| `radiobutton_checked
3941
| `radiobutton_unchecked
4042
]
4143
=?,
42-
~accessibilityTraits: array(string)=?,
44+
~accessibilityHint: string=?,
45+
~accessibilityIgnoresInvertColors: bool=?,
46+
~accessibilityLabel: string=?,
47+
~accessibilityRole: [@bs.string] [
48+
| `none
49+
| `button
50+
| `link
51+
| `search
52+
| `image
53+
| `keyboardkey
54+
| `text
55+
| `adjustable
56+
| `header
57+
| `summary
58+
| `imagebutton
59+
]
60+
=?,
61+
~accessibilityStates: array(AccessibilityState.t)=?,
62+
~accessibilityTraits: array(AccessibilityTrait.t)=?,
4363
~delayLongPress: int=?,
4464
~delayPressIn: int=?,
4565
~delayPressOut: int=?,
@@ -51,11 +71,8 @@ external make:
5171
~onPressIn: Event.pressEvent => unit=?,
5272
~onPressOut: Event.pressEvent => unit=?,
5373
~pressRetentionOffset: Types.edgeInsets=?,
54-
~style: Style.t=?,
55-
~background: Background.t=?,
56-
~useForeground: bool=?,
5774
~testID: string=?,
58-
~children: React.element
75+
~children: React.element=?
5976
) =>
6077
React.element =
6178
"TouchableNativeFeedback";

‎reason-react-native/src/components/TouchableNativeFeedback.re‎

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,36 @@ external make:
2323
(
2424
~ref: ref=?,
2525
// TouchableNativeFeedback props
26+
~background: Background.t=?,
27+
~useForeground: bool=?,
28+
// TouchableWithoutFeedback props
2629
~accessible: bool=?,
27-
~accessibilityLabel: string=?,
2830
~accessibilityComponentType: [@bs.string] [
2931
| `none
3032
| `button
3133
| `radiobutton_checked
3234
| `radiobutton_unchecked
3335
]
3436
=?,
35-
~accessibilityTraits: array(string)=?,
37+
~accessibilityHint: string=?,
38+
~accessibilityIgnoresInvertColors: bool=?,
39+
~accessibilityLabel: string=?,
40+
~accessibilityRole: [@bs.string] [
41+
| `none
42+
| `button
43+
| `link
44+
| `search
45+
| `image
46+
| `keyboardkey
47+
| `text
48+
| `adjustable
49+
| `header
50+
| `summary
51+
| `imagebutton
52+
]
53+
=?,
54+
~accessibilityStates: array(AccessibilityState.t)=?,
55+
~accessibilityTraits: array(AccessibilityTrait.t)=?,
3656
~delayLongPress: int=?,
3757
~delayPressIn: int=?,
3858
~delayPressOut: int=?,
@@ -44,11 +64,8 @@ external make:
4464
~onPressIn: Event.pressEvent => unit=?,
4565
~onPressOut: Event.pressEvent => unit=?,
4666
~pressRetentionOffset: Types.edgeInsets=?,
47-
~style: Style.t=?,
48-
~background: Background.t=?,
49-
~useForeground: bool=?,
5067
~testID: string=?,
51-
~children: React.element
68+
~children: React.element=?
5269
) =>
5370
React.element =
5471
"TouchableNativeFeedback";

‎reason-react-native/src/components/TouchableOpacity.md‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,23 @@ type ref = React.Ref.t(Js.nullable(element));
1212
external make:
1313
(
1414
~ref: ref=?,
15-
// TouchableOpacity props
15+
~activeOpacity: float=?,
16+
~focusedOpacity: float=?,
17+
~hasTVPreferredFocus: bool=?,
18+
~style: Style.t=?,
19+
~tvParallaxProperties: TV.parallax=?,
20+
// TouchableWithoutFeedback props
1621
~accessible: bool=?,
17-
~accessibilityLabel: string=?,
1822
~accessibilityComponentType: [@bs.string] [
1923
| `none
2024
| `button
2125
| `radiobutton_checked
2226
| `radiobutton_unchecked
2327
]
2428
=?,
29+
~accessibilityHint: string=?,
30+
~accessibilityIgnoresInvertColors: bool=?,
31+
~accessibilityLabel: string=?,
2532
~accessibilityRole: [@bs.string] [
2633
| `none
2734
| `button
@@ -37,23 +44,19 @@ external make:
3744
]
3845
=?,
3946
~accessibilityStates: array(AccessibilityState.t)=?,
47+
~accessibilityTraits: array(AccessibilityTrait.t)=?,
4048
~delayLongPress: int=?,
4149
~delayPressIn: int=?,
4250
~delayPressOut: int=?,
4351
~disabled: bool=?,
4452
~hitSlop: Types.edgeInsets=?,
45-
~style: Style.t=?,
4653
~onLayout: Event.layoutEvent => unit=?,
4754
~onLongPress: Event.pressEvent => unit=?,
4855
~onPress: Event.pressEvent => unit=?,
4956
~onPressIn: Event.pressEvent => unit=?,
5057
~onPressOut: Event.pressEvent => unit=?,
5158
~pressRetentionOffset: Types.edgeInsets=?,
52-
~activeOpacity: float=?,
53-
~focusedOpacity: float=?,
5459
~testID: string=?,
55-
// FIXME
56-
~tvParallaxProperties: Js.t({.})=?,
5760
~children: React.element=?
5861
) =>
5962
React.element =
@@ -62,4 +65,5 @@ external make:
6265
[@bs.send]
6366
external setOpacityTo: (ref, ~value: float, ~duration: float) => unit =
6467
"setOpacityTo";
68+
6569
```

‎reason-react-native/src/components/TouchableOpacity.re‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,23 @@ type ref = React.Ref.t(Js.nullable(element));
55
external make:
66
(
77
~ref: ref=?,
8-
// TouchableOpacity props
8+
~activeOpacity: float=?,
9+
~focusedOpacity: float=?,
10+
~hasTVPreferredFocus: bool=?,
11+
~style: Style.t=?,
12+
~tvParallaxProperties: TV.parallax=?,
13+
// TouchableWithoutFeedback props
914
~accessible: bool=?,
10-
~accessibilityLabel: string=?,
1115
~accessibilityComponentType: [@bs.string] [
1216
| `none
1317
| `button
1418
| `radiobutton_checked
1519
| `radiobutton_unchecked
1620
]
1721
=?,
22+
~accessibilityHint: string=?,
23+
~accessibilityIgnoresInvertColors: bool=?,
24+
~accessibilityLabel: string=?,
1825
~accessibilityRole: [@bs.string] [
1926
| `none
2027
| `button
@@ -30,23 +37,19 @@ external make:
3037
]
3138
=?,
3239
~accessibilityStates: array(AccessibilityState.t)=?,
40+
~accessibilityTraits: array(AccessibilityTrait.t)=?,
3341
~delayLongPress: int=?,
3442
~delayPressIn: int=?,
3543
~delayPressOut: int=?,
3644
~disabled: bool=?,
3745
~hitSlop: Types.edgeInsets=?,
38-
~style: Style.t=?,
3946
~onLayout: Event.layoutEvent => unit=?,
4047
~onLongPress: Event.pressEvent => unit=?,
4148
~onPress: Event.pressEvent => unit=?,
4249
~onPressIn: Event.pressEvent => unit=?,
4350
~onPressOut: Event.pressEvent => unit=?,
4451
~pressRetentionOffset: Types.edgeInsets=?,
45-
~activeOpacity: float=?,
46-
~focusedOpacity: float=?,
4752
~testID: string=?,
48-
// FIXME
49-
~tvParallaxProperties: Js.t({.})=?,
5053
~children: React.element=?
5154
) =>
5255
React.element =

‎reason-react-native/src/components/TouchableWithoutFeedback.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ external make:
1414
~ref: ref=?,
1515
// TouchableWithoutFeedback props
1616
~accessible: bool=?,
17-
~accessibilityLabel: string=?,
1817
~accessibilityComponentType: [@bs.string] [
1918
| `none
2019
| `button
2120
| `radiobutton_checked
2221
| `radiobutton_unchecked
2322
]
2423
=?,
24+
~accessibilityHint: string=?,
25+
~accessibilityIgnoresInvertColors: bool=?,
26+
~accessibilityLabel: string=?,
2527
~accessibilityRole: [@bs.string] [
2628
| `none
2729
| `button
@@ -37,6 +39,7 @@ external make:
3739
]
3840
=?,
3941
~accessibilityStates: array(AccessibilityState.t)=?,
42+
~accessibilityTraits: array(AccessibilityTrait.t)=?,
4043
~delayLongPress: int=?,
4144
~delayPressIn: int=?,
4245
~delayPressOut: int=?,
@@ -48,7 +51,6 @@ external make:
4851
~onPressIn: Event.pressEvent => unit=?,
4952
~onPressOut: Event.pressEvent => unit=?,
5053
~pressRetentionOffset: Types.edgeInsets=?,
51-
~style: Style.t=?,
5254
~testID: string=?,
5355
~children: React.element=?
5456
) =>

‎reason-react-native/src/components/TouchableWithoutFeedback.re‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ external make:
77
~ref: ref=?,
88
// TouchableWithoutFeedback props
99
~accessible: bool=?,
10-
~accessibilityLabel: string=?,
1110
~accessibilityComponentType: [@bs.string] [
1211
| `none
1312
| `button
1413
| `radiobutton_checked
1514
| `radiobutton_unchecked
1615
]
1716
=?,
17+
~accessibilityHint: string=?,
18+
~accessibilityIgnoresInvertColors: bool=?,
19+
~accessibilityLabel: string=?,
1820
~accessibilityRole: [@bs.string] [
1921
| `none
2022
| `button
@@ -30,6 +32,7 @@ external make:
3032
]
3133
=?,
3234
~accessibilityStates: array(AccessibilityState.t)=?,
35+
~accessibilityTraits: array(AccessibilityTrait.t)=?,
3336
~delayLongPress: int=?,
3437
~delayPressIn: int=?,
3538
~delayPressOut: int=?,
@@ -41,7 +44,6 @@ external make:
4144
~onPressIn: Event.pressEvent => unit=?,
4245
~onPressOut: Event.pressEvent => unit=?,
4346
~pressRetentionOffset: Types.edgeInsets=?,
44-
~style: Style.t=?,
4547
~testID: string=?,
4648
~children: React.element=?
4749
) =>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
4+
var parallaxDefault = true;
5+
6+
exports.parallaxDefault = parallaxDefault;
7+
/* No side effect */

0 commit comments

Comments
 (0)