From e3502f7614a15f8e7bbe7f3aef18c8fbb9d759bb Mon Sep 17 00:00:00 2001 From: Owen Yamauchi Date: Tue, 15 Aug 2023 16:58:52 -0400 Subject: [PATCH] Hoist the form header out of the form component (#14) The header text isn't part of the calculator form, semantically. It will also need to be customizable for state-specific calcs. ## Test Plan Looks exactly the same as before in a browser. Cypress tests pass. --- src/calculator-form.ts | 208 ++++++++++++++++++++--------------------- src/calculator.ts | 27 +++--- 2 files changed, 117 insertions(+), 118 deletions(-) diff --git a/src/calculator-form.ts b/src/calculator-form.ts index 21f6704..4c1cbb6 100644 --- a/src/calculator-form.ts +++ b/src/calculator-form.ts @@ -76,111 +76,107 @@ export const formTemplate = ( [zip, ownerStatus, householdIncome, taxFiling, householdSize]: Array, onSubmit: (e: SubmitEvent) => void, ) => html` -
-

How much money will you get with the Inflation Reduction Act?

-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
+ +
+
+
- -
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ `; diff --git a/src/calculator.ts b/src/calculator.ts index b8c80da..edaf7e5 100644 --- a/src/calculator.ts +++ b/src/calculator.ts @@ -144,18 +144,21 @@ export class RewiringAmericaCalculator extends LitElement { override render() { return html`
- ${this.hideForm - ? nothing - : formTemplate( - [ - this.zip, - this.ownerStatus, - this.householdIncome, - this.taxFiling, - this.householdSize, - ], - (event: SubmitEvent) => this.submit(event), - )} +
+

How much money will you get with the Inflation Reduction Act?

+ ${this.hideForm + ? nothing + : formTemplate( + [ + this.zip, + this.ownerStatus, + this.householdIncome, + this.taxFiling, + this.householdSize, + ], + (event: SubmitEvent) => this.submit(event), + )} +
${this.hideResult ? nothing : html`