diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-06-23 07:07:07 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-06-23 07:07:07 +0800 |
commit | 1f5848ba8265885ef4644a8103029552782965c8 (patch) | |
tree | 20d257e72082188bf538642138289d8ef108f3af /packages/website | |
parent | a1737a28d08798e4b58ff49cd116609ddafa5295 (diff) | |
download | dexon-sol-tools-1f5848ba8265885ef4644a8103029552782965c8.tar dexon-sol-tools-1f5848ba8265885ef4644a8103029552782965c8.tar.gz dexon-sol-tools-1f5848ba8265885ef4644a8103029552782965c8.tar.bz2 dexon-sol-tools-1f5848ba8265885ef4644a8103029552782965c8.tar.lz dexon-sol-tools-1f5848ba8265885ef4644a8103029552782965c8.tar.xz dexon-sol-tools-1f5848ba8265885ef4644a8103029552782965c8.tar.zst dexon-sol-tools-1f5848ba8265885ef4644a8103029552782965c8.zip |
Remove extra border from the bottom of the wallet
Diffstat (limited to 'packages/website')
-rw-r--r-- | packages/website/ts/components/wallet/wallet.tsx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/packages/website/ts/components/wallet/wallet.tsx b/packages/website/ts/components/wallet/wallet.tsx index 4cc70badd..dc48d6619 100644 --- a/packages/website/ts/components/wallet/wallet.tsx +++ b/packages/website/ts/components/wallet/wallet.tsx @@ -311,7 +311,7 @@ export class Wallet extends React.Component<WalletProps, WalletState> { wrappedEtherDirection: Side.Deposit, }; const key = ETHER_ITEM_KEY; - return this._renderBalanceRow(key, icon, primaryText, secondaryText, accessoryItemConfig, 'eth-row'); + return this._renderBalanceRow(key, icon, primaryText, secondaryText, accessoryItemConfig, false, 'eth-row'); } private _renderTokenRows(): React.ReactNode { const trackedTokens = this.props.trackedTokens; @@ -322,7 +322,7 @@ export class Wallet extends React.Component<WalletProps, WalletState> { ); return _.map(trackedTokensStartingWithEtherToken, this._renderTokenRow.bind(this)); } - private _renderTokenRow(token: Token, _index: number): React.ReactNode { + private _renderTokenRow(token: Token, index: number): React.ReactNode { const tokenState = this.props.trackedTokenStateByAddress[token.address]; if (_.isUndefined(tokenState)) { return null; @@ -350,12 +350,14 @@ export class Wallet extends React.Component<WalletProps, WalletState> { }, }; const key = token.address; + const isLastRow = index === this.props.trackedTokens.length - 1; return this._renderBalanceRow( key, icon, primaryText, secondaryText, accessoryItemConfig, + isLastRow, isWeth ? 'weth-row' : undefined, ); } @@ -365,13 +367,19 @@ export class Wallet extends React.Component<WalletProps, WalletState> { primaryText: React.ReactNode, secondaryText: React.ReactNode, accessoryItemConfig: AccessoryItemConfig, + isLastRow: boolean, className?: string, ): React.ReactNode { const shouldShowWrapEtherItem = !_.isUndefined(this.state.wrappedEtherDirection) && this.state.wrappedEtherDirection === accessoryItemConfig.wrappedEtherDirection && !_.isUndefined(this.props.userEtherBalanceInWei); - const additionalStyle = shouldShowWrapEtherItem ? walletItemStyles.focusedItem : styles.borderedItem; + let additionalStyle; + if (shouldShowWrapEtherItem) { + additionalStyle = walletItemStyles.focusedItem; + } else if (!isLastRow) { + additionalStyle = styles.borderedItem; + } const style = { ...styles.tokenItem, ...additionalStyle }; const etherToken = this._getEthToken(); return ( |