2019-06-23 02:45:32 +02:00
|
|
|
import React from 'react';
|
2019-06-29 07:49:08 +02:00
|
|
|
import { Route } from 'react-router';
|
2019-06-23 02:45:32 +02:00
|
|
|
import { CSSTransition, TransitionGroup } from 'react-transition-group';
|
|
|
|
|
|
|
|
type Props = Readonly<{
|
|
|
|
children: React.ReactNode;
|
|
|
|
}>;
|
|
|
|
|
2019-06-29 07:17:29 +02:00
|
|
|
export default ({ children }: Props) => (
|
|
|
|
<Route
|
|
|
|
render={({ location }) => (
|
|
|
|
<TransitionGroup className={'route-transition-group'}>
|
2019-07-28 05:23:44 +02:00
|
|
|
<CSSTransition key={location.key} timeout={250} in={true} appear={true} classNames={'fade'}>
|
2019-06-29 07:17:29 +02:00
|
|
|
<section>
|
2020-04-17 20:17:01 +02:00
|
|
|
{children}
|
2019-06-29 07:17:29 +02:00
|
|
|
</section>
|
|
|
|
</CSSTransition>
|
|
|
|
</TransitionGroup>
|
|
|
|
)}
|
|
|
|
/>
|
2019-06-23 02:45:32 +02:00
|
|
|
);
|