aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/top_bar/provider_display.tsx
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-05-25 01:11:56 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-05-26 03:03:18 +0800
commitb49148ec54886b11042e42eed9ad4e8793840775 (patch)
treea5ee61ed5ac86de14a60fef9c00e9550b78b0474 /packages/website/ts/components/top_bar/provider_display.tsx
parentc7f5e77b3fe7c1805202a5b1e1e1ce1e9d31a6b0 (diff)
downloaddexon-0x-contracts-b49148ec54886b11042e42eed9ad4e8793840775.tar.gz
dexon-0x-contracts-b49148ec54886b11042e42eed9ad4e8793840775.tar.zst
dexon-0x-contracts-b49148ec54886b11042e42eed9ad4e8793840775.zip
Implement metamask installation flow
Diffstat (limited to 'packages/website/ts/components/top_bar/provider_display.tsx')
-rw-r--r--packages/website/ts/components/top_bar/provider_display.tsx9
1 files changed, 3 insertions, 6 deletions
diff --git a/packages/website/ts/components/top_bar/provider_display.tsx b/packages/website/ts/components/top_bar/provider_display.tsx
index fc516882a..4dc37f231 100644
--- a/packages/website/ts/components/top_bar/provider_display.tsx
+++ b/packages/website/ts/components/top_bar/provider_display.tsx
@@ -39,8 +39,7 @@ const styles: Styles = {
export class ProviderDisplay extends React.Component<ProviderDisplayProps, ProviderDisplayState> {
public render(): React.ReactNode {
const isAddressAvailable = !_.isEmpty(this.props.userAddress);
- const isExternallyInjectedProvider =
- this.props.providerType === ProviderType.Injected && this.props.injectedProviderName !== '0x Public';
+ const isExternallyInjectedProvider = utils.isExternallyInjected(this.props.providerType, this.props.injectedProviderName);
const displayAddress = isAddressAvailable
? utils.getAddressBeginAndEnd(this.props.userAddress)
: isExternallyInjectedProvider
@@ -69,15 +68,13 @@ export class ProviderDisplay extends React.Component<ProviderDisplayProps, Provi
)}
</div>
);
- const hasInjectedProvider =
- this.props.injectedProviderName !== '0x Public' && this.props.providerType === ProviderType.Injected;
const hasLedgerProvider = this.props.providerType === ProviderType.Ledger;
- const horizontalPosition = hasInjectedProvider || hasLedgerProvider ? 'left' : 'middle';
+ const horizontalPosition = isExternallyInjectedProvider || hasLedgerProvider ? 'left' : 'middle';
return (
<div style={{ width: 'fit-content', height: 48, float: 'right' }}>
<DropDown
hoverActiveNode={hoverActiveNode}
- popoverContent={this.renderPopoverContent(hasInjectedProvider, hasLedgerProvider)}
+ popoverContent={this.renderPopoverContent(isExternallyInjectedProvider, hasLedgerProvider)}
anchorOrigin={{ horizontal: horizontalPosition, vertical: 'bottom' }}
targetOrigin={{ horizontal: horizontalPosition, vertical: 'top' }}
zDepth={1}