Skip to content
This repository was archived by the owner on Mar 28, 2025. It is now read-only.

Commit 1bc8aaf

Browse files
Merge pull request #134 from MetaMask/dx-team/issues/1282-Pass-windowEthereum-to-hasWeb3Provider
Dx team/issues/1282 pass window Ethereum to has web3 provider
2 parents a4662b1 + 4fe611e commit 1bc8aaf

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

src/components/FullWidthCta.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ const FullWidthCta = props => {
5252
{ctas ? (
5353
<CTAWrapper>
5454
{ctas.map(cta =>
55-
contentfulModuleToComponent({
56-
...cta,
57-
})
58-
)}
55+
contentfulModuleToComponent({
56+
...cta,
57+
})
58+
)}
5959
</CTAWrapper>
6060
) : null}
6161
</FullWidthCtaInner>

src/components/HeroContainer.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ const HeroContainerComponent = props => {
4646
const isAbout = pathname === '/about/'
4747
const isFlask = pathname === '/flask/'
4848
const isInstitutions = pathname === '/institutions/'
49-
const isInstitutionalChild = pathname === '/institutions/portfolio/' || pathname === '/institutions/compliance/'
49+
const isInstitutionalChild =
50+
pathname === '/institutions/portfolio/' ||
51+
pathname === '/institutions/compliance/'
5052
const isCustody = pathname === '/institutions/custody/'
5153
const isThankYou = pathname === '/institutions/thank-you/'
5254
let hubspotWrapper
@@ -710,7 +712,7 @@ const HeroCTA = styled.div`
710712
711713
@media (max-width: ${({ theme }) => theme.device.tabletMediaMax}) {
712714
justify-content: center;
713-
715+
714716
.button {
715717
margin: 0 8px 16px;
716718
}

src/templates/PageLayout.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import {
1111
import scrollTo from '../lib/utils/scrollToElement'
1212
import Context from '../Context/ContextPage'
1313
import ContextClientSide from '../Context/ContextClientSide'
14+
import { trackCustomEvent } from 'gatsby-plugin-google-analytics'
15+
import { browserName } from 'react-device-detect'
1416

1517
/**
1618
* @name PageLayout
@@ -81,6 +83,14 @@ const PageLayout = props => {
8183
)
8284
})
8385
})
86+
// Detect Web3 Wallet
87+
if (typeof window.ethereum !== 'undefined') {
88+
trackCustomEvent({
89+
category: 'Web3 Wallet Detected',
90+
action: 'window.ethereum present',
91+
label: browserName || 'Chrome',
92+
})
93+
}
8494
}
8595
}, [pathname])
8696

0 commit comments

Comments
 (0)