This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stock Indicator block: Add support for global style (#5525)
* Product title: add support global style #4965 * add specific type * add custom save function * Stock indicator block: add support for global style #4965 Stock indicator block: add support for global style * fix import after merge
- Loading branch information
Showing
6 changed files
with
58 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
assets/js/atomic/blocks/product-elements/stock-indicator/save.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { useBlockProps } from '@wordpress/block-editor'; | ||
import classnames from 'classnames'; | ||
|
||
type Props = { | ||
attributes: Record< string, unknown > & { | ||
className?: string; | ||
}; | ||
}; | ||
|
||
export const Save = ( { attributes }: Props ): JSX.Element => { | ||
return ( | ||
<div | ||
{ ...useBlockProps.save( { | ||
className: classnames( 'is-loading', attributes.className ), | ||
} ) } | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
assets/js/atomic/blocks/product-elements/stock-indicator/supports.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { isFeaturePluginBuild } from '@woocommerce/block-settings'; | ||
|
||
export const supports = { | ||
...( isFeaturePluginBuild() && { | ||
color: { | ||
text: true, | ||
background: false, | ||
link: false, | ||
}, | ||
} ), | ||
typography: { | ||
fontSize: true, | ||
}, | ||
}; |