feat: add auth to context
This commit is contained in:
23
packages/ui/src/settings/accounts.tsx
Normal file
23
packages/ui/src/settings/accounts.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
6
packages/ui/src/settings/family.tsx
Normal file
6
packages/ui/src/settings/family.tsx
Normal file
@@ -0,0 +1,6 @@
|
||||
import { Text } from "react-native";
|
||||
|
||||
export function Family() {
|
||||
return <Text style={{ fontFamily: 'mono' }}>Welcome to family</Text>
|
||||
}
|
||||
|
||||
7
packages/ui/src/settings/general.tsx
Normal file
7
packages/ui/src/settings/general.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import { Text } from "react-native";
|
||||
|
||||
export function General() {
|
||||
return <Text style={{ fontFamily: 'mono' }}>Welcome to settings</Text>
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user