Skip to content

Commit

Permalink
state calc button is purple, no icon
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomEtc committed Sep 30, 2023
1 parent afc070d commit a23487e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/calculator-form.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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 = (
Expand All @@ -90,7 +91,7 @@ export const formTemplate = (
taxFiling,
householdSize,
]: Array<string>,
{ showProjectField, tooltipSize }: FormOptions,
{ showProjectField, tooltipSize, calculateButtonContent }: FormOptions,
onSubmit: (e: SubmitEvent) => void,
gridClass: string = 'grid-3-2',
) => {
Expand Down Expand Up @@ -225,7 +226,7 @@ export const formTemplate = (
</div>
<div>
<button class="primary" type="submit">
Calculate! ${downIcon(tooltipSize, tooltipSize)}
${calculateButtonContent}
</button>
</div>
</div>
Expand Down
5 changes: 4 additions & 1 deletion src/calculator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -143,6 +144,8 @@ export class RewiringAmericaCalculator extends LitElement {
});

override render() {
const calculateButtonContent = html`Calculate! ${downIcon(18, 18)}`;

return html`
<div class="calculator">
<div class="card card-content">
Expand All @@ -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),
)}
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/state-calculator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
<div class="calculator">
<div class="card card-content">
Expand All @@ -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',
)}
Expand Down
3 changes: 3 additions & 0 deletions src/state-incentive-details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit a23487e

Please sign in to comment.