Skip to content

Commit

Permalink
Fixes brave/brave-browser#9605 - Shows both memo and address for assets
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanml committed May 6, 2020
1 parent 63f2d2d commit 3c155d1
Showing 1 changed file with 46 additions and 20 deletions.
66 changes: 46 additions & 20 deletions components/brave_new_tab_ui/components/default/binance/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,6 @@ class Binance extends React.PureComponent<Props, State> {
const cleanName = this.currencyNames[currentDepositAsset]
const cleanNameDisplay = cleanName ? `(${cleanName})` : ''
const depositData = tag || address
const label = tag ? 'binanceWidgetDepositMemo' : 'binanceWidgetDepositAddress'

return (
<>
Expand Down Expand Up @@ -769,27 +768,54 @@ class Binance extends React.PureComponent<Props, State> {
}
</ListItem>
<DetailArea>
<MemoArea>
<MemoInfo>
<DetailLabel>
{`${currentDepositAsset} ${getLocale(label)}`}
</DetailLabel>
<DetailInfo>
{
depositData
? depositData
: getLocale('binanceWidgetAddressUnavailable')
}
</DetailInfo>
</MemoInfo>
{
depositData
? <CopyButton onClick={this.copyToClipboard.bind(this, depositData)}>
{
!depositData
? <MemoArea>
<MemoInfo>
<DetailLabel>
{`${currentDepositAsset}`}
</DetailLabel>
<DetailInfo>
{getLocale('binanceWidgetAddressUnavailable')}
</DetailInfo>
</MemoInfo>
</MemoArea>
: null
}
{
address
? <MemoArea>
<MemoInfo>
<DetailLabel>
{`${currentDepositAsset} ${getLocale('binanceWidgetDepositAddress')}`}
</DetailLabel>
<DetailInfo>
{address}
</DetailInfo>
</MemoInfo>
<CopyButton onClick={this.copyToClipboard.bind(this, address)}>
{getLocale('binanceWidgetCopy')}
</CopyButton>
: null
}
</MemoArea>
</MemoArea>
: null
}
{
tag
? <MemoArea>
<MemoInfo>
<DetailLabel>
{`${currentDepositAsset} ${getLocale('binanceWidgetDepositMemo')}`}
</DetailLabel>
<DetailInfo>
{tag}
</DetailInfo>
</MemoInfo>
<CopyButton onClick={this.copyToClipboard.bind(this, tag)}>
{getLocale('binanceWidgetCopy')}
</CopyButton>
</MemoArea>
: null
}
</DetailArea>
</>
)
Expand Down

0 comments on commit 3c155d1

Please sign in to comment.