2019-12-07 16:58:52 +05:30
|
|
|
import React from 'react';
|
|
|
|
import { Route, RouteProps } from 'react-router-dom';
|
|
|
|
|
|
|
|
import AuthFlowRouteContents from './AuthFlowRouteContents';
|
|
|
|
|
|
|
|
export default function AuthFlowRoute(props: RouteProps) {
|
|
|
|
const { component: Component, ...routeProps } = props;
|
|
|
|
|
2019-12-10 13:17:32 +05:30
|
|
|
if (!Component) {
|
|
|
|
throw new Error('props.component required');
|
|
|
|
}
|
|
|
|
|
2019-12-07 16:58:52 +05:30
|
|
|
return (
|
|
|
|
<Route
|
|
|
|
{...routeProps}
|
2020-05-20 22:05:52 +05:30
|
|
|
render={(routerProps) => (
|
2019-12-07 16:58:52 +05:30
|
|
|
<AuthFlowRouteContents
|
|
|
|
routerProps={routerProps}
|
|
|
|
component={Component}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|