chore: fix push notif

This commit is contained in:
2026-03-18 21:08:25 +01:00
parent a00dd475f3
commit a656ee96c0
2 changed files with 46 additions and 29 deletions
+42 -27
View File
@@ -56,6 +56,7 @@ export default function CheckoutScreen() {
// Crypto
const [cryptoEnabled, setCryptoEnabled] = useState(false);
const [cryptoOnly, setCryptoOnly] = useState(false);
const [cryptoCurrencies, setCryptoCurrencies] = useState<string[]>([]);
const [paymentMethod, setPaymentMethod] = useState<"especes" | "crypto">("especes");
const [payCurrency, setPayCurrency] = useState("");
@@ -73,6 +74,10 @@ export default function CheckoutScreen() {
setCryptoEnabled(true);
setCryptoCurrencies(settings.nowpayments_currencies);
setPayCurrency(settings.nowpayments_currencies[0]);
if (settings.crypto_only) {
setCryptoOnly(true);
setPaymentMethod("crypto");
}
}
});
AsyncStorage.multiGet([
@@ -379,6 +384,14 @@ export default function CheckoutScreen() {
color: colors.textMuted, fontSize: fontSize.xs, textAlign: "center",
},
cryptoSuccessText: { color: colors.success, fontSize: fontSize.sm, textAlign: "center" },
// Crypto only badge
cryptoOnlyBadge: {
flexDirection: "row", alignItems: "center", gap: spacing.s,
backgroundColor: "rgba(247,147,26,0.10)", borderRadius: borderRadius.md,
borderWidth: 1, borderColor: CRYPTO_COLOR + "55",
padding: spacing.m, marginBottom: spacing.s,
},
cryptoOnlyText: { color: CRYPTO_COLOR, fontSize: fontSize.sm, fontWeight: fontWeight.medium, flex: 1 },
}),
[colors],
);
@@ -470,34 +483,36 @@ export default function CheckoutScreen() {
{cryptoEnabled && (
<View style={styles.section}>
<Text style={styles.sectionTitle}>Méthode de paiement</Text>
<View style={styles.paymentMethodRow}>
<TouchableOpacity
style={[styles.paymentMethodBtn, paymentMethod === "especes" && styles.paymentMethodBtnActive]}
onPress={() => setPaymentMethod("especes")}
>
<Ionicons
name="cash-outline"
size={22}
color={paymentMethod === "especes" ? CRYPTO_COLOR : colors.textMuted}
/>
<Text style={[styles.paymentMethodBtnText, paymentMethod === "especes" && styles.paymentMethodBtnTextActive]}>
Espèces
{cryptoOnly ? (
<View style={styles.cryptoOnlyBadge}>
<Ionicons name="logo-bitcoin" size={18} color={CRYPTO_COLOR} />
<Text style={styles.cryptoOnlyText}>
Paiement uniquement en cryptomonnaie
</Text>
</TouchableOpacity>
<TouchableOpacity
style={[styles.paymentMethodBtn, paymentMethod === "crypto" && styles.paymentMethodBtnActive]}
onPress={() => setPaymentMethod("crypto")}
>
<Ionicons
name="logo-bitcoin"
size={22}
color={paymentMethod === "crypto" ? CRYPTO_COLOR : colors.textMuted}
/>
<Text style={[styles.paymentMethodBtnText, paymentMethod === "crypto" && styles.paymentMethodBtnTextActive]}>
Crypto
</Text>
</TouchableOpacity>
</View>
</View>
) : (
<View style={styles.paymentMethodRow}>
<TouchableOpacity
style={[styles.paymentMethodBtn, paymentMethod === "especes" && styles.paymentMethodBtnActive]}
onPress={() => setPaymentMethod("especes")}
>
<Ionicons name="cash-outline" size={22} color={paymentMethod === "especes" ? CRYPTO_COLOR : colors.textMuted} />
<Text style={[styles.paymentMethodBtnText, paymentMethod === "especes" && styles.paymentMethodBtnTextActive]}>
Espèces
</Text>
</TouchableOpacity>
<TouchableOpacity
style={[styles.paymentMethodBtn, paymentMethod === "crypto" && styles.paymentMethodBtnActive]}
onPress={() => setPaymentMethod("crypto")}
>
<Ionicons name="logo-bitcoin" size={22} color={paymentMethod === "crypto" ? CRYPTO_COLOR : colors.textMuted} />
<Text style={[styles.paymentMethodBtnText, paymentMethod === "crypto" && styles.paymentMethodBtnTextActive]}>
Crypto
</Text>
</TouchableOpacity>
</View>
)}
{paymentMethod === "crypto" && (
<>