From 8721bc484c7ddf809731b1d96bb40cb727d35e6c Mon Sep 17 00:00:00 2001 From: BloodyMarie Date: Sun, 22 May 2022 15:02:20 +0200 Subject: [PATCH] Feature: Remove donate button for iOS --- components/common/button.js | 29 ++++++++++++++++++----------- components/settings/about.js | 9 +++++++-- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/components/common/button.js b/components/common/button.js index 737a483..cfb73b4 100644 --- a/components/common/button.js +++ b/components/common/button.js @@ -11,19 +11,21 @@ const Button = ({ children, iconName, isCTA, + isVisible, isSmall, onPress, testID, ...props }) => { const buttonStyle = isCTA ? styles.cta : styles.regular + const buttonDisplay = isVisible ? styles.isVisible : null const textCTA = isCTA ? styles.buttonTextBold : styles.buttonTextRegular const textStyle = [textCTA, isSmall ? textSmall : text] return ( @@ -37,24 +39,25 @@ Button.propTypes = { children: PropTypes.node, iconName: PropTypes.string, isCTA: PropTypes.bool, + isVisible: PropTypes.bool, isSmall: PropTypes.bool, onPress: PropTypes.func, - testID: PropTypes.string + testID: PropTypes.string, } Button.defaultProps = { - isSmall: true + isSmall: true, } const text = { padding: Spacing.base, - textTransform: 'uppercase' + textTransform: 'uppercase', } const textSmall = { fontSize: Sizes.small, padding: Spacing.small, - textTransform: 'uppercase' + textTransform: 'uppercase', } const button = { @@ -64,26 +67,30 @@ const button = { justifyContent: 'center', marginTop: Spacing.base, paddingHorizontal: Spacing.tiny, - minWidth: '15%' + minWidth: '15%', } const styles = StyleSheet.create({ regular: { - ...button + ...button, }, cta: { backgroundColor: Colors.orange, borderRadius: 25, - ...button + ...button, + }, + isVisible: { + display: 'none', + ...button, }, buttonTextBold: { color: 'white', - fontFamily: Fonts.bold + fontFamily: Fonts.bold, }, buttonTextRegular: { color: Colors.greyDark, - fontFamily: Fonts.main - } + fontFamily: Fonts.main, + }, }) export default Button diff --git a/components/settings/about.js b/components/settings/about.js index 6902c33..e9b8963 100644 --- a/components/settings/about.js +++ b/components/settings/about.js @@ -1,5 +1,5 @@ import React from 'react' -import { Linking } from 'react-native' +import { Platform, Linking } from 'react-native' import AppPage from '../common/app-page' import AppText from '../common/app-text' @@ -36,7 +36,12 @@ const AboutSection = () => { {labels.donate.note} -