-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds pending InvocationTransaction UX and logic flow and separates br…
…eaks down abstract transaction components
- Loading branch information
1 parent
75550f4
commit ad7d167
Showing
10 changed files
with
409 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// @flow | ||
import React, { Fragment } from 'react' | ||
|
||
import classNames from 'classnames' | ||
import styles from './Transaction.scss' | ||
import ClaimIcon from '../../../assets/icons/claim.svg' | ||
import CopyToClipboard from '../../CopyToClipboard' | ||
|
||
type Props = { | ||
txDate: React$Node, | ||
logo: React$Node, | ||
label: string, | ||
amount: string | number, | ||
contactTo: React$Node | string, | ||
to: string, | ||
contactToExists: boolean, | ||
} | ||
|
||
export default class ClaimAbstract extends React.Component<Props> { | ||
render = () => { | ||
const { | ||
txDate, | ||
logo, | ||
label, | ||
amount, | ||
contactTo, | ||
to, | ||
contactToExists, | ||
} = this.props | ||
return ( | ||
<div className={classNames(styles.transactionContainer)}> | ||
<div className={styles.abstractContainer}> | ||
<div className={styles.txTypeIconContainer}> | ||
<div className={styles.claimIconContainer}> | ||
<ClaimIcon /> | ||
</div> | ||
</div> | ||
{txDate} | ||
<div className={styles.txLabelContainer}> | ||
{logo} | ||
{label} | ||
</div> | ||
<div className={styles.txAmountContainer}>{amount}</div> | ||
<div className={styles.txToContainer}> | ||
<Fragment> | ||
<span>{contactTo}</span> | ||
{!contactToExists && ( | ||
<CopyToClipboard | ||
className={styles.copy} | ||
text={to} | ||
tooltip="Copy Public Address" | ||
/> | ||
)} | ||
</Fragment> | ||
</div> | ||
<div className={styles.historyButtonPlaceholder} /> | ||
</div> | ||
</div> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// @flow | ||
import React from 'react' | ||
import classNames from 'classnames' | ||
|
||
import Button from '../../Button' | ||
import styles from './Transaction.scss' | ||
import ReceiveIcon from '../../../assets/icons/receive-tx.svg' | ||
import ContactsAdd from '../../../assets/icons/contacts-add.svg' | ||
import CopyToClipboard from '../../CopyToClipboard' | ||
|
||
type Props = { | ||
txDate: React$Node, | ||
logo: React$Node, | ||
label: string, | ||
amount: string | number, | ||
showAddContactModal: (from: string) => void, | ||
contactFromExists: boolean, | ||
from: string, | ||
address: string, | ||
contactFrom: React$Node | string, | ||
contactFromExists: boolean, | ||
} | ||
|
||
export default class ReceiveAbstract extends React.Component<Props> { | ||
render = () => { | ||
const { | ||
txDate, | ||
logo, | ||
label, | ||
amount, | ||
contactFrom, | ||
showAddContactModal, | ||
contactFromExists, | ||
from, | ||
address, | ||
} = this.props | ||
const isMintTokens = from === 'MINT TOKENS' | ||
const isGasClaim = address === from && !Number(amount) | ||
return ( | ||
<div className={classNames(styles.transactionContainer)}> | ||
<div className={styles.abstractContainer}> | ||
<div className={styles.txTypeIconContainer}> | ||
<div className={styles.receiveIconContainer}> | ||
<ReceiveIcon /> | ||
</div> | ||
</div> | ||
{txDate} | ||
<div className={styles.txLabelContainer}> | ||
{logo} | ||
{label} | ||
</div> | ||
<div className={styles.txAmountContainer}>{amount}</div> | ||
<div className={styles.txToContainer}> | ||
<span>{contactFrom}</span> | ||
{!contactFromExists && | ||
!isMintTokens && ( | ||
<CopyToClipboard | ||
className={styles.copy} | ||
text={from} | ||
tooltip="Copy Public Address" | ||
/> | ||
)} | ||
</div> | ||
{isMintTokens || isGasClaim ? ( | ||
<div className={styles.transactionHistoryButton} /> | ||
) : ( | ||
<Button | ||
className={styles.transactionHistoryButton} | ||
renderIcon={ContactsAdd} | ||
onClick={() => showAddContactModal(from)} | ||
disabled={contactFromExists} | ||
> | ||
Add | ||
</Button> | ||
)} | ||
</div> | ||
</div> | ||
) | ||
} | ||
} |
Oops, something went wrong.