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.
Mini-cart: add the option to change the style between 'Outline' and '…
…Fill' in all the buttons (#8835) * Render inner buttons on the frontend * Add deprecation to the buttons * Fix lint and inline save * Remove commented out code and fix condition * Change migrate condition * Add styles outline and fill styles to cart and checkout buttons * Add fill and outline styles to the start shopping button * Refactor variants * Remove imports * Add classname default value --------- Co-authored-by: Manish Menaria <[email protected]>
- Loading branch information
1 parent
322a671
commit 771eb44
Showing
10 changed files
with
69 additions
and
4 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
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
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
16 changes: 16 additions & 0 deletions
16
assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/utils.ts
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,16 @@ | ||
type Variant = 'text' | 'contained' | 'outlined'; | ||
|
||
export const getVariant = ( | ||
className = '', | ||
defaultVariant: Variant | ||
): Variant => { | ||
if ( className.includes( 'is-style-outline' ) ) { | ||
return 'outlined'; | ||
} | ||
|
||
if ( className.includes( 'is-style-fill' ) ) { | ||
return 'contained'; | ||
} | ||
|
||
return defaultVariant; | ||
}; |