diff --git a/.env.template b/.env.template index b68daaffe..c5543e4b1 100644 --- a/.env.template +++ b/.env.template @@ -13,3 +13,6 @@ NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN= NEXT_PUBLIC_SWELL_STORE_ID= NEXT_PUBLIC_SWELL_PUBLIC_KEY= + +NEXT_PUBLIC_SALEOR_API_URL= +NEXT_PUBLIC_SALEOR_CHANNEL= diff --git a/.prettierrc b/.prettierrc index e1076edfa..91990a859 100644 --- a/.prettierrc +++ b/.prettierrc @@ -2,5 +2,13 @@ "semi": false, "singleQuote": true, "tabWidth": 2, - "useTabs": false + "useTabs": false, + "overrides": [ + { + "files": ["framework/saleor/**/*"], + "options": { + "printWidth": 120 + } + } + ] } diff --git a/README.md b/README.md index d70a62110..0d300b630 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Demo live at: [demo.vercel.store](https://demo.vercel.store/) - Swell Demo: https://swell.vercel.store/ - BigCommerce Demo: https://bigcommerce.vercel.store/ - Vendure Demo: https://vendure.vercel.store +- Saleor Demo: https://saleor.vercel.store/ ## Features @@ -26,7 +27,7 @@ Demo live at: [demo.vercel.store](https://demo.vercel.store/) ## Integrations -Next.js Commerce integrates out-of-the-box with BigCommerce and Shopify. We plan to support all major ecommerce backends. +Next.js Commerce integrates out-of-the-box with BigCommerce, Shopify and Saleor. We plan to support all major ecommerce backends. ## Considerations diff --git a/assets/components.css b/assets/components.css index 8c4c5a357..ebebcc238 100644 --- a/assets/components.css +++ b/assets/components.css @@ -1,3 +1,3 @@ .fit { min-height: calc(100vh - 88px); -} \ No newline at end of file +} diff --git a/codegen.bigcommerce.json b/codegen.bigcommerce.json new file mode 100644 index 000000000..1f14e88ac --- /dev/null +++ b/codegen.bigcommerce.json @@ -0,0 +1,27 @@ +{ + "schema": { + "https://buybutton.store/graphql": { + "headers": { + "Authorization": "Bearer xzy" + } + } + }, + "documents": [ + { + "./framework/bigcommerce/api/**/*.ts": { + "noRequire": true + } + } + ], + "generates": { + "./framework/bigcommerce/schema.d.ts": { + "plugins": ["typescript", "typescript-operations"] + }, + "./framework/bigcommerce/schema.graphql": { + "plugins": ["schema-ast"] + } + }, + "hooks": { + "afterAllFileWrite": ["prettier --write"] + } +} diff --git a/codegen.json b/codegen.json index 1f14e88ac..d9a5c09ce 100644 --- a/codegen.json +++ b/codegen.json @@ -1,23 +1,29 @@ { "schema": { - "https://buybutton.store/graphql": { - "headers": { - "Authorization": "Bearer xzy" - } - } + "https://master.staging.saleor.cloud/graphql/": {} }, "documents": [ { - "./framework/bigcommerce/api/**/*.ts": { + "./framework/saleor/utils/queries/get-all-products-query.ts": { + "noRequire": true + } + }, + { + "./framework/saleor/utils/queries/get-all-products-paths-query.ts": { + "noRequire": true + } + }, + { + "./framework/saleor/utils/queries/get-products.ts": { "noRequire": true } } ], "generates": { - "./framework/bigcommerce/schema.d.ts": { + "./framework/saleor/schema.d.ts": { "plugins": ["typescript", "typescript-operations"] }, - "./framework/bigcommerce/schema.graphql": { + "./framework/saleor/schema.graphql": { "plugins": ["schema-ast"] } }, diff --git a/commerce.config.json b/commerce.config.json index 6f2958c8a..06b985504 100644 --- a/commerce.config.json +++ b/commerce.config.json @@ -1,5 +1,6 @@ { "features": { - "customCheckout": true + "wishlist": false, + "customCheckout": false } } diff --git a/components/cart/CartItem/CartItem.module.css b/components/cart/CartItem/CartItem.module.css index af094ba99..dd43314fb 100644 --- a/components/cart/CartItem/CartItem.module.css +++ b/components/cart/CartItem/CartItem.module.css @@ -23,6 +23,7 @@ height: 100%; left: 30% !important; top: 30% !important; + z-index: 1; } .productName { diff --git a/components/cart/CartItem/CartItem.tsx b/components/cart/CartItem/CartItem.tsx index e51274e0f..a59024e06 100644 --- a/components/cart/CartItem/CartItem.tsx +++ b/components/cart/CartItem/CartItem.tsx @@ -80,7 +80,7 @@ const CartItem = ({ {...rest} >
-
+
closeSidebarIfPresent()} diff --git a/components/cart/CartSidebarView/CartSidebarView.module.css b/components/cart/CartSidebarView/CartSidebarView.module.css index 2b36d283d..c9ffbed50 100644 --- a/components/cart/CartSidebarView/CartSidebarView.module.css +++ b/components/cart/CartSidebarView/CartSidebarView.module.css @@ -1,15 +1,11 @@ +.root { + min-height: 100vh; +} + .root.empty { @apply bg-secondary text-secondary; } -.root.success { - @apply bg-green text-white; -} - -.root.error { - @apply bg-red text-white; -} - .lineItemsList { @apply py-4 space-y-6 sm:py-0 sm:space-y-0 sm:divide-y sm:divide-accent-2 border-accent-2; } diff --git a/components/checkout/CheckoutSidebarView/CheckoutSidebarView.module.css b/components/checkout/CheckoutSidebarView/CheckoutSidebarView.module.css index 36bd4eb49..34c1b487c 100644 --- a/components/checkout/CheckoutSidebarView/CheckoutSidebarView.module.css +++ b/components/checkout/CheckoutSidebarView/CheckoutSidebarView.module.css @@ -1,3 +1,7 @@ +.root { + min-height: calc(100vh - 322px); +} + .lineItemsList { @apply py-4 space-y-6 sm:py-0 sm:space-y-0 sm:divide-y sm:divide-accent-2 border-accent-2; } diff --git a/components/checkout/CheckoutSidebarView/CheckoutSidebarView.tsx b/components/checkout/CheckoutSidebarView/CheckoutSidebarView.tsx index f9dac54f9..fb562e7af 100644 --- a/components/checkout/CheckoutSidebarView/CheckoutSidebarView.tsx +++ b/components/checkout/CheckoutSidebarView/CheckoutSidebarView.tsx @@ -29,7 +29,10 @@ const CheckoutSidebarView: FC = () => { ) return ( - setSidebarView('CART_VIEW')}> + setSidebarView('CART_VIEW')} + >
Checkout diff --git a/components/checkout/PaymentMethodView/PaymentMethodView.module.css b/components/checkout/PaymentMethodView/PaymentMethodView.module.css index f08bd528f..f3880c72c 100644 --- a/components/checkout/PaymentMethodView/PaymentMethodView.module.css +++ b/components/checkout/PaymentMethodView/PaymentMethodView.module.css @@ -1,7 +1,3 @@ -.root { - @apply h-full flex flex-col relative w-full relative; -} - .fieldset { @apply flex flex-col my-3; } diff --git a/components/checkout/ShippingView/ShippingView.module.css b/components/checkout/ShippingView/ShippingView.module.css index d2005a8b0..157d3174e 100644 --- a/components/checkout/ShippingView/ShippingView.module.css +++ b/components/checkout/ShippingView/ShippingView.module.css @@ -1,7 +1,3 @@ -.root { - @apply h-full flex flex-col relative w-full relative; -} - .fieldset { @apply flex flex-col my-3; } diff --git a/components/common/Avatar/Avatar.tsx b/components/common/Avatar/Avatar.tsx index f78aa1d01..663538450 100644 --- a/components/common/Avatar/Avatar.tsx +++ b/components/common/Avatar/Avatar.tsx @@ -14,7 +14,7 @@ const Avatar: FC = ({}) => {
{/* Add an image - We're generating a gradient as placeholder */}
diff --git a/components/common/Footer/Footer.module.css b/components/common/Footer/Footer.module.css index 259318ecf..2ba492086 100644 --- a/components/common/Footer/Footer.module.css +++ b/components/common/Footer/Footer.module.css @@ -1,3 +1,7 @@ +.root { + @apply border-t border-accent-2; +} + .link { & > svg { @apply transform duration-75 ease-linear; diff --git a/components/common/Footer/Footer.tsx b/components/common/Footer/Footer.tsx index b0721712a..04b80404e 100644 --- a/components/common/Footer/Footer.tsx +++ b/components/common/Footer/Footer.tsx @@ -15,73 +15,50 @@ interface Props { pages?: Page[] } -const LEGAL_PAGES = ['terms-of-use', 'shipping-returns', 'privacy-policy'] const links = [ { name: 'Home', - href: '/', + url: '/', }, ] const Footer: FC = ({ className, pages }) => { - const { sitePages, legalPages } = usePages(pages) - const rootClassName = cn(className) + const { sitePages } = usePages(pages) + const rootClassName = cn(s.root, className) return (