Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
address code review
Browse files Browse the repository at this point in the history
  • Loading branch information
dinhtungdu committed Nov 16, 2021
1 parent 226a04a commit cd853d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions assets/js/blocks/cart-checkout/mini-cart/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import QuantityBadge from './quantity-badge';
interface Attributes {
isInitiallyOpen?: boolean;
transparentButton: boolean;
colorClassNames?: string;
backgroundColor?: string;
textColor?: string;
style?: Record< string, Record< string, string > >;
}

Expand All @@ -36,14 +37,15 @@ const MiniCartBlock = ( {
}: Props ): ReactElement => {
const { transparentButton, backgroundColor, textColor, style } = attributes;
const blockProps = useBlockProps( {
className: classnames(
'wc-block-mini-cart wp-block-woocommerce-mini-cart',
{
'is-transparent': transparentButton,
}
),
className: classnames( 'wc-block-mini-cart', {
'is-transparent': transparentButton,
} ),
} );

/**
* @todo Replace `getColorClassName` and manual style manipulation with
* `useColorProps` once the hook is no longer experimental.
*/
const backgroundClass = getColorClassName(
'background-color',
backgroundColor
Expand Down
2 changes: 1 addition & 1 deletion assets/js/blocks/cart-checkout/mini-cart/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
justify-content: flex-end;

&.is-transparent .wc-block-mini-cart__button {
background: transparent !important;
background-color: transparent !important;
}
}

Expand Down

0 comments on commit cd853d4

Please sign in to comment.