From e3fa6783035548e060ba8afcb2b5faede54678ec Mon Sep 17 00:00:00 2001 From: Glen Davies Date: Thu, 29 Jun 2023 11:41:38 +1200 Subject: [PATCH] Remove ability for user to toggle sync status after pattern creation --- .../src/components/post-sync-status/index.js | 29 ++++--------------- .../components/post-sync-status/style.scss | 4 +-- 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/packages/editor/src/components/post-sync-status/index.js b/packages/editor/src/components/post-sync-status/index.js index 392d33563ef78..c384fd234c7a3 100644 --- a/packages/editor/src/components/post-sync-status/index.js +++ b/packages/editor/src/components/post-sync-status/index.js @@ -1,9 +1,9 @@ /** * WordPress dependencies */ -import { useSelect, useDispatch } from '@wordpress/data'; +import { useSelect } from '@wordpress/data'; import { __ } from '@wordpress/i18n'; -import { ToggleControl, PanelRow } from '@wordpress/components'; +import { PanelRow } from '@wordpress/components'; /** * Internal dependencies @@ -11,7 +11,6 @@ import { ToggleControl, PanelRow } from '@wordpress/components'; import { store as editorStore } from '../../store'; export default function PostSyncStatus() { - const { editPost } = useDispatch( editorStore ); const { meta, postType } = useSelect( ( select ) => { const { getEditedPostAttribute } = select( editorStore ); return { @@ -22,31 +21,15 @@ export default function PostSyncStatus() { if ( postType !== 'wp_block' ) { return null; } - const onUpdateSync = ( syncStatus ) => - editPost( { - meta: { - ...meta, - sync_status: syncStatus === 'unsynced' ? syncStatus : null, - }, - } ); const syncStatus = meta?.sync_status; const isFullySynced = ! syncStatus; return ( - { __( 'Syncing' ) } - { - onUpdateSync( - syncStatus === 'unsynced' ? 'fully' : 'unsynced' - ); - } } - /> + { __( 'Sync status' ) } +
+ { isFullySynced ? __( 'Fully synced' ) : __( 'Not synced' ) } +
); } diff --git a/packages/editor/src/components/post-sync-status/style.scss b/packages/editor/src/components/post-sync-status/style.scss index 385577b3334d8..7f81a327443ee 100644 --- a/packages/editor/src/components/post-sync-status/style.scss +++ b/packages/editor/src/components/post-sync-status/style.scss @@ -9,8 +9,8 @@ flex-shrink: 0; } - .components-base-control { + > div { // Match padding on tertiary buttons for alignment. - padding-left: $grid-unit-15 * 0.5; + padding-left: $grid-unit-15; } }