Skip to content

Commit

Permalink
Fixed TS warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-M-Lucas committed Apr 27, 2024
1 parent 1d055a3 commit 64750a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/pages/dashboard/DashboardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "react-tiles-dnd/esm/index.css";
import { TilesContainer, RenderTileFunction } from "react-tiles-dnd";
import useWindowDimensions from "../../hooks/WindowDimensionsHook.tsx";
import {Header} from "../../components/Header.tsx";
import React, {ReactNode, useEffect, useState} from "react";
import {ReactNode, useEffect, useState} from "react";
import { getTransactionsFilterOrderBy, Transaction } from "../../utils/transaction.ts"
import {auth} from "../../utils/firebase.ts";
import {orderBy} from "firebase/firestore";
Expand Down
15 changes: 8 additions & 7 deletions src/pages/dashboard/GraphUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ import {Transaction} from "../../utils/transaction.ts";

type transactionPoint = { date: string; amount: number }

const cumulateTransactions = (points: transactionPoint[]): transactionPoint[] => {
let total = 0;
return points.map(value => {
total += value.amount;
return {date: value.date, amount: total};
})
}
// const cumulateTransactions = (points: transactionPoint[]): transactionPoint[] => {
// let total = 0;
// return points.map(value => {
// total += value.amount;
// return {date: value.date, amount: total};
// })
// }

const getDateString = (timestamp: number): string => {
const date = new Date(timestamp)
const day = date.getDate().toString().padStart(2, '0'); // Ensures two digits
Expand Down

0 comments on commit 64750a4

Please sign in to comment.