fix(types): adding correct unsubscribed component props (#50811)

Co-authored-by: Muhammed Mustafa <MuhammedElruby@gmail.com>
This commit is contained in:
Mateo Guzmán
2023-06-29 18:56:31 +02:00
committed by GitHub
parent f86080572d
commit 840959caa3
2 changed files with 7 additions and 7 deletions

View File

@@ -1,4 +1,5 @@
import { Grid, Panel, Button } from '@freecodecamp/react-bootstrap';
import type { RouteComponentProps } from '@reach/router';
import React from 'react';
import Helmet from 'react-helmet';
import { useTranslation } from 'react-i18next';
@@ -9,11 +10,13 @@ import FullWidthRow from '../components/helpers/full-width-row';
const { apiLocation } = envData;
type ShowUnsubscribedProps = Pick<RouteComponentProps, 'path'> & {
unsubscribeId?: string;
};
function ShowUnsubscribed({
unsubscribeId
}: {
unsubscribeId: string;
}): JSX.Element {
}: ShowUnsubscribedProps): JSX.Element {
const { t } = useTranslation();
return (
<>

View File

@@ -8,11 +8,8 @@ import RedirectHome from '../components/redirect-home';
function Unsubscribed(): JSX.Element {
return (
<Router>
{/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
{/* @ts-ignore */}
<ShowUnsubscribed path={withPrefix('/unsubscribed/:unsubscribeId')} />
{/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
{/* @ts-ignore */}
<ShowUnsubscribed path={withPrefix('/unsubscribed')} />
<RedirectHome default />