Add VITE_IS_LANDING_DEFAULT flag for conditional rendering of landing page
This commit is contained in:
parent
8da220e990
commit
e25a6d3be9
5 changed files with 39 additions and 9 deletions
|
@ -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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue