-
Notifications
You must be signed in to change notification settings - Fork 25
/
TouchableNativeFeedback.purs
35 lines (30 loc) · 1.63 KB
/
TouchableNativeFeedback.purs
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
-- See [TouchableNativeFeedback](https://facebook.github.io/react-native/docs/touchablenativefeedback.html)
module ReactNative.Components.TouchableNativeFeedback (
TouchableNativeFeedbackProps
, TouchableNativeBackground
, touchableNativeFeedback', touchableNativeFeedback
, selectableBackground, selectableBackgroundBorderless, ripple, canUseNativeForeground
) where
import Prelude
import React (ReactElement)
import ReactNative.Events (EventHandler, TouchEvent)
import ReactNative.PropTypes (Prop)
import ReactNative.PropTypes.Color (Color)
import ReactNative.Unsafe.ApplyProps (unsafeApplyProps)
import ReactNative.Unsafe.Components (touchableNativeFeedbackU)
import ReactNative.Components.Touchable(TouchablePropsEx)
foreign import data TouchableNativeBackground :: Type
type TouchableNativeFeedbackProps eff = TouchablePropsEx eff (
background :: TouchableNativeBackground
, useForeground :: Boolean
)
-- | Create a TouchableNativeFeedback with the given onPress handler
touchableNativeFeedback :: forall eff. EventHandler eff TouchEvent -> ReactElement -> ReactElement
touchableNativeFeedback onPress = touchableNativeFeedbackU {onPress}
-- | Create a TouchableNativeFeedback with the given props
touchableNativeFeedback' :: forall eff. Prop (TouchableNativeFeedbackProps eff) -> ReactElement -> ReactElement
touchableNativeFeedback' = touchableNativeFeedbackU <<< unsafeApplyProps {}
foreign import selectableBackground :: TouchableNativeBackground
foreign import selectableBackgroundBorderless :: TouchableNativeBackground
foreign import ripple :: Color -> Boolean -> TouchableNativeBackground
foreign import canUseNativeForeground :: Boolean