From 281834abd5e93b8b7d9f0f8b9ca0b06197a2d80b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20St-Pierre?= Date: Tue, 25 Mar 2025 18:49:28 -0400 Subject: [PATCH] Add prod WIP page --- .env.example | 1 + app/layout.tsx | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) 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();