From b24a95e29a0ee4b67694e9ed6f9d8d17d44a8f21 Mon Sep 17 00:00:00 2001 From: devthejo Date: Fri, 10 Oct 2025 21:51:46 +0200 Subject: [PATCH] chore(contribute): hide donation CTAs on Android; keep on iOS; add neutral support link to https://alerte-secours.fr for Play policy compliance --- src/scenes/Contribute/index.js | 208 +++++++++++++++++++++------------ 1 file changed, 136 insertions(+), 72 deletions(-) diff --git a/src/scenes/Contribute/index.js b/src/scenes/Contribute/index.js index 95a7eda..d47b000 100644 --- a/src/scenes/Contribute/index.js +++ b/src/scenes/Contribute/index.js @@ -4,6 +4,7 @@ import { ScrollView, Linking, Alert, + Platform, TouchableOpacity, } from "react-native"; import { MaterialIcons, AntDesign } from "@expo/vector-icons"; @@ -31,6 +32,8 @@ export default function Contribute() { const styles = useStyles(); const { colors } = useTheme(); + const donateAllowed = Platform.OS === "ios"; + return ( @@ -42,80 +45,97 @@ export default function Contribute() { {/* Description */} - Alerte-Secours est une application mobile citoyenne, gratuite, sans - publicité ni exploitation de données. - {"\n\n"} - Si vous souhaitez contribuer à son développement, sa maintenance et - son indépendance : + Alerte-Secours est une application citoyenne d'intérêt général, elle + est gratuite, sans publicité ni exploitation de données. + {"\n"} + {donateAllowed + ? `Si vous souhaitez contribuer à son développement, sa maintenance et son indépendance :` + : ""} - {/* Liberapay Button */} - openURL("https://liberapay.com/alerte-secours")} - activeOpacity={0.8} - > - - - - - Liberapay – Soutien régulier - - Pour un soutien récurrent et engagé. Chaque don contribue à - assurer la stabilité du service sur le long terme. - - - + + {donateAllowed ? ( + <> + Soutenir le projet + {/* Liberapay Button */} + openURL("https://liberapay.com/alerte-secours")} + activeOpacity={0.8} + > + + + + + + Liberapay – Soutien régulier + + + Pour un soutien récurrent et engagé. Chaque don contribue à + assurer la stabilité du service sur le long terme. + + + - {/* Buy Me a Coffee Button */} - openURL("https://buymeacoffee.com/alertesecours")} - activeOpacity={0.8} - > - - - - - - Buy Me a Coffee – Don ponctuel - - - Pour un coup de pouce ponctuel, un café virtuel pour encourager le - travail accompli ! - - - + {/* Buy Me a Coffee Button */} + + openURL("https://buymeacoffee.com/alertesecours") + } + activeOpacity={0.8} + > + + + + + + Buy Me a Coffee – Don ponctuel + + + Pour un coup de pouce ponctuel, un café virtuel pour + encourager le travail accompli ! + + + - {/* GitHub Sponsors Button */} - openURL("https://github.com/sponsors/alerte-secours")} - activeOpacity={0.8} - > - - - - - GitHub Sponsors - - Pour les développeurs et utilisateurs de GitHub : soutenez le - projet directement via votre compte. - - - + {/* GitHub Sponsors Button */} + + openURL("https://github.com/sponsors/alerte-secours") + } + activeOpacity={0.8} + > + + + + + GitHub Sponsors + + Pour les développeurs et utilisateurs de GitHub : soutenez + le projet directement via votre compte. + + + + + ) : null} + {/* Collaboration Section */} @@ -138,6 +158,18 @@ export default function Contribute() { contact@alertesecours.fr + {!donateAllowed && ( + + Vous pouvez aussi nous soutenir financièrement, pour en savoir + plus, rendez-vous sur notre site{" "} + openURL("https://alerte-secours.fr")} + > + alerte-secours.fr + + + )} @@ -164,7 +196,7 @@ const useStyles = createStyles(({ theme: { colors, custom } }) => ({ fontSize: 16, lineHeight: 26, color: colors.onBackground, - marginBottom: 36, + marginBottom: 0, textAlign: "left", }, donationButton: { @@ -229,9 +261,41 @@ const useStyles = createStyles(({ theme: { colors, custom } }) => ({ githubButton: { backgroundColor: custom.donation.github, }, + // Android support link (no CTA styling) + androidSupportContainer: { + marginVertical: 8, + marginBottom: 24, + paddingVertical: 8, + }, + androidSupportText: { + fontSize: 15, + color: colors.primary, + textAlign: "left", + }, + linkText: { + color: colors.primary, + textDecorationLine: "underline", + }, + supportFooterText: { + marginTop: 12, + fontSize: 15, + color: colors.onSurfaceVariant, + textAlign: "center", + }, + // Donation section + sectionTitle: { + fontSize: 20, + fontWeight: "700", + color: colors.primary, + marginTop: 12, + marginBottom: 12, + }, + donationSection: { + marginBottom: 24, + }, // Collaboration section styles collaborationSection: { - marginTop: 40, + marginTop: 32, padding: 20, backgroundColor: colors.surfaceVariant, borderRadius: 16,