Browse Source

Update TransactionsList style

master
meriadec 7 years ago
parent
commit
c544818d51
No known key found for this signature in database GPG Key ID: 1D2FC2305E2CB399
  1. 3
      src/components/AccountPage/index.js
  2. 3
      src/components/DashboardPage/index.js
  3. 13
      src/components/TransactionsList/index.js

3
src/components/AccountPage/index.js

@ -81,12 +81,11 @@ class AccountPage extends PureComponent<Props> {
<Card style={{ height: 435 }} alignItems="center" justifyContent="center"> <Card style={{ height: 435 }} alignItems="center" justifyContent="center">
<Text fontSize={5}>{formatBTC(account.balance)}</Text> <Text fontSize={5}>{formatBTC(account.balance)}</Text>
</Card> </Card>
<Card p={0} px={4} title={t('account:lastOperations')}>
<TransactionsList <TransactionsList
title={t('account:lastOperations')}
transactions={account.transactions} transactions={account.transactions}
minConfirmations={account.settings.minConfirmations} minConfirmations={account.settings.minConfirmations}
/> />
</Card>
</Box> </Box>
) )
} }

3
src/components/DashboardPage/index.js

@ -289,13 +289,12 @@ class DashboardPage extends PureComponent<Props, State> {
))} ))}
</Box> </Box>
</Box> </Box>
<Card p={0} px={4} title={t('dashboard:recentActivity')}>
<TransactionsList <TransactionsList
title={t('dashboard:recentActivity')}
withAccounts withAccounts
transactions={allTransactions} transactions={allTransactions}
onAccountClick={account => push(`/account/${account.id}`)} onAccountClick={account => push(`/account/${account.id}`)}
/> />
</Card>
</Fragment> </Fragment>
)} )}
</Box> </Box>

13
src/components/TransactionsList/index.js

@ -11,7 +11,7 @@ import { getIconByCoinType } from '@ledgerhq/currencies/react'
import type { Transaction as TransactionType, T } from 'types/common' import type { Transaction as TransactionType, T } from 'types/common'
import Box from 'components/base/Box' import Box, { Card } from 'components/base/Box'
import Defer from 'components/base/Defer' import Defer from 'components/base/Defer'
import FormattedVal from 'components/base/FormattedVal' import FormattedVal from 'components/base/FormattedVal'
import Text from 'components/base/Text' import Text from 'components/base/Text'
@ -20,7 +20,7 @@ import ConfirmationCheck from './ConfirmationCheck'
const DATE_COL_SIZE = 80 const DATE_COL_SIZE = 80
const ACCOUNT_COL_SIZE = 150 const ACCOUNT_COL_SIZE = 150
const AMOUNT_COL_SIZE = 150 const AMOUNT_COL_SIZE = 150
const CONFIRMATION_COL_SIZE = 30 const CONFIRMATION_COL_SIZE = 44
const Cap = styled(Text).attrs({ const Cap = styled(Text).attrs({
fontSize: 2, fontSize: 2,
@ -156,7 +156,7 @@ const Transaction = ({
alwaysShowSign alwaysShowSign
/> />
</Cell> </Cell>
<Cell size={CONFIRMATION_COL_SIZE} px={0} align="center" justify="center"> <Cell size={CONFIRMATION_COL_SIZE} px={0} align="center" justify="flex-start">
<ConfirmationCheck minConfirmations={minConfirmations} confirmations={tx.confirmations} /> <ConfirmationCheck minConfirmations={minConfirmations} confirmations={tx.confirmations} />
</Cell> </Cell>
</TransactionRaw> </TransactionRaw>
@ -174,6 +174,7 @@ type Props = {
transactions: Array<TransactionType>, transactions: Array<TransactionType>,
withAccounts?: boolean, withAccounts?: boolean,
minConfirmations: number, minConfirmations: number,
title?: string,
} }
class TransactionsList extends Component<Props> { class TransactionsList extends Component<Props> {
@ -200,12 +201,12 @@ class TransactionsList extends Component<Props> {
_hashCache = null _hashCache = null
render() { render() {
const { transactions, withAccounts, onAccountClick, minConfirmations, t } = this.props const { transactions, title, withAccounts, onAccountClick, minConfirmations, t } = this.props
this._hashCache = this.getHashCache(transactions) this._hashCache = this.getHashCache(transactions)
return ( return (
<Box flow={1}> <Card flow={1} title={title} p={0}>
<Box horizontal pt={4}> <Box horizontal pt={4}>
<HeaderCol size={DATE_COL_SIZE}>{t('transactionsList:date')}</HeaderCol> <HeaderCol size={DATE_COL_SIZE}>{t('transactionsList:date')}</HeaderCol>
{withAccounts && ( {withAccounts && (
@ -231,7 +232,7 @@ class TransactionsList extends Component<Props> {
))} ))}
</Box> </Box>
</Defer> </Defer>
</Box> </Card>
) )
} }
} }

Loading…
Cancel
Save