Files
cardclaws/cardclaws-mobile/app/(tabs)/settings.tsx
T
Omar SobhandClaude Opus 4.8 c30d3afeec
CI / policy (push) Successful in 0s
CI / mobile (push) Successful in 47s
CI / profile (push) Successful in 49s
CI / backend (push) Failing after 49s
Phase 1 foundation: backend, web profile, and mobile app
Greenfield implementation of CardClaws Phase 1 across three surfaces.

Backend (Rust/Axum workspace, 67 tests):
- cardclaws-types/config/db/auth/api/wallet crates
- Auth: register, login + lockout, magic link, refresh rotation, Apple verify
- Cards: CRUD, tier-limited publish, duplicate, public handle lookup
- Assets: R2 presigned uploads; vCard export
- Apple Wallet .pkpass pipeline (PKCS#7 signer behind apple-signing feature)
- Analytics ingest + summary with daily-salted IP hashing
- Migrations 0001 (incl. cardclaws_sessions) + 0002 analytics

Web profile (Astro SSR): cardclaws.com/[handle] hero + flip, contact actions,
client-built vCard, visit attribution. Verified end-to-end.

Mobile (Expo SDK 51): auth, card list/create, builder v1 (bg/text/logo,
palette, undo/redo), Skia/Reanimated viewer (flip + ambient). 22 logic tests.

CI: policy/backend/profile/mobile jobs; LOC + no-placeholder lint.

Review fixes baked in: `back` (not `cardclaws`) key; strip image is a bundled
manifest file (not a URL); sessions table added; NFC reframed; test doubles
allowed for external services.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-06-04 10:17:26 -05:00

56 lines
1.7 KiB
TypeScript

import { useRouter } from "expo-router";
import { Pressable, StyleSheet, Text, View } from "react-native";
import { logout } from "../../src/api/auth";
import { useAuthStore } from "../../src/stores/authStore";
export default function SettingsScreen() {
const router = useRouter();
const user = useAuthStore((s) => s.user);
const onLogout = async () => {
await logout();
router.replace("/(auth)/login");
};
return (
<View style={styles.root}>
<View style={styles.row}>
<Text style={styles.label}>Signed in as</Text>
<Text style={styles.value}>{user?.email ?? "—"}</Text>
</View>
<View style={styles.row}>
<Text style={styles.label}>Handle</Text>
<Text style={styles.value}>@{user?.handle ?? "—"}</Text>
</View>
<View style={styles.row}>
<Text style={styles.label}>Plan</Text>
<Text style={styles.value}>{user?.tier ?? "free"}</Text>
</View>
<Pressable style={styles.logout} onPress={onLogout}>
<Text style={styles.logoutText}>Sign out</Text>
</Pressable>
</View>
);
}
const styles = StyleSheet.create({
root: { flex: 1, backgroundColor: "#0a0a0c", padding: 16, gap: 4 },
row: {
flexDirection: "row",
justifyContent: "space-between",
paddingVertical: 16,
borderBottomColor: "#1a1a1f",
borderBottomWidth: 1,
},
label: { color: "#9a9aa0", fontSize: 15 },
value: { color: "#f5f5f7", fontSize: 15, fontWeight: "600" },
logout: {
marginTop: 32,
backgroundColor: "#15151a",
borderRadius: 14,
paddingVertical: 16,
alignItems: "center",
},
logoutText: { color: "#ff453a", fontWeight: "700", fontSize: 16 },
});