diff --git a/.env.example b/.env.example index c6e1930fc..f29228442 100644 --- a/.env.example +++ b/.env.example @@ -3,3 +3,4 @@ SITE_NAME="Demo Commerce" SHOPIFY_REVALIDATION_SECRET="" SHOPIFY_STOREFRONT_ACCESS_TOKEN="" SHOPIFY_STORE_DOMAIN="[your-shopify-store-subdomain].myshopify.com" +ENVIRONMENT="development" diff --git a/app/layout.tsx b/app/layout.tsx index 5e3355ce9..f720c0309 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -3,10 +3,10 @@ import { Navbar } from 'components/layout/navbar'; import { WelcomeToast } from 'components/welcome-toast'; import { GeistSans } from 'geist/font/sans'; import { getCart } from 'lib/shopify'; +import { baseUrl } from 'lib/utils'; import { ReactNode } from 'react'; import { Toaster } from 'sonner'; import './globals.css'; -import { baseUrl } from 'lib/utils'; const { SITE_NAME } = process.env; @@ -27,6 +27,21 @@ export default async function RootLayout({ }: { children: ReactNode; }) { + if (process.env.ENVIRONMENT === 'production') { + return ( + + +
+
+

Under Construction

+

We're working on something awesome. Please check back soon!

+
+
+ + + ); + } + // Don't await the fetch, pass the Promise to the context provider const cart = getCart();