Skip to content

Commit

Permalink
fix component typing
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacov committed May 5, 2020
1 parent 2cb7bda commit 487003b
Showing 1 changed file with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { Redirect } from 'react-router-dom';
import { Redirect, RouteComponentProps } from 'react-router-dom';
import { Helmet } from 'react-helmet';
import { compose } from 'redux';
import { withStartGuide } from '@console/internal/components/start-guide';
Expand All @@ -10,24 +10,28 @@ import { VirtualMachinesPage } from './vm';
import { VirtualMachineTemplatesPage } from '../vm-templates/vm-template';
import { VirtualMachineModel } from '../../models';

export const RedirectToVirtualizationPage: React.FC<VirtualizationPageProps> = (props) => (
export const RedirectToVirtualizationPage: React.FC<RouteComponentProps<{ ns: string }>> = (
props,
) => (
<Redirect
to={{
pathname: props.match.ns
? `/k8s/ns/${props.match.ns}/virtualization`
pathname: props.match.params.ns
? `/k8s/ns/${props.match.params.ns}/virtualization`
: `/k8s/all-namespaces/virtualization`,
search: decodeURI(props.location?.search),
search: decodeURI(props.location.search),
}}
/>
);

export const RedirectToVirtualizationTemplatePage: React.FC<VirtualizationPageProps> = (props) => (
export const RedirectToVirtualizationTemplatePage: React.FC<RouteComponentProps<{ ns: string }>> = (
props,
) => (
<Redirect
to={{
pathname: props.match.ns
? `/k8s/ns/${props.match.ns}/virtualization/templates`
pathname: props.match.params.ns
? `/k8s/ns/${props.match.params.ns}/virtualization/templates`
: `/k8s/all-namespaces/virtualization/templates`,
search: decodeURI(props.location?.search),
search: decodeURI(props.location.search),
}}
/>
);
Expand Down

0 comments on commit 487003b

Please sign in to comment.