From 4b8d9e93d8aa45123ee71342c921d1997d155736 Mon Sep 17 00:00:00 2001 From: cooper-roper Date: Tue, 9 Apr 2024 11:03:15 -0700 Subject: [PATCH] Made Dialog component for 'How we calc...' button --- .../Results/EnergyScore/calcbutton.jsx | 95 ++++++++++++++++++- .../Results/EnergyScore/energyscore.jsx | 7 +- .../IndividualScore/individualscore.jsx | 8 +- src/pages/Results.jsx | 20 +++- src/styles/page.css | 2 +- 5 files changed, 121 insertions(+), 11 deletions(-) diff --git a/src/components/Results/EnergyScore/calcbutton.jsx b/src/components/Results/EnergyScore/calcbutton.jsx index db7fc98..5450a23 100644 --- a/src/components/Results/EnergyScore/calcbutton.jsx +++ b/src/components/Results/EnergyScore/calcbutton.jsx @@ -1,9 +1,87 @@ import React, { useState } from 'react'; -import { Button } from '@mui/material'; -import { sparkles } from 'ionicons/icons'; +import { Button, Dialog, DialogTitle, DialogContent, Card, CardContent, Typography, Box, Grid } from '@mui/material'; import { IonIcon } from '@ionic/react'; +import { star } from 'ionicons/icons'; -const CalcButton = () => { +const ScoreBlock = ({ score }) => ( + + Your Home's Clean Energy Score: + {score} out of 100 + Your score is based on the estimated CO2 emissions of your home. + + + 0 = the highest possible emissions + + + 50 = an average home + + + 100 = a zero-emissions home + + + +); + +const ScoreDetailsCard = (props) => { + const { + zipCode, + state, + solarIndex, + heatingDegreeDays, + coolingDegreeDays, + groundWaterTemp, + homeVolume, + airChangesPerHour, + wallRValue, + atticRValue, + glazingPercentage, + heatLossBTUs, + solarHeatGainBTUs + } = props.props; + return ( + + + + The Science Behind Your Score + + + Many things go into estimating the CO₂ emissions of a home - the size of your home, the outside temperature through the year, the materials and insulation in your home, and much more! + + + Here's a look at what we estimated some of those factors to be based on your answers. + + + + What we estimate: + + + + Your Location + - Zip Code: {zipCode} + - State: {state} + - Average Solar Index: {solarIndex} + - Annual Heating Degree Days: {heatingDegreeDays} + - Annual Cooling Degree Days: {coolingDegreeDays} + - Average Ground Water Temp: {groundWaterTemp}° F + + + Your Home + - Home Volume: {homeVolume} ft³ + - Air Changes per Hour (ACH): {airChangesPerHour} + - Insulated Wall R Value: {wallRValue} + - Insulated Attic/Roof R Value: {atticRValue} + - Glazing Percentage: {glazingPercentage}% + - Annual BTUs of Heat Loss: {heatLossBTUs} million + - Annual BTUs of Solar Heat Gain: {solarHeatGainBTUs} million + + + + + + ); +}; + +const CalcButton = (props) => { const [open, setOpen] = useState(false); const handleClickOpen = () => { @@ -17,9 +95,18 @@ const CalcButton = () => { return (
+ + Calculation Guide: + + + + +
); }; diff --git a/src/components/Results/EnergyScore/energyscore.jsx b/src/components/Results/EnergyScore/energyscore.jsx index db93b70..b2639f7 100644 --- a/src/components/Results/EnergyScore/energyscore.jsx +++ b/src/components/Results/EnergyScore/energyscore.jsx @@ -29,7 +29,7 @@ const EnergyScore = (props) => { }} >
- +

Score is based on the estimated CO2 emissions of your home

@@ -37,7 +37,10 @@ const EnergyScore = (props) => {
- + {
- System Report Card + + System Report Card +
{props.content.map((item, index) => ( @@ -114,8 +116,8 @@ const IndividualScore = (props) => { ))}
- - Recommendations + + Recommendations diff --git a/src/pages/Results.jsx b/src/pages/Results.jsx index 82f244e..ec36e48 100644 --- a/src/pages/Results.jsx +++ b/src/pages/Results.jsx @@ -103,21 +103,39 @@ const Results = (props) => { ]; // TEMPS + const score = 75; const co2Emission = '3,581 lbs'; const yourHomeValue = 12010; const avgHomeState = 12503; const avgHomeUS = 16000; + const details = { + zipCode: 94110, + state: 'California', + solarIndex: 4.5, + heatingDegreeDays: 2000, + coolingDegreeDays: 300, + groundWaterTemp: 50, + homeVolume: 2000, + airChangesPerHour: 0.5, + wallRValue: 20, + atticRValue: 30, + glazingPercentage: 10, + heatLossBTUs: 1000, + solarHeatGainBTUs: 500 + }; return (
- + diff --git a/src/styles/page.css b/src/styles/page.css index a2c92a4..4f7140b 100644 --- a/src/styles/page.css +++ b/src/styles/page.css @@ -18,4 +18,4 @@ color: red; font-size: 1.5rem; margin-top: 1rem; -} +} \ No newline at end of file