2019-09-23 04:47:07 +02:00
|
|
|
// @flow
|
|
|
|
import * as MODALS from 'constants/modal_types';
|
|
|
|
import React from 'react';
|
2021-03-05 20:24:26 +01:00
|
|
|
import TxoListItem from 'component/transactionListTableItem';
|
2020-04-10 19:31:36 +02:00
|
|
|
import Spinner from 'component/spinner';
|
2020-09-02 22:08:37 +02:00
|
|
|
import LbcSymbol from 'component/common/lbc-symbol';
|
2020-04-17 18:51:53 +02:00
|
|
|
|
2019-09-23 04:47:07 +02:00
|
|
|
type Props = {
|
|
|
|
emptyMessage: ?string,
|
|
|
|
loading: boolean,
|
2021-03-05 20:24:26 +01:00
|
|
|
openModal: (id: string, { tx: Txo, cb: (string) => void }) => void,
|
2019-09-23 04:47:07 +02:00
|
|
|
rewards: {},
|
2020-04-10 19:31:36 +02:00
|
|
|
txos: Array<Txo>,
|
2019-09-23 04:47:07 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
function TransactionListTable(props: Props) {
|
2020-04-10 19:31:36 +02:00
|
|
|
const { emptyMessage, rewards, loading, txos } = props;
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
const REVOCABLE_TYPES = ['channel', 'stream', 'repost', 'support', 'claim', 'collection'];
|
2021-03-05 20:24:26 +01:00
|
|
|
function revokeClaim(tx: any, cb: (string) => void) {
|
2020-04-10 19:31:36 +02:00
|
|
|
props.openModal(MODALS.CONFIRM_CLAIM_REVOKE, { tx, cb });
|
2019-09-23 04:47:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<React.Fragment>
|
2020-04-10 19:31:36 +02:00
|
|
|
{!loading && !txos.length && <h2 className="main--empty empty">{emptyMessage || __('No transactions.')}</h2>}
|
|
|
|
{loading && (
|
|
|
|
<h2 className="main--empty empty">
|
|
|
|
<Spinner delayed />
|
|
|
|
</h2>
|
2019-09-23 04:47:07 +02:00
|
|
|
)}
|
2020-04-10 19:31:36 +02:00
|
|
|
{!loading && !!txos.length && (
|
2019-12-18 06:27:08 +01:00
|
|
|
<div className="table__wrapper">
|
2019-09-23 04:47:07 +02:00
|
|
|
<table className="table table--transactions">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2022-04-17 19:04:56 +02:00
|
|
|
<th className="table-column-lbc-date">{__('Date')}</th>
|
|
|
|
<th className="table-column-lbc-type">{<>{__('Type')}</>}</th>
|
2019-09-23 04:47:07 +02:00
|
|
|
<th>{__('Details')} </th>
|
2022-04-17 19:04:56 +02:00
|
|
|
<th className="table-column-lbc-transaction">{__('Transaction')}</th>
|
2020-09-02 22:08:37 +02:00
|
|
|
<th className="table__item--align-right">
|
|
|
|
<LbcSymbol size={18} />
|
|
|
|
</th>
|
2019-09-23 04:47:07 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2020-04-10 19:31:36 +02:00
|
|
|
{txos &&
|
|
|
|
txos.map((t, i) => (
|
|
|
|
<TxoListItem
|
|
|
|
key={`${t.txid}:${t.nout}-${i}`}
|
|
|
|
txo={t}
|
|
|
|
reward={rewards && rewards[t.txid]}
|
|
|
|
isRevokeable={t.is_my_output && !t.is_spent && REVOCABLE_TYPES.includes(t.type)}
|
|
|
|
revokeClaim={revokeClaim}
|
|
|
|
/>
|
|
|
|
))}
|
2019-09-23 04:47:07 +02:00
|
|
|
</tbody>
|
|
|
|
</table>
|
2019-12-18 06:27:08 +01:00
|
|
|
</div>
|
2019-09-23 04:47:07 +02:00
|
|
|
)}
|
|
|
|
</React.Fragment>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default TransactionListTable;
|