Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit 1f1e6a2

Browse files
author
Andrew Schneider
authored
Merge pull request #1893 from blockchain/feat/pit-connect-test
Feat/pit connect test
2 parents e3d836d + 0fe90a3 commit 1f1e6a2

18 files changed

Lines changed: 401 additions & 440 deletions

File tree

packages/blockchain-info-components/src/Tooltip/template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const StyledTip = styled(ReactTooltip)`
77
cursor: pointer;
88
font-weight: 400;
99
text-align: left;
10-
padding: ${({ toolTipPad }) => (toolTipPad || '7px 12px')};
10+
padding: ${({ toolTipPad }) => toolTipPad || '7px 12px'};
1111
text-transform: none;
1212
z-index: 2000 !important;
1313
font-size: 11px !important;
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
import styled, { keyframes, createGlobalStyle } from 'styled-components'
2+
import { LinkContainer } from 'react-router-bootstrap'
3+
import { Icon, Image, Text } from 'blockchain-info-components'
4+
5+
export const Scale = () => {
6+
return keyframes`
7+
0% {
8+
opacity: 0;
9+
transform: scale(0);
10+
}
11+
100% {
12+
transform: scale(1);
13+
opacity: 1;
14+
}
15+
`
16+
}
17+
18+
export const TooltipBody = styled.div`
19+
position: relative;
20+
width: 100%;
21+
max-width: 256px;
22+
background-color: ${props => props.theme['white']};
23+
border-radius: 8px;
24+
box-shadow: 0 4px 32px rgba(5, 24, 61, 0.4);
25+
padding: 32px;
26+
animation: ${Scale} 0.3s ease-in-out;
27+
28+
> span:first-child {
29+
position: absolute;
30+
top: 24px;
31+
right: 24px;
32+
33+
&:hover {
34+
cursor: pointer;
35+
}
36+
}
37+
`
38+
export const TooltipContent = styled.div`
39+
color: ${props => props.theme['white']};
40+
margin-bottom: 24px;
41+
text-align: center;
42+
`
43+
export const TooltipFooter = styled.div`
44+
display: flex;
45+
flex-direction: row;
46+
justify-content: ${props =>
47+
props.isLastStep ? 'flex-end' : 'space-between'};
48+
align-content: center;
49+
align-items: center;
50+
color: ${props => props.theme['white']};
51+
`
52+
53+
export const StepIcon = styled(Icon)`
54+
margin: 0 auto 12px auto;
55+
width: fit-content;
56+
`
57+
58+
export const StepImg = styled(Image)`
59+
margin-bottom: 32px;
60+
`
61+
62+
export const StepTitle = styled(Text)`
63+
font-size: 20px;
64+
text-align: center;
65+
margin-bottom: 8px;
66+
line-height: 24px;
67+
`
68+
69+
export const StepContent = styled(Text)`
70+
line-height: 24px;
71+
`
72+
73+
export const CloseTourIcon = styled(Icon)`
74+
&:hover {
75+
color: ${({ theme }) => theme['grey600']};
76+
}
77+
78+
&:active {
79+
color: ${({ theme }) => theme['grey800']};
80+
}
81+
`
82+
83+
export const PitJoyrideStyles = createGlobalStyle`
84+
.__floater__open {
85+
transition: none !important;
86+
filter: none !important;
87+
margin-left: 170px !important;
88+
}
89+
`
90+
91+
export const SpotlightLinkContainer = styled(LinkContainer)`
92+
position: relative;
93+
`
94+
95+
export const JoyrideSpotlight = styled.div`
96+
position: absolute;
97+
top: 0;
98+
right: 0;
99+
bottom: 0;
100+
left: 0;
101+
margin: auto 11px;
102+
width: 28px;
103+
height: 28px;
104+
`

packages/blockchain-wallet-v4-frontend/src/data/analytics/model.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const CUSTOM_VARIABLES = {
1616
// AB TESTS
1717
//
1818
export const AB_TESTS = {
19-
PIT_SIDE_NAV_TEST3: 'PitSidenavTest3',
19+
PIT_CONNECT_TEST: 'PitConnectTest',
2020
WALLET_PIT_SIGNUP: 'WalletPitSignup'
2121
}
2222

@@ -97,7 +97,6 @@ export const ADS_EVENTS = {
9797

9898
export const PIT_EVENTS = {
9999
BANNER_GET_STARTED: ['pit', 'homepage', 'homepage_banner_click'],
100-
SIDE_NAV: ['pit', 'sidenav', 'sidenav_link_click'],
101100
CONNECT_NOW: ['pit', 'link_page', 'connect_now_click'],
102101
LEARN_MORE: ['pit', 'link_page', 'learn_more_click']
103102
}

packages/blockchain-wallet-v4-frontend/src/data/analytics/reducers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { AB_TESTS } from './model'
66

77
const INITIAL_STATE = {
88
ab_tests: {
9-
[AB_TESTS.PIT_SIDE_NAV_TEST3]: Remote.NotAsked,
9+
[AB_TESTS.PIT_CONNECT_TEST]: Remote.NotAsked,
1010
[AB_TESTS.WALLET_PIT_SIGNUP]: Remote.NotAsked
1111
}
1212
}

packages/blockchain-wallet-v4-frontend/src/data/modules/profile/sagas.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import * as AT from './actionTypes'
2828
import * as S from './selectors'
2929
import { KYC_STATES, USER_ACTIVATION_STATES } from './model'
3030

31-
const { AB_TESTS, AB_TEST_GOALS } = model.analytics
31+
const { AB_TESTS } = model.analytics
3232

3333
export const logLocation = 'modules/profile/sagas'
3434
export const userRequiresRestoreError = 'User restored'
@@ -406,26 +406,18 @@ export default ({ api, coreSagas, networks }) => {
406406
const pitLinkId = prop('linkId', data)
407407
const email = (yield select(selectors.core.settings.getEmail)).getOrFail()
408408
const variant = (yield select(
409-
selectors.analytics.selectAbTest(AB_TESTS.PIT_SIDE_NAV_TEST3)
410-
)).getOrElse('sidenav_pulse')
409+
selectors.analytics.selectAbTest(AB_TESTS.PIT_CONNECT_TEST)
410+
)).getOrElse('original')
411411
const accountDeeplinkUrl = `${pitDomain}/trade/link/${pitLinkId}?email=${encodeURIComponent(
412412
email
413-
)}&utm_source=web_wallet&utm_medium=wallet_linking&utm_campaign=${variant}`
413+
)}&utm_source=web_wallet&utm_medium=referral&utm_campaign=${variant}`
414414
// share addresses
415415
yield put(A.shareWalletAddressesWithPit())
416416
// simulate wait while allowing user to read modal
417417
yield delay(2000)
418418
// attempt to open url for user
419419
window.open(accountDeeplinkUrl, '_blank', 'noreferrer')
420420
yield put(A.setLinkToPitAccountDeepLink(accountDeeplinkUrl))
421-
// check if this is actually due to AB test pulse sidenav, if so log goal completion to matomo
422-
const abTestGroupR = yield select(
423-
selectors.analytics.selectAbTest(AB_TESTS.PIT_SIDE_NAV_TEST3)
424-
)
425-
const abTestGroup = abTestGroupR.getOrElse('original')
426-
if (abTestGroup === 'sidenav_pulse') {
427-
yield put(actions.analytics.logEvent(AB_TEST_GOALS.PIT_LINKOUT_CLICKED))
428-
}
429421
// poll for account link
430422
yield race({
431423
task: call(pollForAccountLinkSuccess, 0),

packages/blockchain-wallet-v4-frontend/src/data/modules/profile/selectors.js

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -94,25 +94,8 @@ export const isCountrySupported = (countryCode, supportedCountries) =>
9494
any(propEq('code', countryCode), supportedCountries)
9595
export const isInvitedToKyc = state =>
9696
selectors.core.settings.getInvitations(state).map(prop('kyc'))
97-
export const userFlowSupported = isInvitedToKyc
9897

99-
// export const isInvitedToPitSidenav = state => {
100-
// const pitCountries = selectors.core.walletOptions.getPitCountryList(state)
101-
// const userCountry = selectors.core.settings.getCountryCode(state)
102-
// const isInvited = selectors.core.settings
103-
// .getInvitations(state)
104-
// .map(prop('pitSidenav'))
105-
//
106-
// const transform = (pitCountries, userCountry, isInvited) => {
107-
// const isCountryWhitelisted =
108-
// pitCountries &&
109-
// (pitCountries === '*' || includes(userCountry, pitCountries))
110-
//
111-
// return isCountryWhitelisted || isInvited
112-
// }
113-
//
114-
// return lift(transform)(pitCountries, userCountry, isInvited)
115-
// }
98+
export const userFlowSupported = isInvitedToKyc
11699

117100
export const isInvitedToPitHomeBanner = state => {
118101
const pitCountries = selectors.core.walletOptions.getPitCountryList(state)

packages/blockchain-wallet-v4-frontend/src/layouts/Wallet/MenuLeft/Navigation/index.js

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
import React from 'react'
22
import { connect } from 'react-redux'
33
import { compose, bindActionCreators } from 'redux'
4-
import { withRouter } from 'react-router-dom'
54
import { concat, equals, not, prop } from 'ramda'
65
import { STATUS } from 'react-joyride/lib'
76

87
import { actions, model, selectors } from 'data'
98
import Navigation from './template'
10-
const { NONE, REJECTED } = model.profile.KYC_STATES
119

12-
const { PIT_EVENTS } = model.analytics
10+
const { NONE, REJECTED } = model.profile.KYC_STATES
1311

1412
class NavigationContainer extends React.PureComponent {
15-
state = { hasRanPitTour: false }
16-
17-
handleTourCallbacks = data => {
13+
handlePitTourCallbacks = (data, e) => {
1814
if ([STATUS.FINISHED, STATUS.SKIPPED].includes(data.status)) {
19-
this.setState({ hasRanPitTour: true })
15+
this.props.preferencesActions.hideThePitPulse()
2016
}
2117
}
2218

@@ -25,31 +21,18 @@ class NavigationContainer extends React.PureComponent {
2521
actions,
2622
analyticsActions,
2723
domains,
28-
isPitAccountLinked,
29-
routerActions,
30-
supportedCoins,
31-
userKycState,
24+
userKYCState,
3225
...props
3326
} = this.props
3427

3528
return (
3629
<Navigation
3730
{...props}
38-
onClickPitSideNavLink={() =>
39-
analyticsActions.logEvent(PIT_EVENTS.SIDE_NAV)
40-
}
4131
handleCloseMenu={actions.layoutWalletMenuCloseClicked}
42-
isPitAccountLinked={isPitAccountLinked}
4332
pitUrl={concat(prop('thePit', domains), '/trade')}
44-
supportedCoins={supportedCoins}
45-
hasRanPitTour={this.state.hasRanPitTour}
46-
handleTourCallbacks={this.handleTourCallbacks}
47-
routeToPit={() => {
48-
this.setState({ hasRanPitTour: true })
49-
routerActions.push('/thepit')
50-
}}
51-
userNonRejectAndHasntDoneKyc={
52-
equals(NONE, userKycState) && not(equals(REJECTED, userKycState))
33+
handlePitTourCallbacks={this.handlePitTourCallbacks}
34+
userEligibleForPIT={
35+
(equals(NONE, userKYCState), not(equals(REJECTED, userKYCState)))
5336
}
5437
/>
5538
)
@@ -63,17 +46,15 @@ const mapStateToProps = state => ({
6346
.getOrElse(false),
6447
supportedCoins: selectors.core.walletOptions
6548
.getSupportedCoins(state)
66-
.getOrFail(),
67-
userKycState: selectors.modules.profile.getUserKYCState(state).getOrElse(null)
49+
.getOrFail()
6850
})
6951
const mapDispatchToProps = dispatch => ({
7052
actions: bindActionCreators(actions.components.layoutWallet, dispatch),
7153
analyticsActions: bindActionCreators(actions.analytics, dispatch),
72-
routerActions: bindActionCreators(actions.router, dispatch)
54+
preferencesActions: bindActionCreators(actions.preferences, dispatch)
7355
})
7456

7557
const enhance = compose(
76-
withRouter,
7758
connect(
7859
mapStateToProps,
7960
mapDispatchToProps

packages/blockchain-wallet-v4-frontend/src/layouts/Wallet/MenuLeft/Navigation/model.js

Lines changed: 0 additions & 90 deletions
This file was deleted.

0 commit comments

Comments
 (0)