feat: add auth to context

This commit is contained in:
Max Koon
2025-11-15 22:08:58 -05:00
parent 641dc25bee
commit 114eaf88eb
11 changed files with 250 additions and 37 deletions

View File

@@ -0,0 +1,23 @@
import { useQuery } from "@rocicorp/zero/react";
import { queries } from '@money/shared';
import * as Table from "../table";
import { use } from "react";
import { RouterContext } from "..";
const COLUMNS: Table.Column[] = [
{ name: 'name', label: 'Name' },
{ name: 'createdAt', label: 'Added At', render: (n) => new Date(n).toLocaleString() },
];
export function Accounts() {
const { auth } = use(RouterContext);
const [items] = useQuery(queries.getItems(auth));
return (
<Table.Provider columns={COLUMNS} data={items}>
<Table.Body />
</Table.Provider>
);
}

View File

@@ -0,0 +1,6 @@
import { Text } from "react-native";
export function Family() {
return <Text style={{ fontFamily: 'mono' }}>Welcome to family</Text>
}

View File

@@ -0,0 +1,7 @@
import { Text } from "react-native";
export function General() {
return <Text style={{ fontFamily: 'mono' }}>Welcome to settings</Text>
}