8
8
__unstableUseCompositeState as useCompositeState ,
9
9
__unstableCompositeItem as CompositeItem ,
10
10
Tooltip ,
11
- __experimentalToggleGroupControl as ToggleGroupControl ,
12
- __experimentalToggleGroupControlOption as ToggleGroupControlOption ,
13
11
} from '@wordpress/components' ;
14
12
import { useInstanceId } from '@wordpress/compose' ;
15
13
import { __ } from '@wordpress/i18n' ;
@@ -20,15 +18,8 @@ import { Icon, symbolFilled } from '@wordpress/icons';
20
18
*/
21
19
import BlockPreview from '../block-preview' ;
22
20
import InserterDraggableBlocks from '../inserter-draggable-blocks' ;
23
- const SYNC_TYPES = {
24
- full : 'fully' ,
25
- unsynced : 'unsynced' ,
26
- } ;
27
- const SYNC_FILTERS = {
28
- all : __ ( 'All' ) ,
29
- [ SYNC_TYPES . full ] : __ ( 'Synced' ) ,
30
- [ SYNC_TYPES . unsynced ] : __ ( 'Standard' ) ,
31
- } ;
21
+ import BlockPatternsSyncFilter from '../block-patterns-sync-filter' ;
22
+
32
23
const WithToolTip = ( { showTooltip, title, children } ) => {
33
24
if ( showTooltip ) {
34
25
return < Tooltip text = { title } > { children } </ Tooltip > ;
@@ -121,7 +112,7 @@ function BlockPattern( {
121
112
>
122
113
< span >
123
114
< Icon
124
- className = "edit-site -patterns__pattern-icon"
115
+ className = "block-editor -patterns__pattern-icon"
125
116
icon = { symbolFilled }
126
117
/>
127
118
</ span >
@@ -162,26 +153,10 @@ function BlockPatternList( {
162
153
aria-label = { label }
163
154
>
164
155
{ category === 'custom' && (
165
- < ToggleGroupControl
166
- className = "edit-site-patterns__sync-status-filter"
167
- hideLabelFromVision
168
- label = { __ ( 'Filter by sync status' ) }
169
- value = { syncFilter }
170
- isBlock
171
- onChange = { ( value ) => setSyncFilter ( value ) }
172
- __nextHasNoMarginBottom
173
- >
174
- { Object . entries ( SYNC_FILTERS ) . map (
175
- ( [ key , optionLabel ] ) => (
176
- < ToggleGroupControlOption
177
- className = "edit-site-patterns__sync-status-filter-option"
178
- key = { key }
179
- value = { key }
180
- label = { optionLabel }
181
- />
182
- )
183
- ) }
184
- </ ToggleGroupControl >
156
+ < BlockPatternsSyncFilter
157
+ syncFilter = { syncFilter }
158
+ setSyncFilter = { setSyncFilter }
159
+ />
185
160
) }
186
161
{ blockPatterns . map ( ( pattern ) => {
187
162
const isShown = shownPatterns . includes ( pattern ) ;
0 commit comments