<MainWrapper className='App'>
<Visible when={isLogged}>
<LeftPanel />
</Visible>
<Switch>
<PrivateRouter
path='/map'
component={MapPage}
isLogged={isLogged}
redirectTo={'/login'}
/>
<PrivateRouter
path='/profile'
component={UserProfile}
isLogged={isLogged}
redirectTo={'/login'}
/>
<PrivateRouter
path='/login'
component={Login}
isLogged={!isLogged}
redirectTo={'/map'}
/>
<PrivateRouter
path='/registration'
component={Registration}
isLogged={!isLogged}
redirectTo={'/map'}
/>
<PrivateRouter
path='/'
component={{}}
isLogged={false}
redirectTo={'/login'}
/>
</Switch>
</MainWrapper>
I am using react-dom-router {Switch} and trying to add component in the top of the layout. However, it just shifts the entire page right. The navbar is not really on the top of the layout. I have
Component to show side navbar when users are logged in. ! How can I show my navbar only when the users are logged in and place it on the top of it when I use {Switch}?