Skip to content

Commit

Permalink
chore: tracking and copy changes (#500)
Browse files Browse the repository at this point in the history
* chore: tracking and copy changes

* chore: changes
  • Loading branch information
Daniel Belohlavek authored May 16, 2019
1 parent a941fdb commit b49a6fa
Show file tree
Hide file tree
Showing 13 changed files with 87 additions and 9 deletions.
26 changes: 23 additions & 3 deletions src/components/Banners/HomePageBanner/HomePageBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
import * as React from 'react'

import { Responsive } from 'decentraland-ui'
import { T, t } from 'decentraland-dapps/dist/modules/translation/utils'
import { getAnalytics } from 'decentraland-dapps/dist/modules/analytics/utils'
import { Campaign } from 'modules/analytics/campaigns'
import Banner from 'components/Banner'

import { Props } from './HomePageBanner.types'
import './HomePageBanner.css'

export default class HomePageBanner extends React.PureComponent<Props> {
handleHomePageClick = () => {
const analytics = getAnalytics()
analytics.track('HomePage CTA', {
campaign: Campaign.DAPPER
})
}

handleMobilePageClick = () => {
const analytics = getAnalytics()
analytics.track('MobilePage CTA', {
campaign: Campaign.DAPPER
})
}

render() {
const { className } = this.props

Expand All @@ -33,7 +48,7 @@ export default class HomePageBanner extends React.PureComponent<Props> {
values={{
br: <br />,
cta: (
<a href="https://dap.pr/dclinstallp" rel="noopener noreferrer" target="_blank">
<a href="https://dap.pr/dclinstallp" rel="noopener noreferrer" target="_blank" onClick={this.handleHomePageClick}>
{t('banners.dapper_homepage_cta')}
</a>
)
Expand All @@ -50,7 +65,12 @@ export default class HomePageBanner extends React.PureComponent<Props> {
br: <br />,

cta: (
<a href="https://decentraland.org/blog/picture-frames-dapper" rel="noopener noreferrer" target="_blank">
<a
href="https://decentraland.org/blog/picture-frames-dapper"
rel="noopener noreferrer"
target="_blank"
onClick={this.handleMobilePageClick}
>
{t('banners.mobile_dapper_hompage_cta')}
</a>
)
Expand Down
12 changes: 11 additions & 1 deletion src/components/HomePage/PromoBanner/PromoBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
import React from 'react'
import { Button } from 'decentraland-ui'
import { t } from 'decentraland-dapps/dist/modules/translation/utils'
import { getAnalytics } from 'decentraland-dapps/dist/modules/analytics/utils'
import { Campaign } from 'modules/analytics/campaigns'

import { Props } from './PromoBanner.types'

import './PromoBanner.css'

export default class PromoBanner extends React.PureComponent<Props> {
handleCTAClick = () => {
const analytics = getAnalytics()
analytics.track('HomePage Promo CTA', {
campaign: Campaign.DAPPER
})
window.open('https://dap.pr/dclinstallp')
}

render() {
return (
<div className="PromoBanner">
<div className="bg" />
<div className="logo" />
<div className="title">{t('banners.promo_title')}</div>
<div className="subtitle">{t('banners.promo_subtitle')}</div>
<Button className="cta" href="https://dap.pr/dclinstallp" target="_blank" rel="noopener noreferrer" primary>
<Button className="cta" primary onClick={this.handleCTAClick}>
{t('banners.promo_cta')}
</Button>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/SideBar/AssetPackList/AssetPackList.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
padding: 16px 20px;
cursor: pointer;
line-height: 24px;
user-select: none;
}

.AssetPackList .promo .highlight {
Expand Down
6 changes: 6 additions & 0 deletions src/components/SideBar/AssetPackList/AssetPackList.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import React from 'react'
import { T, t } from 'decentraland-dapps/dist/modules/translation/utils'
import { getAnalytics } from 'decentraland-dapps/dist/modules/analytics/utils'
import { Campaign } from 'modules/analytics/campaigns'

import SidebarCard from '../SidebarCard'
import { Props } from './AssetPackList.types'
import './AssetPackList.css'

export default class AssetPackList extends React.PureComponent<Props> {
handlePromoClick = () => {
const analytics = getAnalytics()
analytics.track('Item catalog Dapper CTA', {
campaign: Campaign.DAPPER
})
window.open('https://dap.pr/dclinstallp')
}

Expand Down
8 changes: 8 additions & 0 deletions src/components/SideBar/ItemDrawer/ItemDrawer.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@
overflow-y: auto;
position: relative;
}

.ItemDrawer .disclaimer {
color: rgba(var(--bluish-steel-raw), 0.64);
text-align: center;
width: calc(var(--sidebar-width) - 32px);
display: block;
margin-top: 10px;
}
8 changes: 8 additions & 0 deletions src/components/SideBar/ItemDrawer/ItemDrawer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react'
import { Loader } from 'decentraland-ui'

import { T } from 'decentraland-dapps/dist/modules/translation/utils'
import { COLLECTIBLE_ASSET_PACK_ID } from 'modules/ui/sidebar/utils'
import SidebarHeader from '../SidebarHeader'
import SidebarSearch from '../SidebarSearch'
Expand Down Expand Up @@ -48,12 +49,19 @@ export default class ItemDrawer extends React.PureComponent<Props, State> {
}

render() {
const { selectedAssetPack, isLoadingAssets, isConnected } = this.props
const isViewingCollectibles = selectedAssetPack && selectedAssetPack.id === COLLECTIBLE_ASSET_PACK_ID && isConnected && !isLoadingAssets
return (
<div className="ItemDrawer">
<SidebarHeader />
<SidebarSearch onResetScroll={this.handleResetScroll} />
<div ref={this.setDrawerContainer} className="overflow-container">
{this.renderList()}
{isViewingCollectibles && (
<span className="disclaimer">
<T id={`itemdrawer.collectible_disclaimer`} values={{ br: <br /> }} />
</span>
)}
</div>
</div>
)
Expand Down
3 changes: 3 additions & 0 deletions src/modules/analytics/campaigns.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const Campaign = {
DAPPER: 'dapper'
}
18 changes: 18 additions & 0 deletions src/modules/analytics/sagas.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { takeLatest, select } from 'redux-saga/effects'
import { getAnalytics } from 'decentraland-dapps/dist/modules/analytics/utils'
import { ConnectWalletSuccessAction, CONNECT_WALLET_SUCCESS } from 'decentraland-dapps/dist/modules/wallet/actions'

import { OPEN_EDITOR, OpenEditorAction, TOGGLE_SNAP_TO_GRID, ToggleSnapToGridAction } from 'modules/editor/actions'
import { getCurrentProject, getProject } from 'modules/project/selectors'
Expand Down Expand Up @@ -28,6 +29,7 @@ export function* segmentSaga() {
yield takeLatest(SUBMIT_PROJECT_SUCCESS, handleSubmitProject)
yield takeLatest(TOGGLE_SNAP_TO_GRID, handleToggleSnapToGrid)
yield takeLatest(UPDATE_TRANSFORM, handleUpdateTransfrom)
yield takeLatest(CONNECT_WALLET_SUCCESS, handleConnectWallet)
}

const track = (event: string, params: any) => getAnalytics().track(event, params)
Expand Down Expand Up @@ -91,3 +93,19 @@ function* handleUpdateTransfrom(_: UpdateTransfromAction) {

track('Update item', { projectId: project.id })
}

function handleConnectWallet(action: ConnectWalletSuccessAction) {
const ethereum = (window as any)['ethereum']

let provider = null

if (ethereum) {
if (ethereum.isMetaMask) {
provider = 'metamask'
} else if (ethereum.isDapper) {
provider = 'dapper'
}
}

track('Connect wallet', { address: action.payload.wallet.address, provider })
}
4 changes: 2 additions & 2 deletions src/modules/common/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createStore, compose, applyMiddleware } from 'redux'
import { routerMiddleware } from 'connected-react-router'
import createSagasMiddleware from 'redux-saga'
import { createLogger } from 'redux-logger'
import createHistory from 'history/createBrowserHistory'
import { createBrowserHistory } from 'history'

import { env } from 'decentraland-commons'
import { createStorageMiddleware } from 'decentraland-dapps/dist/modules/storage/middleware'
Expand All @@ -22,7 +22,7 @@ import { rootSaga } from './sagas'
// @ts-ignore: Dev tools
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose

const history = createHistory()
const history = createBrowserHistory()
const rootReducer = createRootReducer(history)

const historyMiddleware = routerMiddleware(history)
Expand Down
7 changes: 4 additions & 3 deletions src/modules/translation/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
"dapper_assetpack_banner": "Get Dapper wallet and a free {cat} for your scene!",
"dapper_homepage": "Place a picture of your CryptoKitty in your scene!{br}Don't have a CryptoKitty? Make a Dapper wallet and get a free {cta}.",
"dapper_homepage_cta": "Purrstige Cat",
"mobile_dapper_homepage": "Learn about our latest feature:{br}{cta}",
"mobile_dapper_hompage_cta": "Picture Frames + Dapper",
"promo_cta": "Install Dapper",
"promo_subtitle": "Complete the look by displaying your CryptoKitty in your scene. Don't have a CryptoKitty? Make a Dapper wallet and get a free, unique Purrstige Cat.",
"promo_title": "Youโ€™re looking Dapper today!",
"mobile_dapper_homepage": "Learn about our latest feature:{br}{cta}",
"mobile_dapper_hompage_cta": "Picture Frames + Dapper"
"promo_title": "Youโ€™re looking Dapper today!"
},
"contest": {
"banner": {
Expand Down Expand Up @@ -113,6 +113,7 @@
"upload_manually": "Upload Manually"
},
"itemdrawer": {
"collectible_disclaimer": "Donโ€™t see all of your crypto-collectibles?{br}We are adding support for more soon!",
"empty_ground": "No Ground",
"no_results": "No results",
"results": "Results",
Expand Down
1 change: 1 addition & 0 deletions src/modules/translation/languages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
"upload_manually": "Sรบbelas manualmente"
},
"itemdrawer": {
"collectible_disclaimer": "ยฟNo ves todos tus coleccionables?{br}ยกAgregaremos mรกs prรณximamente!",
"empty_ground": "Sin piso",
"no_results": "Sin resultados",
"search": "Buscar objetos",
Expand Down
1 change: 1 addition & 0 deletions src/modules/translation/languages/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
"upload_manually": "์ง์ ‘ ์—…๋กœ๋“œ"
},
"itemdrawer": {
"collectible_disclaimer": "๋ณด์œ ํ•˜๊ณ  ๊ณ„์‹  ๋ชจ๋“  ํฌ๋ฆฝํ† -์ฝœ๋ ‰ํ‹ฐ๋ธ”์ด ๋ณด์ด์ง€ ์•Š๋‚˜์š”?{br}๊ณง ์ง€์› ๋‚ด์—ญ์„ ์ถ”๊ฐ€ํ•  ์˜ˆ์ •์ž…๋‹ˆ๋‹ค!",
"empty_ground": "๋•…์ด ์—†์Šต๋‹ˆ๋‹ค",
"no_results": "์•„์ดํ…œ์„ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค",
"search": "์•„์ดํ…œ ๊ฒ€์ƒ‰",
Expand Down
1 change: 1 addition & 0 deletions src/modules/translation/languages/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
"upload_manually": "ๆ‰‹ๅŠจไธŠไผ "
},
"itemdrawer": {
"collectible_disclaimer": "ๆฒก็œ‹ๅˆฐไฝ ๆ‰€ๆœ‰็š„ๅŠ ๅฏ†ๆ”ถ่—ๅ“๏ผŸ{br}ๆˆ‘ไปฌๅพˆๅฟซๅฐฑไผšๅŠ ๅ…ฅๆ”ฏๆŒ๏ผ",
"empty_ground": "ๆœซ่ฎพ็ฝฎๅœฐ้ข",
"no_results": "ๆฒกๆ‰พๅˆฐ",
"search": "ๆœ็ดข",
Expand Down

1 comment on commit b49a6fa

@vercel
Copy link

@vercel vercel bot commented on b49a6fa May 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully aliased the URL https://builder-nevhzuzwwe.now.sh to the following alias.

Please sign in to comment.