1+ // Libraries
12import React , { FC } from 'react'
3+ import { useSelector } from 'react-redux'
24import {
35 Panel ,
46 ComponentSize ,
@@ -12,73 +14,88 @@ import {
1214 Button ,
1315} from '@influxdata/clockface'
1416import { useHistory } from 'react-router-dom'
17+
18+ // Components
1519import CloudUpgradeButton from 'src/shared/components/CloudUpgradeButton'
20+ import { GoogleOptimizeExperiment } from 'src/cloud/components/experiments/GoogleOptimizeExperiment'
21+
22+ // Utils
23+ import { shouldGetCredit250Experience } from 'src/me/selectors'
1624import { isFlagEnabled } from 'src/shared/utils/featureFlag'
1725import { event } from 'src/cloud/utils/reporting'
18- import { GoogleOptimizeExperiment } from 'src/cloud/components/experiments/GoogleOptimizeExperiment'
1926import { getDataLayerIdentity } from 'src/cloud/utils/experiments'
27+
28+ // Constants
2029import { CREDIT_250_EXPERIMENT_ID } from 'src/shared/constants'
2130
2231const CARDINALITY_LIMIT = 1_000_000
2332
2433export const Credit250PAYGConversion : FC = ( ) => {
34+ const isCredit250ExperienceActive = useSelector ( shouldGetCredit250Experience )
35+
36+ const credit250Experience = (
37+ < Grid className = "credit-250-conversion-panel" key = "1" >
38+ < Grid . Column
39+ className = "credit-250-conversion-panel--message"
40+ widthSM = { Columns . Four }
41+ >
42+ < Heading
43+ className = "credit-250-conversion-panel--header"
44+ element = { HeadingElement . H3 }
45+ weight = { FontWeight . Bold }
46+ >
47+ Get free $250 credit
48+ </ Heading >
49+ < Heading
50+ className = "credit-250-conversion-panel--header"
51+ element = { HeadingElement . H5 }
52+ weight = { FontWeight . Regular }
53+ >
54+ Credit applied to first 30 days of usage
55+ </ Heading >
56+ < CloudUpgradeButton
57+ className = "credit-250-conversion-upgrade--button"
58+ metric = { ( ) => {
59+ const identity = getDataLayerIdentity ( )
60+ event ( `billing.conversion.payg.credit-250.upgrade` , {
61+ location : 'billing' ,
62+ ...identity ,
63+ experimentId : CREDIT_250_EXPERIMENT_ID ,
64+ experimentVariantId : isCredit250ExperienceActive ? '2' : '1' ,
65+ } )
66+ } }
67+ showPromoMessage = { false }
68+ size = { ComponentSize . Large }
69+ />
70+ </ Grid . Column >
71+ < Grid . Column widthSM = { Columns . Eight } >
72+ < div className = "conversion-panel--list" >
73+ < ul className = "credit-250-conversion-panel--benefits" >
74+ < li > Unlimited buckets to store your data</ li >
75+ < li > Unlimited storage retention</ li >
76+ < li > Unlimited dashboards</ li >
77+ < li > Unlimited tasks</ li >
78+ < li > Unlimited alert checks and notification rules</ li >
79+ < li > HTTP and PagerDuty notifications</ li >
80+ < li >
81+ Up to { Intl . NumberFormat ( ) . format ( CARDINALITY_LIMIT ) } series
82+ cardinality
83+ </ li >
84+ </ ul >
85+ </ div >
86+ </ Grid . Column >
87+ </ Grid >
88+ )
89+
2590 if ( isFlagEnabled ( 'credit250Experiment' ) ) {
91+ if ( isCredit250ExperienceActive ) {
92+ return credit250Experience
93+ }
94+
2695 return (
2796 < GoogleOptimizeExperiment
2897 experimentID = { CREDIT_250_EXPERIMENT_ID }
29- variants = { [
30- < Grid className = "credit-250-conversion-panel" key = "1" >
31- < Grid . Column
32- className = "credit-250-conversion-panel--message"
33- widthSM = { Columns . Four }
34- >
35- < Heading
36- className = "credit-250-conversion-panel--header"
37- element = { HeadingElement . H3 }
38- weight = { FontWeight . Bold }
39- >
40- Get free $250 credit
41- </ Heading >
42- < Heading
43- className = "credit-250-conversion-panel--header"
44- element = { HeadingElement . H5 }
45- weight = { FontWeight . Regular }
46- >
47- Credit applied to first 30 days of usage
48- </ Heading >
49- < CloudUpgradeButton
50- className = "credit-250-conversion-upgrade--button"
51- metric = { ( ) => {
52- const identity = getDataLayerIdentity ( )
53- event ( `billing.conversion.payg.credit-250.upgrade` , {
54- location : 'billing' ,
55- ...identity ,
56- experimentId : CREDIT_250_EXPERIMENT_ID ,
57- experimentVariantId : '1' ,
58- } )
59- } }
60- showPromoMessage = { false }
61- size = { ComponentSize . Large }
62- />
63- </ Grid . Column >
64- < Grid . Column widthSM = { Columns . Eight } >
65- < div className = "conversion-panel--list" >
66- < ul className = "credit-250-conversion-panel--benefits" >
67- < li > Unlimited buckets to store your data</ li >
68- < li > Unlimited storage retention</ li >
69- < li > Unlimited dashboards</ li >
70- < li > Unlimited tasks</ li >
71- < li > Unlimited alert checks and notification rules</ li >
72- < li > HTTP and PagerDuty notifications</ li >
73- < li >
74- Up to { Intl . NumberFormat ( ) . format ( CARDINALITY_LIMIT ) } series
75- cardinality
76- </ li >
77- </ ul >
78- </ div >
79- </ Grid . Column >
80- </ Grid > ,
81- ] }
98+ variants = { [ credit250Experience ] }
8299 />
83100 )
84101 }
0 commit comments