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: allow changing the drawer width (#8930)
* WIP * Add width control to the settings sidebar * Fix linting errors * Remove comments * Inline function * Fix issue with smaller viewports * Remove unnecessary code
- Loading branch information
Showing
8 changed files
with
129 additions
and
74 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 was deleted.
Oops, something went wrong.
46 changes: 46 additions & 0 deletions
46
assets/js/blocks/mini-cart/mini-cart-contents/attributes.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,46 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { __ } from '@wordpress/i18n'; | ||
import { Icon } from '@wordpress/icons'; | ||
import { filledCart, removeCart } from '@woocommerce/icons'; | ||
|
||
export const blockName = 'woocommerce/mini-cart-contents'; | ||
|
||
export const attributes = { | ||
isPreview: { | ||
type: 'boolean', | ||
default: false, | ||
}, | ||
lock: { | ||
type: 'object', | ||
default: { | ||
remove: true, | ||
move: true, | ||
}, | ||
}, | ||
currentView: { | ||
type: 'string', | ||
default: 'woocommerce/filled-mini-cart-contents-block', | ||
source: 'readonly', // custom source to prevent saving to post content | ||
}, | ||
editorViews: { | ||
type: 'object', | ||
default: [ | ||
{ | ||
view: 'woocommerce/filled-mini-cart-contents-block', | ||
label: __( 'Filled Mini Cart', 'woo-gutenberg-products-block' ), | ||
icon: <Icon icon={ filledCart } />, | ||
}, | ||
{ | ||
view: 'woocommerce/empty-mini-cart-contents-block', | ||
label: __( 'Empty Mini Cart', 'woo-gutenberg-products-block' ), | ||
icon: <Icon icon={ removeCart } />, | ||
}, | ||
], | ||
}, | ||
width: { | ||
type: 'string', | ||
default: '480px', | ||
}, | ||
}; |
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