From 38500b3c9425f01669bbb2f62d97e0bb64172b94 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Fri, 28 Feb 2020 01:24:16 +0000 Subject: [PATCH] Add checkbox to exclude PayPal transactions from list --- webclient/src/AdminTransactions.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/webclient/src/AdminTransactions.js b/webclient/src/AdminTransactions.js index 7001a98..df8f528 100644 --- a/webclient/src/AdminTransactions.js +++ b/webclient/src/AdminTransactions.js @@ -43,16 +43,23 @@ export function AdminReportedTransactions(props) { }; let transactionsCache = false; +let excludePayPalCache = false; export function AdminHistoricalTransactions(props) { const { token, user } = props; const [input, setInput] = useState({ month: moment() }); const [transactions, setTransactions] = useState(transactionsCache); + const [excludePayPal, setExcludePayPal] = useState(excludePayPalCache); const [loading, setLoading] = useState(false); const [error, setError] = useState(false); const handleDatetime = (v) => setInput({ ...input, month: v }); + const handleExcludePayPal = (e, v) => { + setExcludePayPal(v.checked); + excludePayPalCache = v.checked; + }; + const handleSubmit = (e) => { if (loading) return; setLoading(true); @@ -97,7 +104,14 @@ export function AdminHistoricalTransactions(props) { {!!transactions.length &&
{moment(transactions[0].date, 'YYYY-MM-DD').format('MMMM YYYY')} Transactions
} - + + + + !excludePayPal || x.account_type !== 'PayPal')} /> :

Error loading transactions.