use correct tx price color and fix tx refresh button layout
This commit is contained in:
parent
4aabfb731e
commit
bae0534d99
8 changed files with 42 additions and 37 deletions
|
@ -77,7 +77,7 @@ class CreditAmount extends React.PureComponent<Props> {
|
|||
title={fullPrice}
|
||||
className={classnames('badge', {
|
||||
badge,
|
||||
'badge--cost': (badge && !isFree) || amount > 0,
|
||||
'badge--cost': badge && amount > 0,
|
||||
'badge--free': badge && isFree,
|
||||
'badge--large': large,
|
||||
})}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// @flow
|
||||
import type { Transaction } from '../view';
|
||||
import type { Transaction } from 'types/transaction';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import React from 'react';
|
||||
import ButtonTransaction from 'component/common/transaction-link';
|
||||
|
@ -53,12 +53,12 @@ class TransactionListItem extends React.PureComponent<Props> {
|
|||
return (
|
||||
<tr>
|
||||
<td>
|
||||
<CreditAmount inheritStyle showPlus amount={amount} precision={8} />
|
||||
<CreditAmount showPlus amount={amount} precision={8} />
|
||||
<br />
|
||||
|
||||
{fee !== 0 && (
|
||||
<span className="table__item-label">
|
||||
<CreditAmount inheritStyle fee amount={fee} precision={8} />
|
||||
<CreditAmount fee amount={fee} precision={8} />
|
||||
</span>
|
||||
)}
|
||||
</td>
|
||||
|
@ -67,16 +67,17 @@ class TransactionListItem extends React.PureComponent<Props> {
|
|||
</td>
|
||||
<td className="table__item--actionable">
|
||||
{reward && <span>{reward.reward_title}</span>}
|
||||
{name && claimId && (
|
||||
<Button
|
||||
constrict
|
||||
button="link"
|
||||
navigate="/show"
|
||||
navigateParams={{ uri: buildURI({ claimName: name, claimId }) }}
|
||||
>
|
||||
{name}
|
||||
</Button>
|
||||
)}
|
||||
{name &&
|
||||
claimId && (
|
||||
<Button
|
||||
constrict
|
||||
button="link"
|
||||
navigate="/show"
|
||||
navigateParams={{ uri: buildURI({ claimName: name, claimId }) }}
|
||||
>
|
||||
{name}
|
||||
</Button>
|
||||
)}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
// @flow
|
||||
import type { Transaction } from 'types/transaction';
|
||||
import * as icons from 'constants/icons';
|
||||
import * as MODALS from 'constants/modal_types';
|
||||
import * as React from 'react';
|
||||
|
@ -8,17 +9,6 @@ import FileExporter from 'component/common/file-exporter';
|
|||
import { TRANSACTIONS } from 'lbry-redux';
|
||||
import TransactionListItem from './internal/transaction-list-item';
|
||||
|
||||
export type Transaction = {
|
||||
amount: number,
|
||||
claim_id: string,
|
||||
claim_name: string,
|
||||
fee: number,
|
||||
nout: number,
|
||||
txid: string,
|
||||
type: string,
|
||||
date: Date,
|
||||
};
|
||||
|
||||
type Props = {
|
||||
emptyMessage: ?string,
|
||||
slim?: boolean,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// @flow
|
||||
import type { Transaction } from 'component/transactionList/view';
|
||||
import type { Transaction } from 'types/transaction';
|
||||
import * as icons from 'constants/icons';
|
||||
import React, { Fragment } from 'react';
|
||||
import BusyIndicator from 'component/common/busy-indicator';
|
||||
|
@ -28,7 +28,7 @@ class TransactionListRecent extends React.PureComponent<Props> {
|
|||
return (
|
||||
<section className="card card--section">
|
||||
<header className="card__header card__header--flat">
|
||||
<h2 className="card__title">
|
||||
<h2 className="card__title card__title--flex-between">
|
||||
{__('Recent Transactions')}
|
||||
<RefreshTransactionButton />
|
||||
</h2>
|
||||
|
@ -39,11 +39,12 @@ class TransactionListRecent extends React.PureComponent<Props> {
|
|||
</p>
|
||||
</header>
|
||||
|
||||
{fetchingTransactions && !hasTransactions && (
|
||||
<div className="card__content">
|
||||
<BusyIndicator message={__('Loading transactions')} />
|
||||
</div>
|
||||
)}
|
||||
{fetchingTransactions &&
|
||||
!hasTransactions && (
|
||||
<div className="card__content">
|
||||
<BusyIndicator message={__('Loading transactions')} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{hasTransactions && (
|
||||
<Fragment>
|
||||
|
|
|
@ -27,7 +27,7 @@ class TransactionHistoryPage extends React.PureComponent<Props> {
|
|||
<Page>
|
||||
<section className="card card--section">
|
||||
<header className="card__header card__header--flat">
|
||||
<h2 className="card__title">
|
||||
<h2 className="card__title card__title--flex-between ">
|
||||
{__('Transaction History')}
|
||||
<RefreshTransactionButton />
|
||||
</h2>
|
||||
|
|
|
@ -191,3 +191,9 @@
|
|||
margin-left: var(--spacing-vertical-medium);
|
||||
}
|
||||
}
|
||||
|
||||
.card__title--flex-between {
|
||||
display: flex;
|
||||
@include between;
|
||||
align-items: center;
|
||||
}
|
||||
|
|
|
@ -109,8 +109,4 @@
|
|||
td:nth-of-type(5) {
|
||||
width: 15%;
|
||||
}
|
||||
|
||||
.badge {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
}
|
||||
|
|
11
src/renderer/types/transaction.js
Normal file
11
src/renderer/types/transaction.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
// @flow
|
||||
export type Transaction = {
|
||||
amount: number,
|
||||
claim_id: string,
|
||||
claim_name: string,
|
||||
fee: number,
|
||||
nout: number,
|
||||
txid: string,
|
||||
type: string,
|
||||
date: Date,
|
||||
};
|
Loading…
Add table
Reference in a new issue