Skip to content

Commit

Permalink
add propTypes #66
Browse files Browse the repository at this point in the history
  • Loading branch information
ashatat committed Nov 17, 2018
1 parent 9aa52b4 commit 7fecad7
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions client/src/components/ItemDetails/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,4 +241,32 @@ class ItemDetails extends Component {
}
}

ItemDetails.defaultProps = {
description: '---',
sku: '---',
};

ItemDetails.propTypes = {
name: PropTypes.string.isRequired,
category: PropTypes.string.isRequired,
description: PropTypes.string,
sku: PropTypes.string,
details: PropTypes.arrayOf(
PropTypes.shape({
pricing: PropTypes.shape({
price: PropTypes.string.isRequired,
discount_price: PropTypes.string.isRequired,
}),
color: PropTypes.string.isRequired,
quantitiy: PropTypes.number,
tags: PropTypes.arrayOf(
PropTypes.shape({
id: PropTypes.string,
name: PropTypes.string,
})
),
})
).isRequired,
};

export default ItemDetails;

0 comments on commit 7fecad7

Please sign in to comment.