Skip to content

Conversation

@lordofthecactus
Copy link
Contributor

@lordofthecactus lordofthecactus commented Mar 6, 2023

ShopPayButton can now receive a storeDomain prop. Updated the demo store to make it work.

WHY are these changes introduced?

Part of: #629
Solves:
#487

HOW to test your changes?

Go to a product in the demo store and click on Shop Pay button. It should open the Shop checkout

Post-merge steps

There are other component relying on ShopifyProvider

Checklist

  • I've read the Contributing Guidelines
  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've added a changeset if this PR contains user-facing or noteworthy changes
  • I've added tests to cover my changes
  • I've added or updated the documentation

@github-actions github-actions bot had a problem deploying to preview March 6, 2023 12:02 Failure
@lordofthecactus lordofthecactus marked this pull request as ready for review March 6, 2023 12:06
@github-actions github-actions bot had a problem deploying to preview March 6, 2023 12:06 Failure
@github-actions

This comment has been minimized.

@github-actions github-actions bot had a problem deploying to preview March 6, 2023 12:10 Failure

const ShopifyContext = createContext<ShopifyContextValue>({
export const defaultShopifyContext: ShopifyContextValue = {
storeDomain: 'test',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed that this makes all uses of useShop() to contain this default parameters. I would suggest to remove this and make it null by default. This is why in the step above I had to check if storeDomain was the default or not.

@lordofthecactus
Copy link
Contributor Author

Added @juanpprieto in a commit since I copied some of this code from: Shopify/hydrogen-react#122

@github-actions github-actions bot had a problem deploying to preview March 6, 2023 12:44 Failure
@lordofthecactus lordofthecactus force-pushed the dr/shop-pay-without-provider branch from d59f285 to 46080f9 Compare March 6, 2023 15:07
@github-actions github-actions bot had a problem deploying to preview March 6, 2023 15:09 Failure
@github-actions github-actions bot had a problem deploying to preview March 6, 2023 15:28 Failure
@lordofthecactus
Copy link
Contributor Author

Working oxygen deployment at: https://bwcgr1r9v-f1f4fa724b7467f41f07.myshopify.dev/
Seems we have some turbo cache issues

Copy link

@wizardlyhel wizardlyhel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated docs

I think the default context is there is so that ShopPayButton doesn't completely breaks when props not supplied.

@github-actions github-actions bot had a problem deploying to preview March 7, 2023 20:42 Failure
@github-actions github-actions bot had a problem deploying to preview March 7, 2023 20:51 Failure
@github-actions github-actions bot had a problem deploying to preview March 7, 2023 23:47 Failure
@lordofthecactus lordofthecactus merged commit c78f441 into 2023-01 Mar 9, 2023
@lordofthecactus lordofthecactus deleted the dr/shop-pay-without-provider branch March 9, 2023 16:01
@github-actions github-actions bot mentioned this pull request Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants