diff --git a/frontend/src/components/Transaction.jsx b/frontend/src/components/Transaction.jsx index 7ca7f85..12cdc24 100644 --- a/frontend/src/components/Transaction.jsx +++ b/frontend/src/components/Transaction.jsx @@ -1,11 +1,13 @@ 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(() => { @@ -25,22 +27,40 @@ const Transaction = ({ transaction }) => { handleSelect(transaction.id, e.target.checked); console.log("clicked: ", transaction.id); }; + return ( -
- {isAmountNegative ? convertedAmount : `+${convertedAmount}`}:{" "} - {transaction.description} -
-{transaction.created_at.substring(0, 10)}
+ <> ++ {isAmountNegative ? convertedAmount : `+${convertedAmount}`}:{" "} + {transaction.title} +
+ +{transaction.created_at.substring(0, 10)}
+ +