chore: PR feedback

This commit is contained in:
fragosti
2018-11-08 16:08:20 -08:00
parent 5d74421e43
commit f44c5b2292

View File

@@ -9,16 +9,16 @@ import { format } from '../util/format';
import { Dropdown, DropdownItemConfig } from './ui/dropdown'; import { Dropdown, DropdownItemConfig } from './ui/dropdown';
export interface PaymentMethodDropdownProps { export interface PaymentMethodDropdownProps {
selectedEthAddress: string; accountAddress: string;
addressEthBaseAmount: BigNumber; accountEthBalanceInWei?: BigNumber;
network: Network; network: Network;
} }
export class PaymentMethodDropdown extends React.Component<PaymentMethodDropdownProps> { export class PaymentMethodDropdown extends React.Component<PaymentMethodDropdownProps> {
public render(): React.ReactNode { public render(): React.ReactNode {
const { selectedEthAddress, addressEthBaseAmount } = this.props; const { accountAddress, accountEthBalanceInWei } = this.props;
const value = format.ethAddress(selectedEthAddress); const value = format.ethAddress(accountAddress);
const label = format.ethBaseAmount(addressEthBaseAmount) as string; const label = format.ethBaseAmount(accountEthBalanceInWei, 4, '') as string;
return <Dropdown value={value} label={label} items={this._getDropdownItemConfigs()} />; return <Dropdown value={value} label={label} items={this._getDropdownItemConfigs()} />;
} }
private readonly _getDropdownItemConfigs = (): DropdownItemConfig[] => { private readonly _getDropdownItemConfigs = (): DropdownItemConfig[] => {
@@ -33,12 +33,12 @@ export class PaymentMethodDropdown extends React.Component<PaymentMethodDropdown
return [viewOnEtherscan, copyAddressToClipboard]; return [viewOnEtherscan, copyAddressToClipboard];
}; };
private readonly _handleEtherscanClick = (): void => { private readonly _handleEtherscanClick = (): void => {
const { selectedEthAddress, network } = this.props; const { accountAddress, network } = this.props;
const etherscanUrl = etherscanUtil.getEtherScanEthAddressIfExists(selectedEthAddress, network); const etherscanUrl = etherscanUtil.getEtherScanEthAddressIfExists(accountAddress, network);
window.open(etherscanUrl, '_blank'); window.open(etherscanUrl, '_blank');
}; };
private readonly _handleCopyToClipboardClick = (): void => { private readonly _handleCopyToClipboardClick = (): void => {
const { selectedEthAddress } = this.props; const { accountAddress } = this.props;
copy(selectedEthAddress); copy(accountAddress);
}; };
} }