Skip to content

Commit

Permalink
fix: Proptypes validation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
treoden committed Jan 2, 2025
1 parent 623d7c5 commit 0b0946a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export function StepContent({
StepContent.propTypes = {
cart: PropTypes.shape({
billingAddress: PropTypes.shape({
id: PropTypes.string,
id: PropTypes.number,
fullName: PropTypes.string,
postcode: PropTypes.string,
telephone: PropTypes.string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ CollectionProducts.propTypes = {
image: PropTypes.shape({
alt: PropTypes.string.isRequired,
url: PropTypes.string.isRequired
}).isRequired,
}),
url: PropTypes.string.isRequired
})
).isRequired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,14 @@ ToastMessage.propTypes = {
count: PropTypes.number.isRequired,
name: PropTypes.string.isRequired,
qty: PropTypes.number.isRequired,
thumbnail: PropTypes.string.isRequired,
thumbnail: PropTypes.string,
toastId: PropTypes.string.isRequired
};

ToastMessage.defaultProps = {
thumbnail: null
};

function AddToCart({ stockAvaibility, loading = false, error }) {
return (
<div className="add-to-cart mt-8">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ Current.propTypes = {
image: PropTypes.shape({
alt: PropTypes.string,
single: PropTypes.string.isRequired
}).isRequired
})
};

Current.defaultProps = {
image: null
};

export default function Images({ product: { uuid, image, gallery = [] } }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function ShippingNote({
name="note"
placeholder={_('Add a note to your order')}
onChange={(e) => setNote(e.target.value)}
value={note}
value={note || ''}
/>
<div className="field-border" />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export default function PaypalMethod({ createOrderAPI }) {
</RenderIfTrue>
<RenderIfTrue
condition={
selectedPaymentMethod && selectedPaymentMethod.code === 'paypal'
!!selectedPaymentMethod && selectedPaymentMethod.code === 'paypal'
}
>
<div>
Expand All @@ -153,7 +153,7 @@ export default function PaypalMethod({ createOrderAPI }) {
<div>
<RenderIfTrue
condition={
selectedPaymentMethod && selectedPaymentMethod.code === 'paypal'
!!selectedPaymentMethod && selectedPaymentMethod.code === 'paypal'
}
>
<div>
Expand Down

0 comments on commit 0b0946a

Please sign in to comment.