@@ -11,17 +11,15 @@ import { dateI18n } from '@wordpress/date';
11
11
import { createInterpolateElement } from '@wordpress/element' ;
12
12
import { __ , sprintf } from '@wordpress/i18n' ;
13
13
import { sitePHPVersionQuery , siteCurrentPlanQuery } from '../../app/queries' ;
14
- import { getBlurredStyles } from '../../utils/blurred-styles ' ;
14
+ import { getIsBlurredProps } from '../../utils/is-blurred ' ;
15
15
import { getSiteStatusLabel } from '../../utils/site-status' ;
16
16
import { getFormattedWordPressVersion } from '../../utils/wp-version' ;
17
17
import SitePreview from '../site-preview' ;
18
18
import type { Site } from '../../data/types' ;
19
19
20
20
function PHPVersion ( { siteSlug } : { siteSlug : string } ) {
21
21
return (
22
- useQuery ( sitePHPVersionQuery ( siteSlug ) ) . data ?? (
23
- < span style = { getBlurredStyles ( ) } > X.Y</ span >
24
- )
22
+ useQuery ( sitePHPVersionQuery ( siteSlug ) ) . data ?? < span { ...getIsBlurredProps ( ) } > X.Y</ span >
25
23
) ;
26
24
}
27
25
@@ -124,30 +122,29 @@ function PlanDetails( { site }: { site: Site } ) {
124
122
< FieldTitle > { __ ( 'Plan' ) } </ FieldTitle >
125
123
{ product_name_short && < Text > { product_name_short } </ Text > }
126
124
{ isFree ? (
127
- < Text > { __ ( 'No expiration date.' ) } </ Text >
125
+ < >
126
+ < Text > { __ ( 'No expiration date.' ) } </ Text >
127
+ < Button href = { `/plans/${ site . slug } ` } variant = "link" >
128
+ { __ ( 'Upgrade' ) }
129
+ </ Button >
130
+ </ >
128
131
) : (
129
- // Show a blurred time while we wait for the current plan.
130
- < Text style = { currentPlan ? undefined : getBlurredStyles ( ) } >
131
- { getPlanExpirationMessage (
132
- currentPlan ? currentPlan . expiry : new Date ( ) . toISOString ( )
133
- ) }
134
- </ Text >
135
- ) }
136
- { isFree ? (
137
- < Button href = { `/plans/${ site . slug } ` } variant = "link" >
138
- { __ ( 'Upgrade' ) }
139
- </ Button >
140
- ) : (
141
- < Button
142
- // Show a blurred button while we wait for the plan ID.
143
- // @ts -expect-error inert is not typed
144
- inert = { currentPlan ? undefined : 'true' }
145
- style = { currentPlan ? undefined : getBlurredStyles ( ) }
146
- href = { currentPlan ? `/purchases/subscriptions/${ site . slug } /${ currentPlan . id } ` : '' }
147
- variant = "link"
148
- >
149
- { __ ( 'Manage subscription' ) }
150
- </ Button >
132
+ < >
133
+ < Text { ...getIsBlurredProps ( { enabled : ! currentPlan } ) } >
134
+ { getPlanExpirationMessage (
135
+ currentPlan ? currentPlan . expiry : new Date ( ) . toISOString ( )
136
+ ) }
137
+ </ Text >
138
+ < Button
139
+ { ...getIsBlurredProps ( { enabled : ! currentPlan } ) }
140
+ href = {
141
+ currentPlan ? `/purchases/subscriptions/${ site . slug } /${ currentPlan . id } ` : ''
142
+ }
143
+ variant = "link"
144
+ >
145
+ { __ ( 'Manage subscription' ) }
146
+ </ Button >
147
+ </ >
151
148
) }
152
149
</ VStack >
153
150
) ;
0 commit comments