File tree Expand file tree Collapse file tree 1 file changed +32
-4
lines changed
src/components/Profile/Subscriptions Expand file tree Collapse file tree 1 file changed +32
-4
lines changed Original file line number Diff line number Diff line change @@ -125,9 +125,37 @@ function SubsriptionButton({
125
125
text : t ( 'subscription.contact-support' ) ,
126
126
isComponent : true ,
127
127
component : (
128
- < Button onClick = { manageActionBasedOnLocation } marginTop = "5px" textAlign = "center" userSelect = "none" justifyContent = "center" fontSize = "sm" fontWeight = { 700 } color = "blue.1000" width = "100%" _hover = "none" _active = "none" background = "auto" height = "none" >
129
- { router . pathname === '/profile/[slug]' ? t ( 'subscription.contact-support' ) : t ( 'subscription.manage-subscription' ) }
130
- </ Button >
128
+ < >
129
+ { isPaymentIssue && (
130
+ < Button
131
+ onClick = { ( ) => {
132
+ setSubscriptionProps ( subscription ) ;
133
+ if ( isCancelled ) {
134
+ handleReactivatePlan ( ) ;
135
+ } else {
136
+ onOpenCancelSubscription ( ) ;
137
+ }
138
+ } }
139
+ marginTop = "5px"
140
+ textAlign = "center"
141
+ userSelect = "none"
142
+ justifyContent = "center"
143
+ fontSize = "sm"
144
+ fontWeight = { 700 }
145
+ color = "blue.1000"
146
+ width = "100%"
147
+ _hover = "none"
148
+ _active = "none"
149
+ background = "auto"
150
+ height = "none"
151
+ >
152
+ { isCancelled ? t ( 'subscription.reactivate-subscription' ) : t ( 'subscription.cancel' ) }
153
+ </ Button >
154
+ ) }
155
+ < Button onClick = { manageActionBasedOnLocation } marginTop = "5px" textAlign = "center" userSelect = "none" justifyContent = "center" fontSize = "sm" fontWeight = { 700 } color = "blue.1000" width = "100%" _hover = "none" _active = "none" background = "auto" height = "none" >
156
+ { router . pathname === '/profile/[slug]' ? t ( 'subscription.contact-support' ) : t ( 'subscription.manage-subscription' ) }
157
+ </ Button >
158
+ </ >
131
159
) ,
132
160
} ;
133
161
}
@@ -153,11 +181,11 @@ function SubsriptionButton({
153
181
< Button
154
182
isLoading = { isLoading }
155
183
onClick = { ( ) => {
184
+ setSubscriptionProps ( subscription ) ;
156
185
if ( isPlanFinancingExpired ) handlePlanOffer ( ) ;
157
186
if ( ( [ 'FREE_TRIAL' , 'PAYMENT_ISSUE' ] . includes ( status ) ) || ( [ 'ACTIVE' , 'FULLY_PAID' ] . includes ( status ) && subscription ?. planOffer ?. slug ) ) handlePlanOffer ( ) ;
158
187
if ( [ 'ACTIVE' , 'FULLY_PAID' ] . includes ( status ) && subscription ?. type !== 'plan_financing' && ! subscription ?. planOffer ?. slug ) onOpenCancelSubscription ( ) ;
159
188
if ( [ 'CANCELLED' ] . includes ( status ) ) handleReactivatePlan ( ) ;
160
- setSubscriptionProps ( subscription ) ;
161
189
} }
162
190
color = "blue.default"
163
191
margin = "auto 0 0 0"
You can’t perform that action at this time.
0 commit comments