Skip to content

Commit

Permalink
Merge pull request #5476 from brave/fix-9605-1.8
Browse files Browse the repository at this point in the history
Shows both memo and address for applicable assets [Binance] (1.8)
  • Loading branch information
kjozwiak authored May 7, 2020
2 parents a053d0b + abc1552 commit 3540979
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 @@ -744,7 +744,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 @@ -772,27 +771,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 3540979

Please sign in to comment.