// This exists purely to redirect legacy challenge paths to /learn that could // exist in the web (posts, url shares, etc). import { Router, RouteComponentProps } from '@reach/router'; import { navigate, withPrefix } from 'gatsby'; import React from 'react'; import toLearnPath from '../utils/to-learn-path'; type RouteComponentPropsExtended = RouteComponentProps & { block?: string; challenge?: string; superBlock?: string; }; function Redirect(props: RouteComponentPropsExtended): null { if (typeof window !== 'undefined') { void navigate(toLearnPath(props)); } return null; } function Challenges(): JSX.Element { return ( ); } Challenges.displayName = 'Challenges'; export default Challenges;