feat: dialog box

This commit is contained in:
Max Koon
2025-11-20 23:39:45 -05:00
parent 882d437007
commit 0edbf53db3
15 changed files with 361 additions and 23 deletions

View File

@@ -5,20 +5,21 @@ import { General } from "./settings/general";
import { Accounts } from "./settings/accounts";
import { Family } from "./settings/family";
import { useKeyboard } from "./useKeyboard";
import { Modal } from "react-native-opentui";
type SettingsRoute = Extract<Route, `/settings${string}`>;
const TABS = {
"/settings": {
label: "General",
label: "💽 General",
screen: <General />
},
"/settings/accounts": {
label: "Bank Accounts",
label: "🏦 Bank Accounts",
screen: <Accounts />
},
"/settings/family": {
label: "Family",
label: "👑 Family",
screen: <Family />
},
} as const satisfies Record<SettingsRoute, { label: string, screen: ReactNode }>;
@@ -47,13 +48,13 @@ export function Settings() {
return (
<View style={{ flexDirection: "row" }}>
<View>
<View style={{ padding: 10 }}>
{Object.entries(TABS).map(([tabRoute, tab]) => {
const isSelected = tabRoute == route;
return (
<Pressable key={tab.label} style={{ backgroundColor: isSelected ? 'black' : undefined }} onPress={() => setRoute(tabRoute as SettingsRoute)}>
<Text style={{ fontFamily: 'mono', color: isSelected ? 'white' : 'black' }}>{tab.label}</Text>
<Text style={{ fontFamily: 'mono', color: isSelected ? 'white' : 'black' }}> {tab.label} </Text>
</Pressable>
);
})}