From a23487e8e818675744528e55e3b971836d24f79f Mon Sep 17 00:00:00 2001 From: Tom Carden Date: Sat, 30 Sep 2023 13:07:53 -0600 Subject: [PATCH] state calc button is purple, no icon --- src/calculator-form.ts | 7 ++++--- src/calculator.ts | 5 ++++- src/state-calculator.ts | 4 +++- src/state-incentive-details.ts | 3 +++ 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/calculator-form.ts b/src/calculator-form.ts index 5c1f09b..7e6a9d6 100644 --- a/src/calculator-form.ts +++ b/src/calculator-form.ts @@ -1,4 +1,4 @@ -import { html, css, nothing } from 'lit'; +import { html, css, nothing, TemplateResult } from 'lit'; import { downIcon, questionIcon } from './icons'; import { select, selectStyles, OptionParam } from './select'; import { inputStyles } from './styles/input'; @@ -79,6 +79,7 @@ const HOUSEHOLD_SIZE_OPTIONS: OptionParam[] = [1, 2, 3, 4, 5, 6, 7, 8].map( type FormOptions = { showProjectField: boolean; tooltipSize: number; + calculateButtonContent: TemplateResult; } export const formTemplate = ( @@ -90,7 +91,7 @@ export const formTemplate = ( taxFiling, householdSize, ]: Array, - { showProjectField, tooltipSize }: FormOptions, + { showProjectField, tooltipSize, calculateButtonContent }: FormOptions, onSubmit: (e: SubmitEvent) => void, gridClass: string = 'grid-3-2', ) => { @@ -225,7 +226,7 @@ export const formTemplate = (
diff --git a/src/calculator.ts b/src/calculator.ts index 49f7b3e..13ddc56 100644 --- a/src/calculator.ts +++ b/src/calculator.ts @@ -13,6 +13,7 @@ import { import { CALCULATOR_FOOTER } from './calculator-footer'; import { fetchApi } from './api/fetch'; import { NO_PROJECT } from './projects'; +import { downIcon } from './icons'; const loadedTemplate = ( results: ICalculatedIncentiveResults, @@ -143,6 +144,8 @@ export class RewiringAmericaCalculator extends LitElement { }); override render() { + const calculateButtonContent = html`Calculate! ${downIcon(18, 18)}`; + return html`
@@ -158,7 +161,7 @@ export class RewiringAmericaCalculator extends LitElement { this.taxFiling, this.householdSize, ], - { tooltipSize: 18, showProjectField: false }, + { tooltipSize: 18, showProjectField: false, calculateButtonContent }, (event: SubmitEvent) => this.submit(event), )}
diff --git a/src/state-calculator.ts b/src/state-calculator.ts index f2d54ce..eb72cb2 100644 --- a/src/state-calculator.ts +++ b/src/state-calculator.ts @@ -245,6 +245,8 @@ export class RewiringAmericaStateCalculator extends LitElement { this._utilitiesTask.status === TaskStatus.PENDING || this._task.status === TaskStatus.PENDING; + const calculateButtonContent = html`Calculate`; + return html`
@@ -260,7 +262,7 @@ export class RewiringAmericaStateCalculator extends LitElement { this.taxFiling, this.householdSize, ], - { showProjectField: true, tooltipSize: 13 }, + { showProjectField: true, tooltipSize: 13, calculateButtonContent }, (event: SubmitEvent) => this.submit(event), 'grid-3-2-1', )} diff --git a/src/state-incentive-details.ts b/src/state-incentive-details.ts index 64cbd26..6e92281 100644 --- a/src/state-incentive-details.ts +++ b/src/state-incentive-details.ts @@ -20,6 +20,9 @@ export const stateIncentivesStyles = css` --ra-form-label-margin: 0; --ra-form-label-text-transform: uppercase; --ra-form-label-letter-spacing: 0.55px; + /* button */ + --ra-embed-primary-button-background-color: var(--rewiring-purple); + --ra-embed-primary-button-text-color: white; }