Cleanup donation button fork on iOS

This commit is contained in:
Sofiya Tepikin
2022-07-10 19:04:30 +02:00
parent c311900e27
commit 3b45a32727
2 changed files with 10 additions and 16 deletions
+1 -8
View File
@@ -11,21 +11,19 @@ const Button = ({
children, children,
iconName, iconName,
isCTA, isCTA,
isVisible,
isSmall, isSmall,
onPress, onPress,
testID, testID,
...props ...props
}) => { }) => {
const buttonStyle = isCTA ? styles.cta : styles.regular const buttonStyle = isCTA ? styles.cta : styles.regular
const buttonDisplay = isVisible ? styles.isVisible : null
const textCTA = isCTA ? styles.buttonTextBold : styles.buttonTextRegular const textCTA = isCTA ? styles.buttonTextBold : styles.buttonTextRegular
const textStyle = [textCTA, isSmall ? textSmall : text] const textStyle = [textCTA, isSmall ? textSmall : text]
return ( return (
<TouchableOpacity <TouchableOpacity
onPress={onPress} onPress={onPress}
style={[buttonStyle, buttonDisplay]} style={buttonStyle}
testID={testID} testID={testID}
{...props} {...props}
> >
@@ -39,7 +37,6 @@ Button.propTypes = {
children: PropTypes.node, children: PropTypes.node,
iconName: PropTypes.string, iconName: PropTypes.string,
isCTA: PropTypes.bool, isCTA: PropTypes.bool,
isVisible: PropTypes.bool,
isSmall: PropTypes.bool, isSmall: PropTypes.bool,
onPress: PropTypes.func, onPress: PropTypes.func,
testID: PropTypes.string, testID: PropTypes.string,
@@ -79,10 +76,6 @@ const styles = StyleSheet.create({
borderRadius: 25, borderRadius: 25,
...button, ...button,
}, },
isVisible: {
display: 'none',
...button,
},
buttonTextBold: { buttonTextBold: {
color: 'white', color: 'white',
fontFamily: Fonts.bold, fontFamily: Fonts.bold,
+9 -8
View File
@@ -36,14 +36,15 @@ const AboutSection = () => {
</Segment> </Segment>
<Segment title={labels.donate.title}> <Segment title={labels.donate.title}>
<AppText>{labels.donate.note}</AppText> <AppText>{labels.donate.note}</AppText>
<Button {Platform.OS !== 'ios' && (
isVisible={Platform.OS === 'ios' ? true : false} <Button
isCTA isCTA
isSmall isSmall
onPress={() => Linking.openURL(links.donate.url)} onPress={() => Linking.openURL(links.donate.url)}
> >
{links.donate.text} {links.donate.text}
</Button> </Button>
)}
</Segment> </Segment>
<Segment title={labels.version.title} last> <Segment title={labels.version.title} last>
<AppText>{require('../../package.json').version}</AppText> <AppText>{require('../../package.json').version}</AppText>