Skip to content

Commit efa2f78

Browse files
authored
feat: add credit banner for experiment (#4520)
1 parent 6e6eb42 commit efa2f78

File tree

2 files changed

+50
-3
lines changed

2 files changed

+50
-3
lines changed

src/checkout/CheckoutForm.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,21 @@
2121
max-height: 140px;
2222
}
2323

24+
.checkout-credit-250--banner {
25+
font-size: 18px;
26+
display: flex;
27+
flex-direction: row;
28+
justify-content: center;
29+
}
30+
31+
.checkout-credit-250--banner-icon {
32+
padding-top: 1px;
33+
}
34+
35+
.checkout-credit-250--banner-message {
36+
margin-left: $cf-marg-b;
37+
}
38+
2439
.checkout-form--banner {
2540
background: linear-gradient(
2641
45deg,

src/checkout/CheckoutForm.tsx

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
import React, {FC, useContext} from 'react'
22
import {
3-
AppWrapper,
43
AlignItems,
4+
AppWrapper,
5+
BannerPanel,
56
Bullet,
67
ButtonType,
8+
CTAButton,
79
ComponentColor,
810
ComponentSize,
911
ComponentStatus,
10-
CTAButton,
1112
FlexBox,
1213
Form,
1314
FunnelPage,
1415
Gradients,
1516
Heading,
1617
HeadingElement,
18+
Icon,
19+
IconFont,
20+
InfluxColors,
1721
JustifyContent,
1822
Panel,
1923
} from '@influxdata/clockface'
@@ -35,9 +39,13 @@ import {CheckoutContext} from 'src/checkout/context/checkout'
3539
import {event} from 'src/cloud/utils/reporting'
3640

3741
// Constants
38-
import {PAYG_CREDIT_EXPERIMENT_ID} from 'src/shared/constants'
42+
import {
43+
CREDIT_250_EXPERIMENT_ID,
44+
PAYG_CREDIT_EXPERIMENT_ID,
45+
} from 'src/shared/constants'
3946

4047
// Utils
48+
import {isFlagEnabled} from 'src/shared/utils/featureFlag'
4149

4250
const CheckoutForm: FC = () => {
4351
const {
@@ -74,6 +82,30 @@ const CheckoutForm: FC = () => {
7482
>
7583
Upgrade to Usage-Based Account
7684
</h1>
85+
{isFlagEnabled('credit250Experiment') && (
86+
<GoogleOptimizeExperiment
87+
experimentID={CREDIT_250_EXPERIMENT_ID}
88+
variants={[
89+
<BannerPanel
90+
key="credit-250-banner"
91+
gradient={Gradients.Info}
92+
size={ComponentSize.Small}
93+
textColor={InfluxColors.White}
94+
>
95+
<span className="checkout-credit-250--banner">
96+
<Icon
97+
className="checkout-credit-250--banner-icon"
98+
glyph={IconFont.Star}
99+
/>
100+
<span className="checkout-credit-250--banner-message">
101+
Get free $250 credit for the first 30 days once you
102+
upgrade
103+
</span>
104+
</span>
105+
</BannerPanel>,
106+
]}
107+
/>
108+
)}
77109
<Panel
78110
gradient={Gradients.BeijingEclipse}
79111
className="checkout--panel"

0 commit comments

Comments
 (0)