mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-24 14:09:53 +05:30
af59cc033f
Convert more components from class components to functional. Fix invalid finish state when client was auto approved
18 lines
573 B
TypeScript
18 lines
573 B
TypeScript
import React, { FC, ComponentType } from 'react';
|
|
import { Route, RouteProps, RouteComponentProps } from 'react-router-dom';
|
|
|
|
import AuthFlowRouteContents from './AuthFlowRouteContents';
|
|
|
|
// Make "component" prop required
|
|
type Props = Omit<RouteProps, 'component'> & {
|
|
component: ComponentType<RouteComponentProps>;
|
|
};
|
|
|
|
const AuthFlowRoute: FC<Props> = ({ component: Component, ...props }) => {
|
|
return (
|
|
<Route {...props} render={(routerProps) => <AuthFlowRouteContents component={Component} {...routerProps} />} />
|
|
);
|
|
};
|
|
|
|
export default AuthFlowRoute;
|