diff --git a/src/ui/components/BulkLines.tsx b/src/ui/components/BulkLines.tsx index 66098a8..8a18b02 100644 --- a/src/ui/components/BulkLines.tsx +++ b/src/ui/components/BulkLines.tsx @@ -1,6 +1,8 @@ import { useRef } from "react"; +import { XIcon } from "lucide-react"; import { useDataset } from "../hooks/useDataset.ts"; import { digitsFor } from "../../domain/currencies.ts"; +import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { formatMoney } from "../format.ts"; @@ -113,15 +115,20 @@ export function BulkLines({ draft, onChange }: Props) { }} /> - + + ))} diff --git a/src/ui/components/PlanEditor.tsx b/src/ui/components/PlanEditor.tsx index 107f09b..2753c3e 100644 --- a/src/ui/components/PlanEditor.tsx +++ b/src/ui/components/PlanEditor.tsx @@ -61,7 +61,7 @@ export function PlanEditor({ draft, onChange }: Props) { } return ( -
+
@@ -79,7 +79,7 @@ export function PlanEditor({ draft, onChange }: Props) { } }} /> -
diff --git a/src/ui/components/PurchaseDialog.tsx b/src/ui/components/PurchaseDialog.tsx index dd47c43..d924217 100644 --- a/src/ui/components/PurchaseDialog.tsx +++ b/src/ui/components/PurchaseDialog.tsx @@ -9,7 +9,9 @@ import { } from "@/components/ui/dialog"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; +import { NativeSelect } from "@/components/ui/native-select"; import { Label } from "@/components/ui/label"; +import { Segmented } from "./Segmented.tsx"; import { SplitEditor } from "./SplitEditor.tsx"; import { PlanEditor } from "./PlanEditor.tsx"; import { BulkLines } from "./BulkLines.tsx"; @@ -108,19 +110,15 @@ export function PurchaseDialog({ monthId, purchase, trigger }: Props) { {!purchase && ( -
- {(["one", "many"] as const).map((option) => ( - - ))} -
+ )}
@@ -142,9 +140,7 @@ export function PurchaseDialog({ monthId, purchase, trigger }: Props) { setBulk((b) => ({ ...b, date })); }} /> - +
- +
- +
@@ -220,24 +214,20 @@ export function PurchaseDialog({ monthId, purchase, trigger }: Props) { setDraft((d) => ({ ...d, date })); }} /> - + ) : ( <> - + )} @@ -275,9 +265,8 @@ export function PurchaseDialog({ monthId, purchase, trigger }: Props) {
- +
@@ -346,3 +335,32 @@ export function PurchaseDialog({ monthId, purchase, trigger }: Props) { ); } + +/** + * "set exact date" / "use the month only", under the date field. + * + * Was a bare ` + ); +} diff --git a/src/ui/components/SplitEditor.tsx b/src/ui/components/SplitEditor.tsx index 8ee36c3..b99dbec 100644 --- a/src/ui/components/SplitEditor.tsx +++ b/src/ui/components/SplitEditor.tsx @@ -2,7 +2,9 @@ import { Button } from "@/components/ui/button"; import { useDataset } from "../hooks/useDataset.ts"; import { digitsFor } from "../../domain/currencies.ts"; import { Input } from "@/components/ui/input"; +import { NativeSelect } from "@/components/ui/native-select"; import { Label } from "@/components/ui/label"; +import { Segmented } from "./Segmented.tsx"; import { formatAmount } from "../format.ts"; import type { PurchaseDraft, SplitDraft } from "../purchaseForm.ts"; import { splitBalance } from "../purchaseForm.ts"; @@ -39,25 +41,24 @@ export function SplitEditor({ draft, posts, onChange }: Props) {
-
- {(["percent", "fixed"] as const).map((mode) => ( - - ))} -
+ onChange({ ...draft, splitMode })} + options={[ + { value: "percent", label: "Percentages" }, + { value: "fixed", label: "Amounts" }, + ]} + />
{draft.splits.map((split, index) => (
- + {unit} -