forked from bigcommerce/catalyst
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): show correct status and messaging for add to cart button (b…
…igcommerce#937) * fix(core): disable add to cart button when products are out of stock * fix: same issue but in compare page * fix: same issue but in faceted search * fix: add out of stock messaging * refactor: component names and paths * refactor: components name and paths * fix: delete unused fragment * fix: lint issue * fix: add test * refactor: change name of button compoent * refactor: add shared AddToCartButton component * refactor: component names * fix: use children instead of showCartIcon prop * fix: update snapshot
- Loading branch information
Showing
28 changed files
with
231 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@bigcommerce/catalyst-core": patch | ||
--- | ||
|
||
Show correct status and messaging for the Add to Cart button. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 0 additions & 29 deletions
29
core/app/[locale]/(default)/compare/_components/add-to-cart.tsx
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
core/app/[locale]/(default)/compare/_components/add-to-cart/fragment.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { graphql } from '~/client/graphql'; | ||
import { AddToCartButtonFragment } from '~/components/add-to-cart-button/fragment'; | ||
|
||
export const AddToCartFragment = graphql( | ||
` | ||
fragment AddToCartFragment on Product { | ||
entityId | ||
...AddToCartButtonFragment | ||
} | ||
`, | ||
[AddToCartButtonFragment], | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { graphql } from '~/client/graphql'; | ||
|
||
export const AddToCartButtonFragment = graphql(` | ||
fragment AddToCartButtonFragment on Product { | ||
inventory { | ||
isInStock | ||
} | ||
availabilityV2 { | ||
status | ||
} | ||
} | ||
`); |
Oops, something went wrong.