Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Pass currency code to page rather than hardcode it

dominik-zeglen2cbff8033abe
diff --git a/saleor/static/dashboard-next/products/components/ProductCreatePage/ProductCreatePage.tsx b/saleor/static/dashboard-next/products/components/ProductCreatePage/ProductCreatePage.tsx
index 2eafd57804..e0af914950 100644
--- a/saleor/static/dashboard-next/products/components/ProductCreatePage/ProductCreatePage.tsx
+++ b/saleor/static/dashboard-next/products/components/ProductCreatePage/ProductCreatePage.tsx
@@ -52,6 +52,7 @@ interface ProductCreatePageProps {
id: string;
name: string;
}>;
+ currency: string;
categories?: Array<{
id: string;
name: string;
@@ -97,6 +98,7 @@ const decorate = withStyles(theme => ({
export const ProductCreatePage = decorate<ProductCreatePageProps>(
({
classes,
+ currency,
disabled,
categories,
collections,
@@ -150,8 +152,7 @@ export const ProductCreatePage = decorate<ProductCreatePageProps>(
/>
<div className={classes.cardContainer}>
<ProductPricing
- // FIXME: this should be fetched from API
- currency="USD"
+ currency={currency}
data={data}
disabled={disabled}
onChange={change}
diff --git a/saleor/static/dashboard-next/products/views/ProductCreate.tsx b/saleor/static/dashboard-next/products/views/ProductCreate.tsx
index 9cecf145b3..386a506fba 100644
--- a/saleor/static/dashboard-next/products/views/ProductCreate.tsx
+++ b/saleor/static/dashboard-next/products/views/ProductCreate.tsx
@@ -85,6 +85,8 @@ export const ProductUpdate: React.StatelessComponent<ProductUpdateProps> = ({
const disabled = loading || productCreateDataLoading;
return (
<ProductCreatePage
+ // FIXME: this should be fetched from API
+ currency="USD"
categories={
data && data.categories
? data.categories.edges.map(edge => edge.node)