Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Drop mobx decorators
Marcin Gębala69a3988bbe87
diff --git a/saleor/static/js/components/variantPicker/VariantPicker.js b/saleor/static/js/components/variantPicker/VariantPicker.jsindex eb2dd13e6c..fd72ff5487 100644--- a/saleor/static/js/components/variantPicker/VariantPicker.js+++ b/saleor/static/js/components/variantPicker/VariantPicker.js@@ -8,9 +8,7 @@ import AttributeSelectionWidget from './AttributeSelectionWidget';import QuantityInput from './QuantityInput';import * as queryString from 'query-string';-@observer-export default class VariantPicker extends Component {-+export default observer(class VariantPicker extends Component {static propTypes = {onAddToCartError: PropTypes.func.isRequired,onAddToCartSuccess: PropTypes.func.isRequired,@@ -172,4 +170,4 @@ export default class VariantPicker extends Component {</div>);}-}+});diff --git a/saleor/static/js/components/variantPicker/VariantPrice.js b/saleor/static/js/components/variantPicker/VariantPrice.jsindex 6657c0192b..43964e4447 100644--- a/saleor/static/js/components/variantPicker/VariantPrice.js+++ b/saleor/static/js/components/variantPicker/VariantPrice.js@@ -1,9 +1,7 @@import { observer } from 'mobx-react';import React, { Component, PropTypes } from 'react';-@observer-export default class VariantPrice extends Component {-+export default observer(class VariantPrice extends Component {static propTypes = {availability: PropTypes.object.isRequired,store: PropTypes.object@@ -33,14 +31,14 @@ export default class VariantPrice extends Component {}return (<h2 className="product__info__price">- <span>{priceText} </span>- {isDiscount && (- <small className="product__info__price__undiscounted">{priceUndiscountedText}</small>- )}- {priceLocalCurrency && (- <p><small className="text-info">≈ {priceLocalCurrency}</small></p>- )}+ <span>{priceText} </span>+ {isDiscount && (+ <small className="product__info__price__undiscounted">{priceUndiscountedText}</small>+ )}+ {priceLocalCurrency && (+ <p><small className="text-info">≈ {priceLocalCurrency}</small></p>+ )}</h2>);}-}+});diff --git a/saleor/static/js/stores/variantPicker.js b/saleor/static/js/stores/variantPicker.jsindex 625ecbad68..9059dc6bb1 100644--- a/saleor/static/js/stores/variantPicker.js+++ b/saleor/static/js/stores/variantPicker.js@@ -1,15 +1,18 @@-import { computed, observable } from 'mobx';+import { extendObservable } from 'mobx';class VariantPickerStore {- @observable variant = {};+ constructor() {+ extendObservable(this, {+ variant: {},+ get isEmpty() {+ return !this.variant.id;+ }+ });+ }setVariant(variant) {this.variant = variant || {};}-- @computed get isEmpty() {- return !this.variant.id;- }}const store = new VariantPickerStore();