Add VITE_IS_LANDING_DEFAULT flag for conditional rendering of landing page

This commit is contained in:
Mo Tarbin 2024-07-09 21:21:00 -04:00
parent 8da220e990
commit e25a6d3be9
5 changed files with 39 additions and 9 deletions

View file

@ -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',