From e25a6d3be9b9ae443dd3e1cd57a8c5912cc088b2 Mon Sep 17 00:00:00 2001
From: Mo Tarbin <mhed.t91@gmail.com>
Date: Tue, 9 Jul 2024 21:21:00 -0400
Subject: Add VITE_IS_LANDING_DEFAULT flag for conditional rendering of landing
 page

---
 src/contexts/RouterContext.jsx | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'src/contexts/RouterContext.jsx')

diff --git a/src/contexts/RouterContext.jsx b/src/contexts/RouterContext.jsx
index 02df35f..4fea83d 100644
--- a/src/contexts/RouterContext.jsx
+++ b/src/contexts/RouterContext.jsx
@@ -20,6 +20,12 @@ import TermsView from '../views/Terms/TermsView'
 import TestView from '../views/TestView/Test'
 import ThingsHistory from '../views/Things/ThingsHistory'
 import ThingsView from '../views/Things/ThingsView'
+const getMainRoute = () => {
+  if (import.meta.env.VITE_IS_LANDING_DEFAULT === 'true') {
+    return <Landing />
+  }
+  return <MyChores />
+}
 const Router = createBrowserRouter([
   {
     path: '/',
@@ -28,7 +34,7 @@ const Router = createBrowserRouter([
     children: [
       {
         path: '/',
-        element: <Landing />,
+        element: getMainRoute(),
       },
       {
         path: '/settings',
-- 
cgit 

