From acb89fb3314f0cc0803ec8304403a1ee50bb7ec4 Mon Sep 17 00:00:00 2001 From: tom1dev Date: Thu, 19 Sep 2024 19:50:25 +1200 Subject: [PATCH 1/9] added cert --- .gitignore | 3 ++- backend/src/certs/ca.crt | 46 ++++++++++++++++++++-------------------- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index acb3162..9a77db4 100644 --- a/.gitignore +++ b/.gitignore @@ -26,4 +26,5 @@ yarn-error.log* .env #misc folders -.idea/ \ No newline at end of file +.idea/ +.vscode/ \ No newline at end of file diff --git a/backend/src/certs/ca.crt b/backend/src/certs/ca.crt index 823a492..cabd32d 100644 --- a/backend/src/certs/ca.crt +++ b/backend/src/certs/ca.crt @@ -1,25 +1,25 @@ -----BEGIN CERTIFICATE----- -MIIEQTCCAqmgAwIBAgIUKo2BX+ykzxZslXAlxKniKTUO1Z0wDQYJKoZIhvcNAQEM -BQAwOjE4MDYGA1UEAwwvZjdlNjkyMmYtYjc1Mi00ZWQzLWJhMjUtZTI1YjAwNjU0 -YTE3IFByb2plY3QgQ0EwHhcNMjQwODA0MjMzMjU0WhcNMzQwODAyMjMzMjU0WjA6 -MTgwNgYDVQQDDC9mN2U2OTIyZi1iNzUyLTRlZDMtYmEyNS1lMjViMDA2NTRhMTcg -UHJvamVjdCBDQTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBAKSXRMAi -unkpsnRzCFavjmxpRNj+amFYjvem6rQIWe+YLtqw24Mk326iWv6fVCgESV0APWnM -vHp4HawWCqnpt3KVf6xTmAfNAbazODJZZTg3HHKidQSU4z/7cUUJdrneskjthYAD -4IxqE555PIWDMoFwq1/W14DihLRmuzdDOCaxH4EKfhSOjzxwyM/tQjVvauhpuAFy -TgnmBp8scue96F6hKTBccgBzA4xBT8lcj5KvCjLY6Fn2lQCU+Z0KPtqC97OWnu0l -/uiAzK6Ciu0hHRNQ+vo+Epj+Xeg+mcerg4TuZlJWCFatEfPmwBcpzXkkmk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PN93d2g6Q5v/n4u0UygXCShhAW3+64kE32wzAKocGdd8lsm2RlI/ZEGT +FJy5G6KiNs0ORIJGmNq2AE9c3l50mTN/pc/1nfslJQ1EklO2mBL/dC/IUI0/wgZh +qYXPQXCnOv+WWDH9aWyZ/o1HZo+BmZ1XNyOX5DTwWbz6Cm/irg== -----END CERTIFICATE----- \ No newline at end of file From 61cdcefb755e6d430dbbc15a95346ac3faf58d39 Mon Sep 17 00:00:00 2001 From: tom1dev Date: Tue, 24 Sep 2024 11:50:22 +1200 Subject: [PATCH 2/9] added transaction details popup --- frontend/src/components/Transaction.jsx | 45 +++++++++++++------ .../src/components/TransactionDetailPopup.jsx | 28 ++++++++++++ 2 files changed, 59 insertions(+), 14 deletions(-) create mode 100644 frontend/src/components/TransactionDetailPopup.jsx diff --git a/frontend/src/components/Transaction.jsx b/frontend/src/components/Transaction.jsx index 7ca7f85..75354ae 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(() => { @@ -26,21 +28,36 @@ const Transaction = ({ transaction }) => { console.log("clicked: ", transaction.id); }; return ( -
- -
-

- {isAmountNegative ? convertedAmount : `+${convertedAmount}`}:{" "} - {transaction.description} -

-

{transaction.created_at.substring(0, 10)}

+ <> +
+ + +
setShowDetails(true)} + > +

+ {isAmountNegative ? convertedAmount : `+${convertedAmount}`}:{" "} + {transaction.title} +

+

{transaction.created_at.substring(0, 10)}

+
+
+ + {showDetails && ( +
+
- ); + ) + } + + ) }; export default Transaction; diff --git a/frontend/src/components/TransactionDetailPopup.jsx b/frontend/src/components/TransactionDetailPopup.jsx new file mode 100644 index 0000000..a6ce940 --- /dev/null +++ b/frontend/src/components/TransactionDetailPopup.jsx @@ -0,0 +1,28 @@ +import { useState, useEffect } from "react"; + +export default function TransactionDetailPopup({transaction, setShowDetails}){ + const handleExit =() => { + setShowDetails(false); + } + + + return( + <> +
+
+

Transaction Details

+ +

Title: {transaction.title}

+ +

Amount: ${transaction.amount}

+ +

Description: {transaction.description}

+ + +
+
+ + ) +} \ No newline at end of file From e0fe663dcd42788e649d3aaf4d843695cec18216 Mon Sep 17 00:00:00 2001 From: tom1dev Date: Tue, 24 Sep 2024 12:26:29 +1200 Subject: [PATCH 3/9] improved the formatting of the details popup --- .../src/components/TransactionDetailPopup.jsx | 33 ++++++++++++++----- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/TransactionDetailPopup.jsx b/frontend/src/components/TransactionDetailPopup.jsx index a6ce940..cfe54f8 100644 --- a/frontend/src/components/TransactionDetailPopup.jsx +++ b/frontend/src/components/TransactionDetailPopup.jsx @@ -5,21 +5,38 @@ export default function TransactionDetailPopup({transaction, setShowDetails}){ setShowDetails(false); } - return( <>
-

Transaction Details

+ +

Transaction Details

-

Title: {transaction.title}

- -

Amount: ${transaction.amount}

+
+

Title:

+

{transaction.title}

+
+
+

Amount:

+

${transaction.amount}

+
+ +

Description

+ -

Description: {transaction.description}

+