-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathPlanUpgradePro.jsx
More file actions
92 lines (82 loc) · 2.66 KB
/
PlanUpgradePro.jsx
File metadata and controls
92 lines (82 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import PropType from 'prop-types'
import { planPropType } from 'services/account/propTypes'
import BenefitList from 'shared/plan/BenefitList'
import { findProPlans, findSentryPlans } from 'shared/utils/billing'
import { SENTRY_PRICE } from 'shared/utils/upgradeForm'
import ActionsBilling from '../../shared/ActionsBilling/ActionsBilling'
import ProPlanSubheading from '../ProPlanSubheading'
function PlanDetails({
isSentryUpgrade,
sentryMonthlyUnitPrice,
proMonthlyUnitPrice,
}) {
if (isSentryUpgrade) {
return (
<div className="text-xs">
<p className="font-semibold">
<span className="text-2xl">${SENTRY_PRICE}</span>
/month
</p>
<p className="text-ds-gray-senary">
over 5 users is ${sentryMonthlyUnitPrice} per user/month, billed
monthly
</p>
</div>
)
}
return (
<div className="text-xs">
<p className="font-semibold">
<span className="text-2xl">${proMonthlyUnitPrice}</span> per user/month
</p>
<p className="text-ds-gray-senary">billed monthly</p>
</div>
)
}
PlanDetails.propTypes = {
isSentryUpgrade: PropType.bool.isRequired,
sentryMonthlyUnitPrice: PropType.number,
proMonthlyUnitPrice: PropType.number,
}
function PlanUpgradePro({ isSentryUpgrade, plans }) {
const { proPlanMonth } = findProPlans({ plans })
const { sentryPlanMonth } = findSentryPlans({ plans })
const upgradeToPlan = isSentryUpgrade ? sentryPlanMonth : proPlanMonth
return (
<div className="flex flex-col border">
<div className="flex justify-between p-4">
<div>
<h2 className="font-semibold">{upgradeToPlan?.marketingName} plan</h2>
<ProPlanSubheading />
</div>
<ActionsBilling />
</div>
<hr />
<div className="grid gap-4 p-4 sm:grid-cols-2 sm:gap-0">
<div className="flex flex-col gap-2">
<p className="text-xs font-semibold">Includes</p>
<BenefitList
benefits={upgradeToPlan?.benefits}
iconName="check"
iconColor="text-ds-pink-default"
/>
</div>
<div className="flex flex-col">
<p className="mb-2 border-t pt-2 text-xs font-semibold sm:border-0 sm:p-0">
Pricing
</p>
<PlanDetails
isSentryUpgrade={isSentryUpgrade}
sentryMonthlyUnitPrice={sentryPlanMonth?.baseUnitPrice}
proMonthlyUnitPrice={proPlanMonth?.baseUnitPrice}
/>
</div>
</div>
</div>
)
}
PlanUpgradePro.propTypes = {
isSentryUpgrade: PropType.bool.isRequired,
plans: PropType.arrayOf(planPropType).isRequired,
}
export default PlanUpgradePro