diff --git a/src/containers/CheckoutPage/CheckoutPage.js b/src/containers/CheckoutPage/CheckoutPage.js
index c7b4f4a7..539f6b8f 100644
--- a/src/containers/CheckoutPage/CheckoutPage.js
+++ b/src/containers/CheckoutPage/CheckoutPage.js
@@ -146,13 +146,12 @@ export class CheckoutPageComponent extends Component {
// Estimate total price. NOTE: this will change when we can do a
// dry-run to the API and get a proper breakdown of the price.
- const { currency: marketplaceCurrency } = config.currencyConfig;
const unitPrice = currentListing.attributes.price;
if (!unitPrice) {
throw new Error('Listing has no price');
}
- if (unitPrice.currency !== marketplaceCurrency) {
+ if (unitPrice.currency !== config.currency) {
throw new Error(
`Listing currency different from marketplace currency: ${unitPrice.currency}`
);
diff --git a/src/containers/ListingPage/ListingPage.js b/src/containers/ListingPage/ListingPage.js
index 37277c9a..14faaede 100644
--- a/src/containers/ListingPage/ListingPage.js
+++ b/src/containers/ListingPage/ListingPage.js
@@ -34,8 +34,8 @@ const MODAL_BREAKPOINT = 1023;
const { UUID } = types;
-const priceData = (price, currencyConfig, intl) => {
- if (price && price.currency === currencyConfig.currency) {
+const priceData = (price, intl) => {
+ if (price && price.currency === config.currency) {
const formattedPrice = formatMoney(intl, price);
return { formattedPrice, priceTitle: formattedPrice };
} else if (price) {
@@ -103,7 +103,6 @@ export class ListingPageComponent extends Component {
scrollingDisabled,
showListingError,
} = this.props;
- const currencyConfig = config.currencyConfig;
const currentListing = ensureListing(getListing(new UUID(params.id)));
const {
address = '',
@@ -145,7 +144,7 @@ export class ListingPageComponent extends Component {
}
const bookBtnMessage = intl.formatMessage({ id: 'ListingPage.ctaButtonMessage' });
- const { formattedPrice, priceTitle } = priceData(price, currencyConfig, intl);
+ const { formattedPrice, priceTitle } = priceData(price, intl);
const map = geolocation
?
diff --git a/src/containers/PayoutDetailsForm/PayoutDetailsForm.example.js b/src/containers/PayoutDetailsForm/PayoutDetailsForm.example.js
index a3f58e5b..7c7f34e3 100644
--- a/src/containers/PayoutDetailsForm/PayoutDetailsForm.example.js
+++ b/src/containers/PayoutDetailsForm/PayoutDetailsForm.example.js
@@ -4,7 +4,6 @@ import PayoutDetailsForm from './PayoutDetailsForm';
export const USD = {
component: PayoutDetailsForm,
props: {
- currency: 'USD',
onSubmit: values => {
console.log('submit payout details:', values);
},
diff --git a/src/containers/PayoutDetailsForm/PayoutDetailsForm.js b/src/containers/PayoutDetailsForm/PayoutDetailsForm.js
index 80f0db97..198cbec5 100644
--- a/src/containers/PayoutDetailsForm/PayoutDetailsForm.js
+++ b/src/containers/PayoutDetailsForm/PayoutDetailsForm.js
@@ -30,7 +30,6 @@ const PayoutDetailsFormComponent = props => {
const {
className,
country,
- currency,
form,
disabled,
handleSubmit,
@@ -155,7 +154,7 @@ const PayoutDetailsFormComponent = props => {
routingNumberId={`${form}.bankAccountToken.routingNumber`}
accountNumberId={`${form}.bankAccountToken.accountNumber`}
country={country}
- currency={currency}
+ currency={config.currency}
validate={bankAccountRequired}
/>
@@ -239,7 +238,6 @@ PayoutDetailsFormComponent.propTypes = {
...formPropTypes,
className: string,
disabled: bool,
- currency: string.isRequired,
// from mapStateToProps
country: string,
diff --git a/src/containers/SearchPage/SearchPage.js b/src/containers/SearchPage/SearchPage.js
index 21f62269..7f5b862a 100644
--- a/src/containers/SearchPage/SearchPage.js
+++ b/src/containers/SearchPage/SearchPage.js
@@ -5,7 +5,6 @@ import { compose } from 'redux';
import { withRouter } from 'react-router-dom';
import { debounce, isEqual, unionWith } from 'lodash';
import classNames from 'classnames';
-import config from '../../config';
import { withFlattenedRoutes } from '../../util/contextHelpers';
import { googleLatLngToSDKLatLng, googleBoundsToSDKBounds } from '../../util/googleMaps';
import { createResourceLocatorString } from '../../util/routes';
@@ -261,7 +260,6 @@ export class SearchPageComponent extends Component {
>
{
if (!(value instanceof types.Money)) {
throw new Error('Value must be a Money type');
}
- if (value.currency !== config.currencyConfig.currency) {
+ if (value.currency !== config.currency) {
throw new Error('Given currency different from marketplace currency');
}
const subUnitDivisorAsDecimal = convertDivisorToDecimal(config.currencyConfig.subUnitDivisor);
@@ -237,7 +237,7 @@ export const formatMoney = (intl, value) => {
if (!(value instanceof types.Money)) {
throw new Error('Value must be a Money type');
}
- if (value.currency !== config.currencyConfig.currency) {
+ if (value.currency !== config.currency) {
throw new Error('Given currency different from marketplace currency');
}
const valueAsNumber = convertMoneyToNumber(value);