diff --git a/ui/js/actions/claims.js b/ui/js/actions/claims.js index 46557da57..71f94852c 100644 --- a/ui/js/actions/claims.js +++ b/ui/js/actions/claims.js @@ -47,7 +47,7 @@ export function doSendSupport(amount, claim_id) { }; lbry - .claim_send_tip({ + .wallet_send({ claim_id: claim_id, amount: amount, }) diff --git a/ui/js/component/transactionList/index.js b/ui/js/component/transactionList/index.js index 7e15a67b4..c650e9eac 100644 --- a/ui/js/component/transactionList/index.js +++ b/ui/js/component/transactionList/index.js @@ -1,5 +1,6 @@ import React from "react"; import { connect } from "react-redux"; +import { doNavigate } from "actions/app"; import { doFetchTransactions } from "actions/wallet"; import { selectBalance, @@ -15,6 +16,7 @@ const select = state => ({ }); const perform = dispatch => ({ + navigate: (path, params) => dispatch(doNavigate(path, params)), fetchTransactions: () => dispatch(doFetchTransactions()), }); diff --git a/ui/js/component/transactionList/view.jsx b/ui/js/component/transactionList/view.jsx index db913eea6..6879e3349 100644 --- a/ui/js/component/transactionList/view.jsx +++ b/ui/js/component/transactionList/view.jsx @@ -7,13 +7,38 @@ class TransactionList extends React.PureComponent { } render() { - const { fetchingTransactions, transactionItems } = this.props; + const { fetchingTransactions, transactionItems, navigate } = this.props; + + function findTypeOfTx(type, is_tip) { + if (is_tip && type === "support") return "tip"; + else return type; + } + + function getClaimLink(claim_name, claim_id) { + if (claim_id !== "----" && claim_name !== "----") { + let uri = `lbry://${claim_name}#${claim_id}`; + + return ( + + navigate("/show", { uri })} + > + {claim_name} + + + ); + } + + return {__("N/A")}; + } const rows = []; if (transactionItems.length > 0) { transactionItems.forEach(function(item) { rows.push( + {findTypeOfTx(item.type, item.is_tip)} {(item.amount > 0 ? "+" : "") + item.amount} {item.date @@ -25,6 +50,7 @@ class TransactionList extends React.PureComponent { ? item.date.toLocaleTimeString() : {__("(Transaction pending)")}} + {getClaimLink(item.claim_name, item.claim_id)} + {__("Type")} {__("Amount")} {__("Date")} {__("Time")} + {__("Claim")} {__("Transaction")} diff --git a/ui/js/selectors/wallet.js b/ui/js/selectors/wallet.js index 1027bb6e7..f5aa533d2 100644 --- a/ui/js/selectors/wallet.js +++ b/ui/js/selectors/wallet.js @@ -29,6 +29,10 @@ export const selectTransactionItems = createSelector( id: txid, date: tx.timestamp ? new Date(parseInt(tx.timestamp) * 1000) : null, amount: parseFloat(tx.value), + type: tx.type, + claim_id: tx.claim_id, + claim_name: tx.claim_name, + is_tip: tx.is_tip, }); }); return transactionItems.reverse();