diff --git a/frontend/src/components/Transaction.jsx b/frontend/src/components/Transaction.jsx index 12cdc24..7ca7f85 100644 --- a/frontend/src/components/Transaction.jsx +++ b/frontend/src/components/Transaction.jsx @@ -1,13 +1,11 @@ import React, { useEffect, useState, useContext } from "react"; import TransactionContext from "../context/TransactionContext"; -import TransactionDetailsPopup from "../components/TransactionDetailPopup"; const Transaction = ({ transaction }) => { const [isAmountNegative, setIsAmountNegative] = useState(false); const [convertedAmount, setConvertedAmount] = useState(transaction.amount); - const [showDetails, setShowDetails] = useState(false); const { currency, convertCurrency, handleSelect } = - useContext(TransactionContext); + useContext(TransactionContext); // useEffect to check if each transaction is negative and then convert the currency useEffect(() => { @@ -27,40 +25,22 @@ const Transaction = ({ transaction }) => { handleSelect(transaction.id, e.target.checked); console.log("clicked: ", transaction.id); }; - return ( - <> -
- {isAmountNegative ? convertedAmount : `+${convertedAmount}`}:{" "} - {transaction.title} -
- -{transaction.created_at.substring(0, 10)}
- -+ {isAmountNegative ? convertedAmount : `+${convertedAmount}`}:{" "} + {transaction.description} +
+{transaction.created_at.substring(0, 10)}