From 94c0b09ef651d9f83f5584502d72844d553a7f43 Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Thu, 26 Aug 2021 23:05:30 -0500 Subject: [PATCH] Updated shopify provider --- framework/shopify/index.tsx | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/framework/shopify/index.tsx b/framework/shopify/index.tsx index 46ed106c5..0e0fe3d69 100644 --- a/framework/shopify/index.tsx +++ b/framework/shopify/index.tsx @@ -1,40 +1,10 @@ -import * as React from 'react' -import { ReactNode } from 'react' - -import { - CommerceConfig, - CommerceProvider as CoreCommerceProvider, - useCommerce as useCoreCommerce, -} from '@commerce' - +import { getCommerceProvider, useCommerce as useCoreCommerce } from '@commerce' import { shopifyProvider } from './provider' import type { ShopifyProvider } from './provider' -import { SHOPIFY_CHECKOUT_ID_COOKIE } from './const' export { shopifyProvider } export type { ShopifyProvider } -export const shopifyConfig: CommerceConfig = { - locale: 'en-us', - cartCookie: SHOPIFY_CHECKOUT_ID_COOKIE, -} - -export type ShopifyConfig = Partial - -export type ShopifyProps = { - children?: ReactNode - locale: string -} & ShopifyConfig - -export function CommerceProvider({ children, ...config }: ShopifyProps) { - return ( - - {children} - - ) -} +export const CommerceProvider = getCommerceProvider(shopifyProvider) export const useCommerce = () => useCoreCommerce()