forked from woocommerce/woocommerce-blocks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate storybook entries of ProductPrice component (woocommerce#5371)
Closes woocommerce#5368
- Loading branch information
1 parent
9ad3e68
commit 8241d0a
Showing
3 changed files
with
154 additions
and
66 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 was deleted.
Oops, something went wrong.
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,47 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { Story, Meta } from '@storybook/react'; | ||
import { currencyControl } from '@woocommerce/storybook-controls'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import ProductPrice, { ProductPriceProps } from '..'; | ||
|
||
const ALLOWED_ALIGN_VALUES = [ 'left', 'center', 'right' ]; | ||
|
||
export default { | ||
title: 'WooCommerce Blocks/@base-components/ProductPrice', | ||
component: ProductPrice, | ||
argTypes: { | ||
align: { | ||
control: { type: 'radio' }, | ||
options: ALLOWED_ALIGN_VALUES, | ||
}, | ||
currency: currencyControl, | ||
}, | ||
args: { | ||
align: 'left', | ||
format: '<price/>', | ||
price: 3000, | ||
}, | ||
} as Meta< ProductPriceProps >; | ||
|
||
const Template: Story< ProductPriceProps > = ( args ) => ( | ||
<ProductPrice { ...args } /> | ||
); | ||
|
||
export const Default = Template.bind( {} ); | ||
Default.args = {}; | ||
|
||
export const Sale = Template.bind( {} ); | ||
Sale.args = { | ||
regularPrice: 4500, | ||
}; | ||
|
||
export const Range = Template.bind( {} ); | ||
Range.args = { | ||
maxPrice: 5000, | ||
minPrice: 3000, | ||
}; |