Skip to content

Commit

Permalink
Merge pull request #180 from reactioncommerce/fix-prop-type-issues
Browse files Browse the repository at this point in the history
fix: prop types errors
  • Loading branch information
mikemurray authored Jan 10, 2020
2 parents 00ffb27 + 06f87f3 commit 70e9469
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const wrapComponent = (Comp) => (
class VariantFormContainer extends Component {
static propTypes = {
client: PropTypes.object,
enqueueSnackbar: PropTypes.func,
history: PropTypes.object,
shopId: PropTypes.string,
variant: PropTypes.object
Expand Down Expand Up @@ -214,7 +215,7 @@ const wrapComponent = (Comp) => (
}
});
} catch (error) {
enqueueSnackbar(i18next.t("productDetailEdit.updateProductFieldFail", { [fieldName]: value }), { variant: "error" })
enqueueSnackbar(i18next.t("productDetailEdit.updateProductFieldFail", { [fieldName]: value }), { variant: "error" });
}
}

Expand All @@ -231,7 +232,7 @@ const wrapComponent = (Comp) => (
return;
}

if(["price", "compareAtPrice"].includes(fieldName)){
if (["price", "compareAtPrice"].includes(fieldName)) {
this.updateVariantPrice(variantId, fieldName, value);
return;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { Fragment } from "react";
import PropTypes from "prop-types";
import { Components } from "@reactioncommerce/reaction-components";
import Button from "@reactioncommerce/catalyst/Button";
import { i18next } from "/client/api";
import { ReactionProduct } from "/lib/api";
import Card from "@material-ui/core/Card";
Expand All @@ -17,9 +18,6 @@ import Switch from "@material-ui/core/Switch";
*/
function VariantInventoryForm(props) {
const {
components: {
Button
},
inventoryInfo,
isLoadingInventoryInfo,
recalculateReservedSimpleInventory,
Expand Down Expand Up @@ -100,9 +98,8 @@ function VariantInventoryForm(props) {
value={isEnabled ? inventoryInStock : 0}
/>
<Button
isDisabled={!isEnabled}
isShortHeight
isTextOnly
disabled={!isEnabled}
variant="text"
onClick={() => {
recalculateReservedSimpleInventory({
variables: {
Expand Down
80 changes: 56 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@material-ui/core": "^4.3.2",
"@material-ui/styles": "^4.5.0",
"@reactioncommerce/catalyst": "~1.14.1",
"@reactioncommerce/components": "^0.67.2",
"@reactioncommerce/components": "^0.69.0",
"@reactioncommerce/components-context": "1.2.0",
"@reactioncommerce/file-collections": "^0.7.3",
"@reactioncommerce/logger": "1.1.1",
Expand Down

0 comments on commit 70e9469

Please sign in to comment.