1
1
// @flow
2
2
3
- import * as React from ' react' ;
4
- import { NativeModules , requireNativeComponent } from ' react-native' ;
3
+ import * as React from " react" ;
4
+ import { NativeModules , requireNativeComponent } from " react-native" ;
5
5
6
6
type PKPaymentButtonType =
7
7
// A button with the Apple Pay logo only.
8
- | ' plain'
9
- // A button with the text “Buy with ” and the Apple Pay logo.
10
- | 'buy'
11
- // A button prompting the user to set up a card .
12
- | 'setUp'
8
+ | " plain"
9
+ // A button with the text “Set up ” and the Apple Pay logo.
10
+ | "setUp"
11
+ // A button with the text “Continue with” and the Apple Pay logo .
12
+ | "continue"
13
13
// A button with the text “Pay with” and the Apple Pay logo.
14
- | 'inStore'
15
- // A button with the text "Donate with" and the Apple Pay logo.
16
- | 'donate' ;
14
+ | "inStore" ;
17
15
18
16
type PKPaymentButtonStyle =
19
17
// A white button with black lettering (shown here against a gray background to ensure visibility).
20
- | ' white'
18
+ | " white"
21
19
// A white button with black lettering and a black outline.
22
- | ' whiteOutline'
20
+ | " whiteOutline"
23
21
// A black button with white lettering.
24
- | ' black' ;
22
+ | " black" ;
25
23
26
24
type Props = $Exact < {
27
25
style : ButtonStyle ,
@@ -32,18 +30,17 @@ type Props = $Exact<{
32
30
onPress : Function ,
33
31
} > ;
34
32
35
- const RNPKPaymentButton = requireNativeComponent ( ' PKPaymentButton' , null , {
33
+ const RNPKPaymentButton = requireNativeComponent ( " PKPaymentButton" , null , {
36
34
nativeOnly : { onPress : true } ,
37
35
} ) ;
38
36
39
-
40
37
export type ButtonType = PKPaymentButtonType ;
41
38
export type ButtonStyle = PKPaymentButtonStyle ;
42
39
43
40
export class PKPaymentButton extends React . Component < Props > {
44
41
static defaultProps = {
45
- buttonStyle : ' black' ,
46
- buttonType : ' plain' ,
42
+ buttonStyle : " black" ,
43
+ buttonType : " plain" ,
47
44
height : 44 ,
48
45
cornerRadius : 4 ,
49
46
} ;
0 commit comments