improve non-nfc enabled apple device message

This commit is contained in:
ppc
2025-05-04 19:10:28 +01:00
parent d917f8832a
commit 78668a1b6a
+8 -5
View File
@@ -5,7 +5,7 @@ import {Platform, TouchableOpacity, View} from "react-native";
import {createNativeStackNavigator} from "@react-navigation/native-stack";
import {Card, Paragraph, Text, Title, useTheme} from "react-native-paper";
import {SmartphoneNfc, SquareAsterisk, SquarePlus} from "lucide-react-native";
import {ShieldBan, SmartphoneNfc, SquareAsterisk, SquarePlus} from "lucide-react-native";
import ManualCardEntry from "./ManualCardEntry";
import PhysicalCardScan from "./PhyscialCardScan";
@@ -42,10 +42,10 @@ function CardAddMethodSelector({navigation}) {
{nfcSupported !== null && (
<>
<MethodCard color="#03a9f4"
icon={<SmartphoneNfc/>}
<MethodCard title="Scan Physical Card"
disabled={!nfcSupported}
title="Scan Physical Card"
color={nfcSupported ? "#03a9f4" : "gray"}
icon={nfcSupported ? <SmartphoneNfc/> : <ShieldBan/>}
description={nfcSupported ? "Amusement IC or Transport cards supported" : "NFC is not supported on this device"}
onPress={() => navigation.navigate('Scan')}/>
@@ -102,4 +102,7 @@ function MethodCard(props: {
}
// the nfc library doesn't offer the same support for felica cards on android compared to ios...
export default Platform.OS === 'ios' ? CardAddModal : ManualCardEntry;
export default Platform.select({
ios: CardAddModal,
default: ManualCardEntry
});