From 2b939612b6e54a83ec9e627f1303df822dddcfd7 Mon Sep 17 00:00:00 2001 From: Robert Lucas <100799838+Robert-M-Lucas@users.noreply.github.com> Date: Sat, 27 Apr 2024 21:25:05 +0100 Subject: [PATCH] Merge --- src/pages/dashboard/DashboardPage.tsx | 4 ++-- src/pages/dashboard/GraphUtils.ts | 4 ++-- src/pages/dashboard/Graphs.tsx | 3 --- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/pages/dashboard/DashboardPage.tsx b/src/pages/dashboard/DashboardPage.tsx index 7004cbf..103dad5 100644 --- a/src/pages/dashboard/DashboardPage.tsx +++ b/src/pages/dashboard/DashboardPage.tsx @@ -50,7 +50,7 @@ export default function Dashboard() {
-

Waiting for Auth

+

Waiting for Authentication

; @@ -78,7 +78,7 @@ export default function Dashboard() {
-

Fetching

+

Fetching {transactionPoints ? "" : "transactions"}{!transactionPoints && !userPrefs ? "," : ""} {userPrefs ? "" : "goals"}

; diff --git a/src/pages/dashboard/GraphUtils.ts b/src/pages/dashboard/GraphUtils.ts index cad8f00..09edd4b 100644 --- a/src/pages/dashboard/GraphUtils.ts +++ b/src/pages/dashboard/GraphUtils.ts @@ -1,7 +1,7 @@ import {Transaction} from "../../utils/transaction.ts"; import strftime from "strftime"; -export type transactionPoint = { date: string; amount: number } +type transactionPoint = { date: string; amount: number; goal: number } export type finalGraphData = {raw: transactionPoint[], in: transactionPoint[], out: transactionPoint[]}; function cumulateTransactions(points: transactionPoint[]): transactionPoint[] { @@ -33,7 +33,7 @@ function splitTransactions (data: transactionPoint[]): finalGraphData { export function readTransactions(data: Transaction[]): finalGraphData { return splitTransactions( data.map((t) => { - return {date: getDateString(t.dateTime), amount: t.amount} + return {date: getDateString(t.dateTime), amount: t.amount, goal: 800}; }) ); } \ No newline at end of file diff --git a/src/pages/dashboard/Graphs.tsx b/src/pages/dashboard/Graphs.tsx index ebd2a4f..098d6c8 100644 --- a/src/pages/dashboard/Graphs.tsx +++ b/src/pages/dashboard/Graphs.tsx @@ -1,6 +1,3 @@ -import {Line, LineChart, ResponsiveContainer, XAxis, YAxis} from "recharts"; - -type transactionPoint = { date: string; amount: number; goal: number } import {Line, LineChart, ResponsiveContainer, Tooltip, XAxis, YAxis} from "recharts"; import {transactionPoint} from "./GraphUtils.ts";