add abandon to transaction list filter #1769
1 changed files with 29 additions and 9 deletions
|
@ -4,7 +4,7 @@ import { FormField } from 'component/common/form';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
import FileExporter from 'component/common/file-exporter';
|
import FileExporter from 'component/common/file-exporter';
|
||||||
import * as icons from 'constants/icons';
|
import * as icons from 'constants/icons';
|
||||||
import { MODALS } from 'lbry-redux';
|
import { MODALS, TRANSACTIONS } from 'lbry-redux';
|
||||||
import TransactionListItem from './internal/transaction-list-item';
|
import TransactionListItem from './internal/transaction-list-item';
|
||||||
|
|
||||||
export type Transaction = {
|
export type Transaction = {
|
||||||
|
@ -45,6 +45,10 @@ class TransactionList extends React.PureComponent<Props, State> {
|
||||||
(this: any).isRevokeable = this.isRevokeable.bind(this);
|
(this: any).isRevokeable = this.isRevokeable.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
capitalize(string: string) {
|
||||||
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||||
|
}
|
||||||
|
|
||||||
handleFilterChanged(event: SyntheticInputEvent<*>) {
|
handleFilterChanged(event: SyntheticInputEvent<*>) {
|
||||||
this.setState({
|
this.setState({
|
||||||
filter: event.target.value,
|
filter: event.target.value,
|
||||||
|
@ -108,14 +112,30 @@ class TransactionList extends React.PureComponent<Props, State> {
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<option value="all">{__('All')}</option>
|
<option value="all">{__('All')}</option>
|
||||||
<option value="spend">{__('Spends')}</option>
|
<option value={TRANSACTIONS.SPEND}>
|
||||||
<option value="receive">{__('Receives')}</option>
|
{__(`${this.capitalize(TRANSACTIONS.SPEND)}s`)}
|
||||||
<option value="publish">{__('Publishes')}</option>
|
</option>
|
||||||
<option value="channel">{__('Channels')}</option>
|
<option value={TRANSACTIONS.RECEIVE}>
|
||||||
<option value="tip">{__('Tips')}</option>
|
{__(`${this.capitalize(TRANSACTIONS.RECEIVE)}s`)}
|
||||||
<option value="support">{__('Supports')}</option>
|
</option>
|
||||||
<option value="update">{__('Updates')}</option>
|
<option value={TRANSACTIONS.PUBLISH}>
|
||||||
<option value="abandon">{__('Abandon')}</option>
|
{__(`${this.capitalize(TRANSACTIONS.PUBLISH)}es`)}
|
||||||
|
</option>
|
||||||
|
<option value={TRANSACTIONS.CHANNEL}>
|
||||||
|
{__(`${this.capitalize(TRANSACTIONS.CHANNEL)}s`)}
|
||||||
|
</option>
|
||||||
|
<option value={TRANSACTIONS.TIP}>
|
||||||
|
{__(`${this.capitalize(TRANSACTIONS.TIP)}s`)}
|
||||||
|
</option>
|
||||||
|
<option value={TRANSACTIONS.SUPPORT}>
|
||||||
|
{__(`${this.capitalize(TRANSACTIONS.SUPPORT)}s`)}
|
||||||
|
</option>
|
||||||
|
<option value={TRANSACTIONS.UPDATE}>
|
||||||
|
{__(`${this.capitalize(TRANSACTIONS.UPDATE)}s`)}
|
||||||
|
</option>
|
||||||
|
<option value={TRANSACTIONS.ABANDON}>
|
||||||
|
{__(`${this.capitalize(TRANSACTIONS.ABANDON)}s`)}
|
||||||
|
</option>
|
||||||
</FormField>
|
</FormField>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
Loading…
Add table
Reference in a new issue