From e381a24bb32555e78963792d11a3d0b7c341b3b5 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Tue, 17 Mar 2020 18:39:48 -0400 Subject: [PATCH] Include the Form.person in the form selector. --- src/TaxReturnView.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/TaxReturnView.tsx b/src/TaxReturnView.tsx index 98a27ef..c8e3291 100644 --- a/src/TaxReturnView.tsx +++ b/src/TaxReturnView.tsx @@ -5,7 +5,7 @@ import { createMemo, createState } from 'solid-js'; import { For } from 'solid-js/dom'; -import { Form, TaxReturn } from 'ustaxlib/core'; +import { Form, Person, TaxReturn } from 'ustaxlib/core'; import FormView from './FormView'; @@ -22,7 +22,15 @@ export default function TaxReturnView(props: Props) { setState({ form: props.tr.forms[e.target.value] }); }; - const formIndexToName = createMemo(() => props.tr.forms.map((form, i) => [i, form.name])); + const formIndexToName = createMemo(() => props.tr.forms.map((form, i) => { + let name = form.name; + const person = form.person(); + if (person !== undefined) { + const personName = person === Person.joint ? 'Joint' : person.name; + name += ` (${personName})`; + } + return [i, name]; + })); const formSelector = (