Skip to content

Commit

Permalink
feat(Airdrop): add tour card
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip London committed Nov 21, 2019
1 parent 9b5eb62 commit 25fc5b4
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 17 deletions.
6 changes: 6 additions & 0 deletions packages/blockchain-info-components/src/Buttons/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ const selectColor = (nature, disabled, small) => {
color: 'white',
borderColor: 'white'
}
case 'green':
return {
color: 'white',
backgroundColor: 'green600',
borderColor: 'green600'
}
default:
return {
color: 'gray-6',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,13 @@ export const GENERAL_EVENTS = {
'general',
'wallet_intro_tour',
'step_view_buysell'
]
],
WALLET_INTRO_THE_PIT_VIEWED: [
'general',
'wallet_intro_tour',
'step_view_the_pit'
],
WALLET_INTRO_AIRDROPS: ['general', 'wallet_intro_tour', 'step_view_airdrops']
}

export const ADS_EVENTS = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,26 @@ const Navigation = props => {
</Destination>
</MenuItem>
</SpotlightLinkContainer>
<SpotlightLinkContainer to='/airdrops' activeClassName='active'>
<MenuItem data-e2e='airdropLink'>
<JoyrideSpotlight className='airdrop-tooltip' />
<MenuIcon name='parachute' size='24px' />
<Destination>
<FormattedMessage
id='layouts.wallet.menuleft.navigation.airdrops'
defaultMessage='Airdrops'
/>
</Destination>
<NewCartridge>
<Text color='orange' size='12' weight={500} uppercase>
<FormattedMessage
id='layouts.wallet.menuleft.navigation.transactions.new'
defaultMessage='New'
/>
</Text>
</NewCartridge>
</MenuItem>
</SpotlightLinkContainer>
<LinkContainer to='/lockbox' activeClassName='active'>
<MenuItem data-e2e='lockboxLink'>
<MenuIcon
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react'

const Airdrops = () => {
return <div>Airdrop Page</div>
}

export default Airdrops
84 changes: 68 additions & 16 deletions packages/blockchain-wallet-v4-frontend/src/scenes/Home/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const { GENERAL_EVENTS } = model.analytics

const TourTooltipComponent = ({
analyticsActions,
routerActions,
index,
isLastStep,
primaryProps,
Expand Down Expand Up @@ -58,12 +59,20 @@ const TourTooltipComponent = ({
analyticsActions.logEvent(GENERAL_EVENTS.WALLET_INTRO_BUYSELL_VIEWED)
break
case 5:
setFooterButtonDataE2e('closeWalletTour')
setFooterButtonDataE2e('showWalletTourAirdrops')
setTourTooltipDataE2e('walletTourThePit')
analyticsActions.logEvent(GENERAL_EVENTS.WALLET_INTRO_THE_PIT_VIEWED)
break
case 6:
setFooterButtonDataE2e('closeWalletTour')
setTourTooltipDataE2e('walletTourAirdrops')
analyticsActions.logEvent(GENERAL_EVENTS.WALLET_INTRO_AIRDROPS)
break
}
}, [index])

const isAirdropStep = index === 6

return (
<TooltipBody {...tooltipProps} data-e2e={tourTooltipDataE2e}>
<CloseTourIcon
Expand All @@ -76,20 +85,40 @@ const TourTooltipComponent = ({
/>
{step.content && <TooltipContent>{step.content}</TooltipContent>}
<TooltipFooter isLastStep={isLastStep}>
<Button
data-e2e={footerButtonDataE2e}
width='110px'
height='48px'
nature='primary'
fullwidth
{...primaryProps}
>
{isLastStep ? (
<FormattedMessage id='wallet.tour.finish' defaultMessage='Close' />
) : (
<FormattedMessage id='wallet.tour.next' defaultMessage='Next' />
)}
</Button>
{isAirdropStep ? (
<Button
data-e2e={footerButtonDataE2e}
width='110px'
height='48px'
nature='green'
fullwidth
{...primaryProps}
onClick={() => routerActions.push('/airdrops')}
>
<FormattedMessage
id='wallet.tour.checkitout'
defaultMessage='Check It Out'
/>
</Button>
) : (
<Button
data-e2e={footerButtonDataE2e}
width='110px'
height='48px'
nature='primary'
fullwidth
{...primaryProps}
>
{isLastStep ? (
<FormattedMessage
id='wallet.tour.finish'
defaultMessage='Close'
/>
) : (
<FormattedMessage id='wallet.tour.next' defaultMessage='Next' />
)}
</Button>
)}
</TooltipFooter>
</TooltipBody>
)
Expand Down Expand Up @@ -227,11 +256,34 @@ export const TOUR_STEPS = [
),
disableBeacon: true,
placement: 'right'
},
{
target: '.airdrop-tooltip',
content: (
<>
<StepIcon name='parachute' size='56px' color='green600' />
<StepTitle size='20px' weight={600}>
<FormattedMessage
id='the.airdrop.tooltip.title'
defaultMessage='Our Latest Airdrop is Here!'
/>
</StepTitle>
<StepContent color='grey600' size='14px' weight={500}>
<FormattedMessage
id='wallettour.airdrop.tooltip.stx'
defaultMessage='Our latest airdrop with Blockstack is here. Secure your free Stacks (STX) today.'
/>
</StepContent>
</>
),
disableBeacon: true,
placement: 'right'
}
]

const mapDispatchToProps = dispatch => ({
analyticsActions: bindActionCreators(actions.analytics, dispatch)
analyticsActions: bindActionCreators(actions.analytics, dispatch),
routerActions: bindActionCreators(actions.router, dispatch)
})

export const TourTooltip = connect(
Expand Down
2 changes: 2 additions & 0 deletions packages/blockchain-wallet-v4-frontend/src/scenes/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { PersistGate } from 'redux-persist/integration/react'
import { Redirect, Switch } from 'react-router-dom'
import { selectors } from 'data'
import Addresses from './Settings/Addresses'
import Airdrops from './Airdrops'
import AnalyticsTracker from 'providers/AnalyticsTracker'
import AuthorizeLogin from './AuthorizeLogin'
import BuySell from './BuySell'
Expand Down Expand Up @@ -116,6 +117,7 @@ class App extends React.PureComponent {
/>
<WalletLayout path='/swap' component={Exchange} exact />
<WalletLayout path='/thepit' component={ThePit} />
<WalletLayout path='/airdrops' component={Airdrops} />
<WalletLayout
path='/security-center'
component={SecurityCenter}
Expand Down

0 comments on commit 25fc5b4

Please sign in to comment.