mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-13 06:04:13 -04:00
fix(types): adding correct unsubscribed component props (#50811)
Co-authored-by: Muhammed Mustafa <MuhammedElruby@gmail.com>
This commit is contained in:
@@ -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 (
|
||||
<>
|
||||
|
||||
@@ -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 />
|
||||
|
||||
Reference in New Issue
Block a user