Skip to content

Commit

Permalink
fix props
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriele Granello committed Jan 17, 2025
1 parent 1414c7f commit 55cc99a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 25 deletions.
12 changes: 5 additions & 7 deletions app/components/Dashboard/Cards/HowMuchPerMonth.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import GraphCard from "../../ui/GraphCard";
import TenureComparisonWrapper from "../../graphs/TenureComparisonWrapper";
import { Drawer } from "../../ui/Drawer";
import { Household } from "@/app/models/Household";
import { DashboardProps } from "../../ui/Dashboard";

interface DashboardProps {
data: Household;
}

export const HowMuchPerMonth: React.FC<DashboardProps> = ({ data }) => {
export const HowMuchPerMonth: React.FC<DashboardProps> = ({
processedData,
}) => {
return (
<GraphCard
title="How much would it cost every month?"
subtitle="Monthly cost of housing, not including energy bills."
>
<div className="flex flex-col h-full w-3/4 justify-between">
<TenureComparisonWrapper household={data} />
<TenureComparisonWrapper household={processedData} />
<Drawer
buttonTitle="Find out more about how we estimated these"
title="How we estimated these figures"
Expand Down
9 changes: 0 additions & 9 deletions app/components/graphs/TenureComparisonWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ import TenureComparisonBarChart from "./TenureComparisonBarChart";

interface TenureComparisonWrapperProps {
household: Household;
mortgageLand?: number;
averageRentLand?: number;
socialRentMonthlyLand?: number;
mortgageFairholdLandPurchase?: number;
fairholdLandRent?: number;
mortgageHouse?: number;
mortgageDepreciatedHouse?: number;
averageRentHouse?: number;
socialRentMonthlyHouse?: number;
}

const TenureComparisonWrapper: React.FC<TenureComparisonWrapperProps> = ({
Expand Down
13 changes: 4 additions & 9 deletions app/components/ui/Dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import React, { useRef, useState } from "react";
import GraphCard from "./GraphCard";
import { Household } from "@/app/models/Household";
import { FormFrontend } from "@/app/schemas/formSchema";
import { WhatWouldYouChoose } from "../Dashboard/Cards/WhatWouldYouChoose";
import { WhatDifference } from "../Dashboard/Cards/WhatDifference";
import { HowMuchFHCost } from "../Dashboard/Cards/HowMuchFHCost";
import { Carousel } from "./Carousel";
import { HowMuchPerMonth } from "../Dashboard/Cards/HowMuchPerMonth";
import { ResaleValue } from "../Dashboard/Cards/ResaleValue";

interface DashboardProps {
export interface DashboardProps {
processedData: Household;
inputData: FormFrontend;
}

const Dashboard: React.FC<DashboardProps> = ({ inputData, processedData }) => {
const Dashboard: React.FC<DashboardProps> = ({ processedData }) => {
const scrollContainerRef = useRef<HTMLDivElement>(null);
const [currentPage, setCurrentPage] = useState(0);

Expand All @@ -27,9 +25,6 @@ const Dashboard: React.FC<DashboardProps> = ({ inputData, processedData }) => {
}
};

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const someUnusedVariable = inputData;

return (
<div className="snap-container">
<div
Expand All @@ -38,9 +33,9 @@ const Dashboard: React.FC<DashboardProps> = ({ inputData, processedData }) => {
onScroll={handleScroll}
>
<HowMuchFHCost data={processedData} />
<HowMuchPerMonth data={processedData} />
<HowMuchPerMonth processedData={processedData} />
<GraphCard title="How would the cost change over my life?"></GraphCard>
<ResaleValue data={processedData}/>
<ResaleValue data={processedData} />
<WhatDifference />
<WhatWouldYouChoose />
</div>
Expand Down

0 comments on commit 55cc99a

Please sign in to comment.