@@ -24,23 +24,19 @@ import {
2424} from '@wordpress/block-editor' ;
2525import { ToolbarButton , ToolbarGroup } from '@wordpress/components' ;
2626
27- function MyAccountButtonEdit ( { attributes, setAttributes, className : wrapperClassName } ) {
27+ function MyAccountButtonEdit ( { attributes, setAttributes } ) {
2828 const { signedInLabel, signedOutLabel, style, className : blockClassName } = attributes ;
2929 const borderProps = useBorderProps ( attributes ) ;
3030 const colorProps = useColorProps ( attributes ) ;
3131 const spacingProps = useSpacingProps ( attributes ) ;
32-
33- // Block style comes from the Styles panel (wrapper) or saved className.
34- const blockWrapperProps = useBlockProps ( ) ;
35- const className = blockWrapperProps ?. className ?? wrapperClassName ?? blockClassName ?? '' ;
36- const isIconOnly = className . includes ( 'is-style-icon-only' ) ;
37- const isTextOnly = className . includes ( 'is-style-text-only' ) ;
32+ const isIconOnly = ( blockClassName || '' ) . includes ( 'is-style-icon-only' ) ;
33+ const isTextOnly = ( blockClassName || '' ) . includes ( 'is-style-text-only' ) ;
3834 const isLabelVisible = ! isIconOnly ;
3935 const isIconVisible = ! isTextOnly ;
4036
4137 const blockProps = useBlockProps ( {
4238 className : classnames (
43- className ,
39+ blockClassName ,
4440 'wp-block-button__link' ,
4541 'newspack-reader__account-link' ,
4642 'wp-block-newspack-my-account-button__link' ,
0 commit comments