@@ -9,6 +9,7 @@ import { Provider } from 'shared/api/helpers'
9
9
import { getNextBillingDate } from 'shared/utils/billing'
10
10
import Avatar from 'ui/Avatar'
11
11
import Button from 'ui/Button'
12
+ import Checkbox from 'ui/Checkbox'
12
13
import Modal from 'ui/Modal'
13
14
14
15
import { PersonalOrgWarning } from '../PersonalOrgWarning'
@@ -31,6 +32,7 @@ const UpdateButton: React.FC<BillingControlsProps> = ({
31
32
} ) => {
32
33
const { provider, owner } = useParams < { provider : Provider ; owner : string } > ( )
33
34
const [ showConfirmationModal , setShowConfirmationModal ] = useState ( false )
35
+ const [ confirmationIsChecked , setConfirmationIsChecked ] = useState ( false )
34
36
const { data : ownerData } = useOwner ( { username : owner } )
35
37
const { data : planData } = usePlanData ( { provider, owner } )
36
38
const { data : accountDetails } = useAccountDetails ( { provider, owner } )
@@ -67,10 +69,7 @@ const UpdateButton: React.FC<BillingControlsProps> = ({
67
69
body = {
68
70
< div className = "flex flex-col gap-4 px-4 py-2" >
69
71
< div className = "inline-flex items-center gap-1" >
70
- By proceeding, you are making the following changes to{ ' ' }
71
- < Avatar user = { ownerData } className = "size-4" />
72
- < span className = "font-bold text-ds-pink-default" > { owner } </ span >
73
- 's plan:
72
+ By proceeding, you are making the following changes to your plan:
74
73
</ div >
75
74
< UpdateBlurb
76
75
currentPlan = { planData ?. plan }
@@ -79,6 +78,24 @@ const UpdateButton: React.FC<BillingControlsProps> = ({
79
78
nextBillingDate = { getNextBillingDate ( accountDetails ) ! }
80
79
/>
81
80
< PersonalOrgWarning />
81
+ < div className = "flex items-center gap-2" >
82
+ < Checkbox
83
+ id = "upgrade-confirmation-checkbox"
84
+ checked = { confirmationIsChecked }
85
+ onClick = { ( ) => setConfirmationIsChecked ( ! confirmationIsChecked ) }
86
+ />
87
+ < label
88
+ className = "flex flex-wrap items-center"
89
+ htmlFor = "upgrade-confirmation-checkbox"
90
+ >
91
+ I accept the changes to
92
+ < div className = "flex items-center gap-1 pl-1" >
93
+ < Avatar user = { ownerData } className = "size-4" border = "dark" />
94
+ < span className = "font-bold" > { owner } </ span >
95
+ </ div >
96
+ 's plan.
97
+ </ label >
98
+ </ div >
82
99
< div className = "flex justify-end gap-2" >
83
100
< Button
84
101
type = "button"
@@ -92,6 +109,7 @@ const UpdateButton: React.FC<BillingControlsProps> = ({
92
109
type = "submit"
93
110
hook = "submit-upgrade"
94
111
variant = "primary"
112
+ disabled = { ! confirmationIsChecked }
95
113
onClick = { ( ) => {
96
114
onSubmit ( )
97
115
setShowConfirmationModal ( false )
0 commit comments