Skip to content

Commit e8ffa18

Browse files
author
Luiz Carlos Vieira
committed
The "cancel" button now considers an object in addition to a plain string, so it is possible to use a custom component (just like with the other options).
1 parent bda7d57 commit e8ffa18

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lib/CancelButton.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,15 @@ class CancelButton extends PureComponent {
3232
},
3333
]}
3434
>
35-
<Text
36-
style={[styles.buttonTitle, styles.cancelTitle, { color: tintColor }]}
37-
>
38-
{options[cancelButtonIndex]}
39-
</Text>
35+
{
36+
options[cancelButtonIndex].component
37+
? options[cancelButtonIndex].component
38+
: (
39+
<Text style={[styles.buttonTitle, styles.cancelTitle, { color: tintColor }]}>
40+
{options[cancelButtonIndex]}
41+
</Text>
42+
)
43+
}
4044
</TouchableHighlight>
4145
)
4246
}

0 commit comments

Comments
 (0)