Merge remote-tracking branch 'origin/master'

This commit is contained in:
ppc
2025-03-16 19:01:39 +00:00
7 changed files with 678 additions and 151 deletions
+10 -2
View File
@@ -12,12 +12,20 @@
"applinks:card.ppc.moe"
],
"infoPlist": {
"NSAppTransportSecurity": {
"NSAllowsArbitraryLoads": true
},
"UIViewControllerBasedStatusBarAppearance": "NO",
"NFCReaderUsageDescription": "AMNet uses NFC to scan Physical IC Cards",
"com.apple.developer.nfc.readersession.felica.systemcodes": ["0003", "88b4"]
"com.apple.developer.nfc.readersession.felica.systemcodes": [
"0003",
"88b4"
]
},
"entitlements": {
"com.apple.developer.nfc.readersession.formats": ["TAG"]
"com.apple.developer.nfc.readersession.formats": [
"TAG"
]
},
"config": {
"usesNonExemptEncryption": false
+2 -2
View File
@@ -80,7 +80,7 @@ export default function ServerAddModal({route, navigation}) {
}
navigation.goBack();
setTimeout(() => navigation.navigate('server', {
setTimeout(() => navigation.popTo('server', {
serverId: serverObject._id.toHexString()
}), 500);
}, [realm]);
@@ -127,7 +127,7 @@ function handleDeepLink(realm, navigation, route, setAddress: (address: string)
navigation.goBack();
// allow the homepage to render before moving on
setTimeout(() => navigation.navigate('server', {
setTimeout(() => navigation.popTo('server', {
serverId: item[0]._id.toHexString()
}), 1000);
} else {
+11 -10
View File
@@ -1,11 +1,11 @@
import {Text} from "react-native";
import {ReactNode, useMemo} from "react";
import {CreditCard, History, Joystick, RailSymbol} from "lucide-react-native";
import React, {ReactNode, useMemo} from "react";
import {CreditCard, Gem, History, Joystick, LucideIcon, RailSymbol} from "lucide-react-native";
import TimeAgo from "./TimeAgo";
import {AMUICard, AMUICardActionProps, AMUICardDetail} from "./AMUICard";
import {AMCardData, AMPhysicalCardData} from "../models/AMCard";
import {AMCardData} from "../models/AMCard";
import {AmusementICVendor, ICType} from "../lib/iccard";
export interface ICCardProps extends AMUICardActionProps {
@@ -22,7 +22,7 @@ export function ICCard(props: ICCardProps) {
return (
<AMUICard title={props.card.name} {...props}>
<PhysicalICInfo physicalCard={props.card.physicalCardData}/>
<PhysicalICInfo card={props.card}/>
<AMUICardDetail>
<CreditCard size={18} color="gray"/>
@@ -40,8 +40,8 @@ export function ICCard(props: ICCardProps) {
);
}
function PhysicalICInfo(props: { physicalCard: AMPhysicalCardData | null }) {
if (props.physicalCard?.cardType === ICType.Transport) {
function PhysicalICInfo(props: { card: AMCardData | null }) {
if (props.card.physicalCardData?.cardType === ICType.Transport) {
return (
<AMUICardDetail>
<RailSymbol size={18} color="gray"/>
@@ -50,12 +50,13 @@ function PhysicalICInfo(props: { physicalCard: AMPhysicalCardData | null }) {
)
}
if (props.physicalCard?.cardVendor) {
if (props.card.physicalCardData?.cardVendor) {
const [icon, color]: [LucideIcon, string] = props.card.isLimitedAimeCard ? [Gem, "crimson"] : [Joystick, "gray"];
return (
<AMUICardDetail>
<Joystick size={18} color="gray"/>
<Text style={{color: "gray"}}>
{props.physicalCard.isBootlegAmusementCard ? "Bootleg " : null}{ICVendorName(props.physicalCard.cardVendor)}
{React.createElement(icon, {size: 18, color})}
<Text style={{color}}>
{props.card.physicalCardData.isBootlegAmusementCard ? "Bootleg " : null}{ICVendorName(props.card.physicalCardData.cardVendor)}
</Text>
</AMUICardDetail>
);
-1
View File
@@ -70,7 +70,6 @@ export async function felicaCardReadAsync(): Promise<ICCard | null> {
return null;
}
} catch (ex) {
console.warn(ex);
return null;
} finally {
await NfcManager.cancelTechnologyRequest();
+6
View File
@@ -7,6 +7,7 @@ export interface AMCardData {
added: Date;
lastUsed?: Date | null;
isLimitedAimeCard: boolean;
physicalCardData?: AMPhysicalCardData | null;
}
@@ -22,6 +23,11 @@ export class AMCard extends Realm.Object<AMCard> implements AMCardData {
physicalCardData?: AMPhysicalCardData | null = null;
get isLimitedAimeCard() {
// limited cards use the company code 500
return this.physicalCardData?.cardType === ICType.Amusement && this.code.startsWith('500');
}
static generate(code: string, name: string) {
return {
_id: new Realm.BSON.ObjectId(),
+633 -123
View File
File diff suppressed because it is too large Load Diff
+16 -13
View File
@@ -9,40 +9,43 @@
"android-prebuild": "expo prebuild --platform android"
},
"dependencies": {
"@babel/runtime": "^7.26.0",
"@babel/runtime": "^7.26.7",
"@expo-google-fonts/jetbrains-mono": "^0.2.3",
"@react-navigation/bottom-tabs": "^6.6.1",
"@react-navigation/native": "^6.1.18",
"@react-navigation/native-stack": "^6.11.0",
"@react-navigation/bottom-tabs": "^7.2.0",
"@react-navigation/native": "^7.0.14",
"@react-navigation/native-stack": "^7.2.0",
"@realm/react": "^0.11.0",
"@types/react": "~18.3.12",
"amnet-shared": "file:../amnet-shared",
"date-fns": "^3.6.0",
"expo": "^52.0.27",
"date-fns": "^4.1.0",
"expo": "^52.0.30",
"expo-blur": "~14.0.3",
"expo-build-properties": "~0.13.2",
"expo-clipboard": "~7.0.1",
"expo-constants": "~17.0.3",
"expo-dev-client": "~5.0.10",
"expo-linking": "~7.0.4",
"expo-dev-client": "~5.0.11",
"expo-linking": "~7.0.5",
"expo-splash-screen": "~0.29.21",
"expo-status-bar": "~2.0.1",
"expo-system-ui": "~4.0.7",
"lucide-react-native": "^0.427.0",
"pusher-js": "^8.2.0",
"lucide-react-native": "^0.474.0",
"pusher-js": "^8.4.0",
"react": "18.3.1",
"react-native": "0.76.6",
"react-native-context-menu-view": "^1.16.0",
"react-native-gesture-handler": "~2.20.2",
"react-native-get-random-values": "^1.11.0",
"react-native-nfc-manager": "^3.16.1",
"react-native-paper": "^5.12.5",
"react-native-paper": "^5.13.1",
"react-native-reanimated": "~3.16.1",
"react-native-safe-area-context": "4.12.0",
"react-native-screens": "~4.4.0",
"react-native-svg": "15.8.0",
"react-native-url-polyfill": "^2.0.0",
"realm": "^12.14.0",
"typescript": "~5.3.3",
"expo-splash-screen": "~0.29.21"
"typescript": "~5.3.3"
},
"devDependencies": {
"@expo/ngrok": "^4.1.3"
}
}