1- import { check , Icon } from '@wordpress/icons' ;
1+ import { check , cloudUpload , Icon } from '@wordpress/icons' ;
22import { useI18n } from '@wordpress/react-i18n' ;
33import { PropsWithChildren , useEffect , useState } from 'react' ;
44import { ArrowIcon } from 'src/components/arrow-icon' ;
@@ -7,6 +7,7 @@ import offlineIcon from 'src/components/offline-icon';
77import { Tooltip } from 'src/components/tooltip' ;
88import { useSyncSites } from 'src/hooks/sync-sites' ;
99import { useAuth } from 'src/hooks/use-auth' ;
10+ import { useFeatureFlags } from 'src/hooks/use-feature-flags' ;
1011import { useOffline } from 'src/hooks/use-offline' ;
1112import { getIpcApi } from 'src/lib/get-ipc-api' ;
1213import { ConnectButton } from 'src/modules/sync/components/connect-button' ;
@@ -134,6 +135,7 @@ export function ContentTabSync( { selectedSite }: { selectedSite: SiteDetails }
134135 const { connectSite, disconnectSite } = useConnectedSitesOperations ( ) ;
135136 const { pushSite, pullSite, isAnySitePulling, isAnySitePushing } = useSyncSites ( ) ;
136137 const isAnySiteSyncing = isAnySitePulling || isAnySitePushing ;
138+ const { streamlineOnboarding } = useFeatureFlags ( ) ;
137139
138140 const [ selectedRemoteSite , setSelectedRemoteSite ] = useState < SyncSite | null > ( null ) ;
139141 const [ pendingModalMode , setPendingModalMode ] = useState < 'push' | 'pull' | null > ( null ) ;
@@ -226,43 +228,55 @@ export function ContentTabSync( { selectedSite }: { selectedSite: SiteDetails }
226228 </ div >
227229 ) : (
228230 < SiteSyncDescription >
229- < div className = "mt-8 flex flex-wrap gap-4" >
230- < ConnectButton
231- variant = "primary"
232- connectSite = { handleLaunchSite }
233- disabled = { isAnySiteSyncing || pendingModalMode !== null }
234- isBusy = { pendingModalMode === 'push' }
235- tooltipText = {
236- pendingModalMode === 'pull'
237- ? __ ( 'Please wait for the current operation to finish.' )
238- : isAnySiteSyncing
239- ? __ (
240- 'Another site is syncing. Please wait for the sync to finish before you publish your site.'
241- )
242- : __ ( 'Publishing your site requires an internet connection.' )
243- }
244- >
245- { __ ( 'Publish site' ) }
246- </ ConnectButton >
247- < ConnectButton
248- variant = "secondary"
249- connectSite = { handleImportSite }
250- className = { isAnySiteSyncing ? '' : '!text-a8c-blue-50 !shadow-a8c-blue-50' }
251- disabled = { isAnySiteSyncing || pendingModalMode !== null }
252- isBusy = { pendingModalMode === 'pull' }
253- tooltipText = {
254- pendingModalMode === 'push'
255- ? __ ( 'Please wait for the current operation to finish.' )
256- : isAnySiteSyncing
257- ? __ (
258- 'Another site is syncing. Please wait for the sync to finish before you pull a site.'
259- )
260- : __ ( 'Importing a remote site requires an internet connection.' )
261- }
262- >
263- { __ ( 'Pull site' ) }
264- </ ConnectButton >
265- </ div >
231+ { streamlineOnboarding ? (
232+ < div className = "mt-8 flex flex-wrap gap-4" >
233+ < ConnectButton
234+ variant = "primary"
235+ icon = { cloudUpload }
236+ connectSite = { handleLaunchSite }
237+ disabled = { isAnySiteSyncing || pendingModalMode !== null }
238+ isBusy = { pendingModalMode === 'push' }
239+ tooltipText = {
240+ pendingModalMode === 'pull'
241+ ? __ ( 'Please wait for the current operation to finish.' )
242+ : isAnySiteSyncing
243+ ? __ (
244+ 'Another site is syncing. Please wait for the sync to finish before you publish your site.'
245+ )
246+ : __ ( 'Publishing your site requires an internet connection.' )
247+ }
248+ >
249+ { __ ( 'Publish site' ) }
250+ </ ConnectButton >
251+ < ConnectButton
252+ variant = "secondary"
253+ connectSite = { handleImportSite }
254+ className = { isAnySiteSyncing ? '' : '!text-a8c-blue-50 !shadow-a8c-blue-50' }
255+ disabled = { isAnySiteSyncing || pendingModalMode !== null }
256+ isBusy = { pendingModalMode === 'pull' }
257+ tooltipText = {
258+ pendingModalMode === 'push'
259+ ? __ ( 'Please wait for the current operation to finish.' )
260+ : isAnySiteSyncing
261+ ? __ (
262+ 'Another site is syncing. Please wait for the sync to finish before you pull a site.'
263+ )
264+ : __ ( 'Importing a remote site requires an internet connection.' )
265+ }
266+ >
267+ { __ ( 'Pull site' ) }
268+ </ ConnectButton >
269+ </ div >
270+ ) : (
271+ < div className = "mt-8" >
272+ < ConnectButton
273+ variant = "primary"
274+ connectSite = { ( ) => dispatch ( connectedSitesActions . openModal ( 'connect' ) ) }
275+ >
276+ { __ ( 'Connect site' ) }
277+ </ ConnectButton >
278+ </ div >
279+ ) }
266280 </ SiteSyncDescription >
267281 ) }
268282
0 commit comments