/
FollowButton.js
45 lines (42 loc) · 1 KB
/
FollowButton.js
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
36
37
38
39
40
41
42
43
44
45
import React from 'react';
import { StyleSheet, Text } from 'react-native';
import { connectLocalization } from './Localization';
import PXTouchable from './PXTouchable';
import { globalStyleVariables } from '../styles';
const styles = StyleSheet.create({
button: {
backgroundColor: 'rgba(0,0,0,0)',
borderColor: globalStyleVariables.PRIMARY_COLOR,
borderWidth: 1,
borderRadius: 5,
alignItems: 'center',
},
buttonText: {
padding: 8,
color: globalStyleVariables.PRIMARY_COLOR,
},
});
const FollowButton = (props) => {
const {
isFollow,
onPress,
onLongPress,
i18n,
buttonStyle,
textStyle,
...restProps
} = props;
return (
<PXTouchable
style={[styles.button, buttonStyle]}
onPress={onPress}
onLongPress={onLongPress}
{...restProps}
>
<Text style={[styles.buttonText, textStyle]}>
{isFollow ? i18n.following : i18n.follow}
</Text>
</PXTouchable>
);
};
export default connectLocalization(FollowButton);