1
0
mirror of https://github.com/SomboChea/ui synced 2026-01-17 08:35:47 +07:00

feat: upgraded typescript to 3.6.3 (#145)

This commit is contained in:
Thomas Klein
2019-10-02 22:32:31 +02:00
committed by Juan Picado @jotadeveloper
parent 74576bda12
commit f8a1f2cbb8
6 changed files with 201 additions and 137 deletions

View File

@@ -1,18 +1,17 @@
import ListItem from '@material-ui/core/ListItem';
import Typography from '@material-ui/core/Typography';
import withWidth, { isWidthUp } from '@material-ui/core/withWidth';
import withWidth, { isWidthUp, WithWidthProps } from '@material-ui/core/withWidth';
import React, { useCallback } from 'react';
import { RouteComponentProps, withRouter } from 'react-router-dom';
import PackageImg from './img/package.svg';
import { Card, EmptyPackage, Heading, Inner, List, Wrapper } from './styles';
import { Breakpoint } from '@material-ui/core/styles/createBreakpoints';
export const NOT_FOUND_TEXT = `Sorry, we couldn't find it...`;
export const LABEL_NOT_FOUND = `The page you're looking for doesn't exist.`;
export const LABEL_FOOTER_NOT_FOUND = 'Perhaps these links will help find what you are looking for:';
export type NotFoundProps = RouteComponentProps & { width: Breakpoint; history };
export type NotFoundProps = RouteComponentProps & WithWidthProps;
const HOME_LABEL = 'Home';
@@ -36,11 +35,12 @@ const NotFound: React.FC<NotFoundProps> = ({ history, width }) => {
</List>
);
/* eslint-disable @typescript-eslint/no-non-null-assertion */
return (
<Wrapper data-testid="404">
<Inner>
<EmptyPackage alt="404 - Page not found" src={PackageImg} />
<Heading className="not-found-text" variant={isWidthUp('sm', width) ? 'h2' : 'h4'}>
<Heading className="not-found-text" variant={isWidthUp('sm', width!) ? 'h2' : 'h4'}>
{NOT_FOUND_TEXT}
</Heading>
{renderSubTitle()}
@@ -50,4 +50,4 @@ const NotFound: React.FC<NotFoundProps> = ({ history, width }) => {
);
};
export default withRouter(withWidth()(NotFound));
export default withRouter<NotFoundProps, React.ComponentType<NotFoundProps>>(withWidth()(NotFound));

View File

@@ -17,10 +17,6 @@ export interface State {
loaded: boolean;
error: boolean;
}
interface AbortControllerInterface {
signal: () => void;
abort: () => void;
}
export type cancelAllSearchRequests = () => void;
export type handlePackagesClearRequested = () => void;
@@ -169,7 +165,7 @@ export class Search extends Component<RouteComponentProps<{}>, State> {
}
};
private requestList: AbortControllerInterface[];
private requestList: AbortController[];
public getAdorment(): JSX.Element {
return (