From c7f0df241c4b1136cb030b3749fb8dacebbbf9fb Mon Sep 17 00:00:00 2001 From: Lucio Giannotta Date: Thu, 29 Dec 2022 19:55:38 +0100 Subject: [PATCH 1/2] Add default currency to `ProductPrice` component story --- assets/js/base/components/product-price/stories/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/js/base/components/product-price/stories/index.tsx b/assets/js/base/components/product-price/stories/index.tsx index 736e2d8a850..49da9344ec1 100644 --- a/assets/js/base/components/product-price/stories/index.tsx +++ b/assets/js/base/components/product-price/stories/index.tsx @@ -2,7 +2,7 @@ * External dependencies */ import type { Story, Meta } from '@storybook/react'; -import { currencyControl } from '@woocommerce/storybook-controls'; +import { currencies, currencyControl } from '@woocommerce/storybook-controls'; /** * Internal dependencies @@ -23,6 +23,7 @@ export default { }, args: { align: 'left', + currency: currencies.EUR, format: '', price: 3000, }, From 07f32306023d8b87ba343227b2f6ff77c252a704 Mon Sep 17 00:00:00 2001 From: Lucio Giannotta Date: Tue, 17 Jan 2023 18:14:24 +0100 Subject: [PATCH 2/2] Invert options mapping for currency control --- storybook/custom-controls/currency.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storybook/custom-controls/currency.ts b/storybook/custom-controls/currency.ts index 2c1d39e8f1f..95b850685f3 100644 --- a/storybook/custom-controls/currency.ts +++ b/storybook/custom-controls/currency.ts @@ -35,6 +35,6 @@ export const currenciesAPIShape: Record< string, CurrencyResponse > = export const currencyControl = { control: 'select', - options: currencies, - mapping: Object.keys( currencies ), + options: Object.keys( currencies ), + mapping: currencies, };