-
Notifications
You must be signed in to change notification settings - Fork 219
Convert filter blocks to inner blocks #6978
Changes from 51 commits
0580f81
6ea437e
a81be07
8b6cb7c
5a52b47
6593c13
b95a157
a88647f
225c0fa
4c6f1f0
49236d8
37e78a8
b5e039e
b2754c7
82889ff
3ba7237
3d02766
83b7fee
00e94f1
e423340
c3b9c67
e14fe84
bb6973a
42ac2b4
1cc05c6
0eb484c
deedc4a
7e6b2ea
d1b4512
311b512
0d17886
0827141
69cea5b
6731264
81bbadb
4e42ac4
d5ae52b
c0984ac
ce3ed78
5305611
29542e1
a903151
e1f0f33
b3d4d56
a44ad73
e1a9901
959c8b5
5bb547a
ddfc5d7
ef0b035
a44513a
4e41b0a
f0b9ebc
dd70a77
941f1af
2a9d2ee
b538432
6a1e87d
4845321
e861133
2660784
2e7344c
4686e91
6f49f57
c2c25c9
4e91226
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { useColorProps } from '@woocommerce/base-hooks'; | ||
import { isString } from '@woocommerce/types'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import Block from './block'; | ||
import { parseAttributes } from './utils'; | ||
|
||
const BlockWrapper = ( props: Record< string, unknown > ) => { | ||
const colorProps = useColorProps( props ); | ||
|
||
return ( | ||
<div | ||
className={ isString( props.className ) ? props.className : '' } | ||
style={ { ...colorProps.style } } | ||
> | ||
<Block isEditor={ false } attributes={ parseAttributes( props ) } /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default BlockWrapper; | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
{ | ||
"name": "woocommerce/active-filters", | ||
"version": "1.0.0", | ||
"title": "Active Product Filters", | ||
"title": "Active Product Filter Controls", | ||
"description": "Display the currently active product filters.", | ||
"category": "woocommerce", | ||
"keywords": [ "WooCommerce" ], | ||
"supports": { | ||
"html": false, | ||
"multiple": false, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're losing the ability to limit the number of Active Filters, Price Filter, and Stock Filter blocks on a page. |
||
"inserter": false, | ||
"color": { | ||
"text": true, | ||
"background": false | ||
} | ||
}, | ||
"lock": false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to confirm my assumption: We set the lock status to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're disabling the When users upgrade or add the new filter block, we lock the We can skip disabling There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
}, | ||
"attributes": { | ||
"displayStyle": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { useColorProps } from '@woocommerce/base-hooks'; | ||
import { isString } from '@woocommerce/types'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import Block from './block'; | ||
import { parseAttributes } from './utils'; | ||
|
||
const BlockWrapper = ( props: Record< string, unknown > ) => { | ||
const colorProps = useColorProps( props ); | ||
|
||
return ( | ||
<div | ||
className={ isString( props.className ) ? props.className : '' } | ||
style={ { ...colorProps.style } } | ||
> | ||
<Block isEditor={ false } attributes={ parseAttributes( props ) } /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default BlockWrapper; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We decide to avoid default export (pdCMQf-sZ-p2) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need default export here for lazy import in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file and wrapper files of other filter blocks are identical, so there is room for improvement, refactor here.