Fix some issues with navigating in the router and bad animations
This commit is contained in:
parent
3db7698170
commit
8ac8a370f8
7 changed files with 73 additions and 48 deletions
|
@ -1,17 +1,22 @@
|
|||
import * as React from 'react';
|
||||
import { Route, RouteComponentProps } from 'react-router-dom';
|
||||
import { Route, RouteComponentProps, Switch } from 'react-router-dom';
|
||||
import DesignElementsContainer from '@/components/dashboard/DesignElementsContainer';
|
||||
import AccountOverviewContainer from '@/components/dashboard/AccountOverviewContainer';
|
||||
import NavigationBar from '@/components/NavigationBar';
|
||||
import DashboardContainer from '@/components/dashboard/DashboardContainer';
|
||||
import TransitionRouter from '@/TransitionRouter';
|
||||
|
||||
export default ({ match }: RouteComponentProps) => (
|
||||
export default ({ location }: RouteComponentProps) => (
|
||||
<div>
|
||||
<NavigationBar/>
|
||||
<div className={'w-full mx-auto'} style={{ maxWidth: '1200px' }}>
|
||||
<Route path={'/'} component={DashboardContainer} exact/>
|
||||
<Route path={'/account'} component={AccountOverviewContainer}/>
|
||||
<Route path={'/design'} component={DesignElementsContainer}/>
|
||||
</div>
|
||||
<TransitionRouter>
|
||||
<div className={'w-full mx-auto'} style={{ maxWidth: '1200px' }}>
|
||||
<Switch location={location}>
|
||||
<Route path={'/'} component={DashboardContainer} exact/>
|
||||
<Route path={'/account'} component={AccountOverviewContainer}/>
|
||||
<Route path={'/design'} component={DesignElementsContainer}/>
|
||||
</Switch>
|
||||
</div>
|
||||
</TransitionRouter>
|
||||
</div>
|
||||
);
|
||||
|
|
18
resources/scripts/routers/ServerRouter.tsx
Normal file
18
resources/scripts/routers/ServerRouter.tsx
Normal file
|
@ -0,0 +1,18 @@
|
|||
import * as React from 'react';
|
||||
import { Route, RouteComponentProps, Switch } from 'react-router-dom';
|
||||
import NavigationBar from '@/components/NavigationBar';
|
||||
import ServerConsole from '@/components/server/ServerConsole';
|
||||
import TransitionRouter from '@/TransitionRouter';
|
||||
|
||||
export default ({ location }: RouteComponentProps) => (
|
||||
<div>
|
||||
<NavigationBar/>
|
||||
<TransitionRouter>
|
||||
<div className={'w-full mx-auto'} style={{ maxWidth: '1200px' }}>
|
||||
<Switch location={location}>
|
||||
<Route path={`/`} component={ServerConsole} exact/>
|
||||
</Switch>
|
||||
</div>
|
||||
</TransitionRouter>
|
||||
</div>
|
||||
);
|
Reference in a new issue