forked from pterodactyl/panel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTransitionRouter.tsx
More file actions
36 lines (34 loc) · 1.39 KB
/
TransitionRouter.tsx
File metadata and controls
36 lines (34 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import React from 'react';
import { Route, Switch } from 'react-router';
import { CSSTransition, TransitionGroup } from 'react-transition-group';
import { BrowserRouter } from 'react-router-dom';
type Props = Readonly<{
basename: string;
children: React.ReactNode;
}>;
export default ({ basename, children }: Props) => (
<BrowserRouter basename={basename}>
<Route
render={({ location }) => (
<TransitionGroup className={'route-transition-group'}>
<CSSTransition key={location.key} timeout={150} classNames={'fade'}>
<section>
<Switch location={location}>
{children}
</Switch>
<p className={'text-right text-neutral-500 text-xs'}>
© 2015 - 2019
<a
href={'https://pterodactyl.io'}
className={'no-underline text-neutral-500 hover:text-neutral-300'}
>
Pterodactyl Software
</a>
</p>
</section>
</CSSTransition>
</TransitionGroup>
)}
/>
</BrowserRouter>
);