|
1 | 1 | import React from 'react'; |
2 | 2 | import { Route, Switch } from 'react-router'; |
3 | 3 | import { CSSTransition, TransitionGroup } from 'react-transition-group'; |
4 | | -import { BrowserRouter } from 'react-router-dom'; |
5 | 4 |
|
6 | 5 | type Props = Readonly<{ |
7 | | - basename: string; |
8 | 6 | children: React.ReactNode; |
9 | 7 | }>; |
10 | 8 |
|
11 | | -export default ({ basename, children }: Props) => ( |
12 | | - <BrowserRouter basename={basename}> |
13 | | - <Route |
14 | | - render={({ location }) => ( |
15 | | - <TransitionGroup className={'route-transition-group'}> |
16 | | - <CSSTransition key={location.key} timeout={150} classNames={'fade'}> |
17 | | - <section> |
18 | | - <Switch location={location}> |
19 | | - {children} |
20 | | - </Switch> |
21 | | - <div className={'mx-auto w-full'} style={{ maxWidth: '1200px' }}> |
22 | | - <p className={'text-right text-neutral-500 text-xs'}> |
23 | | - © 2015 - 2019 |
24 | | - <a |
25 | | - href={'https://pterodactyl.io'} |
26 | | - className={'no-underline text-neutral-500 hover:text-neutral-300'} |
27 | | - > |
28 | | - Pterodactyl Software |
29 | | - </a> |
30 | | - </p> |
31 | | - </div> |
32 | | - </section> |
33 | | - </CSSTransition> |
34 | | - </TransitionGroup> |
35 | | - )} |
36 | | - /> |
37 | | - </BrowserRouter> |
| 9 | +export default ({ children }: Props) => ( |
| 10 | + <Route |
| 11 | + render={({ location }) => ( |
| 12 | + <TransitionGroup className={'route-transition-group'}> |
| 13 | + <CSSTransition key={location.key} timeout={250} classNames={'fade'}> |
| 14 | + <section> |
| 15 | + {children} |
| 16 | + <div className={'mx-auto w-full'} style={{ maxWidth: '1200px' }}> |
| 17 | + <p className={'text-right text-neutral-500 text-xs'}> |
| 18 | + © 2015 - 2019 |
| 19 | + <a |
| 20 | + href={'https://pterodactyl.io'} |
| 21 | + className={'no-underline text-neutral-500 hover:text-neutral-300'} |
| 22 | + > |
| 23 | + Pterodactyl Software |
| 24 | + </a> |
| 25 | + </p> |
| 26 | + </div> |
| 27 | + </section> |
| 28 | + </CSSTransition> |
| 29 | + </TransitionGroup> |
| 30 | + )} |
| 31 | + /> |
38 | 32 | ); |
0 commit comments