@@ -3,45 +3,49 @@ import {
33 TouchableOpacity as RNTouchableOpacity ,
44 StyleSheet ,
55 Text as RNText ,
6- } from 'react-native'
6+ } from 'react-native' ;
77
88// @ts -ignore
9- function Button ( props ) {
10- const { intercom_title, intercom_disabled, intercom_onPress, intercom_accesibilityLabel } = props ;
11- const onPress = useCallback ( ( ) => {
12- intercom_onPress ( ) ;
13- } , [ intercom_onPress ] ) ;
9+ function Button ( props ) {
10+ const {
11+ intercom_title,
12+ intercom_disabled,
13+ intercom_onPress,
14+ intercom_accesibilityLabel,
15+ } = props ;
16+ const onPress = useCallback ( ( ) => {
17+ intercom_onPress ( ) ;
18+ } , [ intercom_onPress ] ) ;
1419
15- return (
16- < RNTouchableOpacity
17- style = { buttonStyles ( props ) . touchableOpacity }
18- onPress = { onPress }
19- disabled = { intercom_disabled }
20- accessibilityLabel = { intercom_accesibilityLabel }
21- >
22- < RNText
23- style = { buttonStyles ( props ) . text }
24- allowFontScaling = { false } >
25- { intercom_title }
26- </ RNText >
27- </ RNTouchableOpacity >
28- )
20+ return (
21+ < RNTouchableOpacity
22+ style = { buttonStyles ( props ) . touchableOpacity }
23+ onPress = { onPress }
24+ disabled = { intercom_disabled }
25+ accessibilityLabel = { intercom_accesibilityLabel }
26+ >
27+ < RNText style = { buttonStyles ( props ) . text } allowFontScaling = { false } >
28+ { intercom_title }
29+ </ RNText >
30+ </ RNTouchableOpacity >
31+ ) ;
2932}
3033
3134// @ts -ignore
32- export const buttonStyles = ( props ) => StyleSheet . create ( {
33- touchableOpacity : {
34- backgroundColor : props . intercom_disabled ? '#f4f4f4' : '#0096FF' ,
35- borderRadius : 5 ,
36- padding : 8 ,
37- justifyContent : 'center' ,
38- alignItems : 'center' ,
39- marginTop : 3 ,
40- marginBottom : 3
41- } ,
42- text : {
43- color : props . intercom_disabled ? '#808080' : 'white'
44- } ,
45- } ) ;
35+ export const buttonStyles = ( props ) =>
36+ StyleSheet . create ( {
37+ touchableOpacity : {
38+ backgroundColor : props . intercom_disabled ? '#f4f4f4' : '#0096FF' ,
39+ borderRadius : 5 ,
40+ padding : 8 ,
41+ justifyContent : 'center' ,
42+ alignItems : 'center' ,
43+ marginTop : 3 ,
44+ marginBottom : 3 ,
45+ } ,
46+ text : {
47+ color : props . intercom_disabled ? '#808080' : 'white' ,
48+ } ,
49+ } ) ;
4650
47- export default memo ( Button ) ;
51+ export default memo ( Button ) ;
0 commit comments