aboutsummaryrefslogtreecommitdiffstats
path: root/src/contexts
diff options
context:
space:
mode:
authorLibravatar Mo Tarbin <mhed.t91@gmail.com>2024-07-09 21:21:00 -0400
committerLibravatar Mo Tarbin <mhed.t91@gmail.com>2024-07-09 21:21:00 -0400
commite25a6d3be9b9ae443dd3e1cd57a8c5912cc088b2 (patch)
tree8900f75514f0b2b3b9a1b44d28f436ec10cf8393 /src/contexts
parent8da220e990b5ab15509848d4d7a57298eb6e808e (diff)
downloaddonetick-frontend-e25a6d3be9b9ae443dd3e1cd57a8c5912cc088b2.tar.gz
donetick-frontend-e25a6d3be9b9ae443dd3e1cd57a8c5912cc088b2.tar.bz2
donetick-frontend-e25a6d3be9b9ae443dd3e1cd57a8c5912cc088b2.zip
Add VITE_IS_LANDING_DEFAULT flag for conditional rendering of landing page
Diffstat (limited to '')
-rw-r--r--src/contexts/RouterContext.jsx8
1 files changed, 7 insertions, 1 deletions
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',