2024-12-14 17:46:29 +05:30
|
|
|
import React, { FC, ComponentType } from 'react';
|
|
|
|
import { Route, RouteProps, RouteComponentProps } from 'react-router-dom';
|
2019-12-07 16:58:52 +05:30
|
|
|
|
|
|
|
import AuthFlowRouteContents from './AuthFlowRouteContents';
|
|
|
|
|
2024-12-11 01:12:06 +05:30
|
|
|
// Make "component" prop required
|
2024-12-14 17:46:29 +05:30
|
|
|
type Props = Omit<RouteProps, 'component'> & {
|
|
|
|
component: ComponentType<RouteComponentProps>;
|
|
|
|
};
|
2019-12-10 13:17:32 +05:30
|
|
|
|
2024-12-11 01:12:06 +05:30
|
|
|
const AuthFlowRoute: FC<Props> = ({ component: Component, ...props }) => {
|
2020-05-24 04:38:24 +05:30
|
|
|
return (
|
2024-12-14 17:46:29 +05:30
|
|
|
<Route {...props} render={(routerProps) => <AuthFlowRouteContents component={Component} {...routerProps} />} />
|
2020-05-24 04:38:24 +05:30
|
|
|
);
|
2024-12-11 01:12:06 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
export default AuthFlowRoute;
|