Cleanup old prop-types for TS

This commit is contained in:
Bogdan 2024-08-05 13:31:13 +03:00
parent 2f04b037a1
commit 5ef7f2d2a7
9 changed files with 20 additions and 55 deletions

View File

@ -51,7 +51,7 @@ function HistoryDetailsModal(props: HistoryDetailsModalProps) {
sourceTitle, sourceTitle,
data, data,
downloadId, downloadId,
isMarkingAsFailed, isMarkingAsFailed = false,
shortDateFormat, shortDateFormat,
timeFormat, timeFormat,
onMarkAsFailedPress, onMarkAsFailedPress,
@ -93,8 +93,4 @@ function HistoryDetailsModal(props: HistoryDetailsModalProps) {
); );
} }
HistoryDetailsModal.defaultProps = {
isMarkingAsFailed: false,
};
export default HistoryDetailsModal; export default HistoryDetailsModal;

View File

@ -61,7 +61,7 @@ function HistoryRow(props: HistoryRowProps) {
date, date,
data, data,
downloadId, downloadId,
isMarkingAsFailed, isMarkingAsFailed = false,
markAsFailedError, markAsFailedError,
columns, columns,
} = props; } = props;
@ -268,8 +268,4 @@ function HistoryRow(props: HistoryRowProps) {
); );
} }
HistoryRow.defaultProps = {
customFormats: [],
};
export default HistoryRow; export default HistoryRow;

View File

@ -155,10 +155,4 @@ function QueueStatus(props: QueueStatusProps) {
); );
} }
QueueStatus.defaultProps = {
trackedDownloadStatus: 'ok',
trackedDownloadState: 'downloading',
canFlip: false,
};
export default QueueStatus; export default QueueStatus;

View File

@ -1,5 +1,4 @@
import { ConnectedRouter, ConnectedRouterProps } from 'connected-react-router'; import { ConnectedRouter, ConnectedRouterProps } from 'connected-react-router';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import DocumentTitle from 'react-document-title'; import DocumentTitle from 'react-document-title';
import { Provider } from 'react-redux'; import { Provider } from 'react-redux';
@ -20,7 +19,7 @@ function App({ store, history }: AppProps) {
<ConnectedRouter history={history}> <ConnectedRouter history={history}>
<ApplyTheme /> <ApplyTheme />
<PageConnector> <PageConnector>
<AppRoutes app={App} /> <AppRoutes />
</PageConnector> </PageConnector>
</ConnectedRouter> </ConnectedRouter>
</Provider> </Provider>
@ -28,9 +27,4 @@ function App({ store, history }: AppProps) {
); );
} }
App.propTypes = {
store: PropTypes.object.isRequired,
history: PropTypes.object.isRequired,
};
export default App; export default App;

View File

@ -1,4 +1,3 @@
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import { Redirect, Route } from 'react-router-dom'; import { Redirect, Route } from 'react-router-dom';
import Blocklist from 'Activity/Blocklist/Blocklist'; import Blocklist from 'Activity/Blocklist/Blocklist';
@ -165,8 +164,4 @@ function AppRoutes() {
); );
} }
AppRoutes.propTypes = {
app: PropTypes.func.isRequired,
};
export default AppRoutes; export default AppRoutes;

View File

@ -8,15 +8,15 @@ import AppSectionState, { AppSectionItemState } from './AppSectionState';
export type DiskSpaceAppState = AppSectionState<DiskSpace>; export type DiskSpaceAppState = AppSectionState<DiskSpace>;
export type HealthAppState = AppSectionState<Health>; export type HealthAppState = AppSectionState<Health>;
export type SystemStatusAppState = AppSectionItemState<SystemStatus>; export type SystemStatusAppState = AppSectionItemState<SystemStatus>;
export type UpdateAppState = AppSectionState<Update>;
export type TaskAppState = AppSectionState<Task>; export type TaskAppState = AppSectionState<Task>;
export type UpdateAppState = AppSectionState<Update>;
interface SystemAppState { interface SystemAppState {
diskSpace: DiskSpaceAppState; diskSpace: DiskSpaceAppState;
health: HealthAppState; health: HealthAppState;
updates: UpdateAppState;
status: SystemStatusAppState; status: SystemStatusAppState;
tasks: TaskAppState; tasks: TaskAppState;
updates: UpdateAppState;
} }
export default SystemAppState; export default SystemAppState;

View File

@ -26,7 +26,7 @@ export interface CommandBody {
seriesId?: number; seriesId?: number;
seriesIds?: number[]; seriesIds?: number[];
seasonNumber?: number; seasonNumber?: number;
[key: string]: string | number | boolean | undefined | number[] | undefined; [key: string]: string | number | boolean | number[] | undefined;
} }
interface Command extends ModelBase { interface Command extends ModelBase {

View File

@ -46,9 +46,9 @@ function SeriesTypeSelectInput(props: SeriesTypeSelectInputProps) {
const values = [...seriesTypeOptions]; const values = [...seriesTypeOptions];
const { const {
includeNoChange, includeNoChange = false,
includeNoChangeDisabled = true, includeNoChangeDisabled = true,
includeMixed, includeMixed = false,
} = props; } = props;
if (includeNoChange) { if (includeNoChange) {
@ -77,9 +77,4 @@ function SeriesTypeSelectInput(props: SeriesTypeSelectInputProps) {
); );
} }
SeriesTypeSelectInput.defaultProps = {
includeNoChange: false,
includeMixed: false,
};
export default SeriesTypeSelectInput; export default SeriesTypeSelectInput;

View File

@ -1,4 +1,4 @@
import React, { Component } from 'react'; import React from 'react';
import PageContent from 'Components/Page/PageContent'; import PageContent from 'Components/Page/PageContent';
import PageContentBody from 'Components/Page/PageContentBody'; import PageContentBody from 'Components/Page/PageContentBody';
import translate from 'Utilities/String/translate'; import translate from 'Utilities/String/translate';
@ -7,22 +7,17 @@ import DiskSpace from './DiskSpace/DiskSpace';
import Health from './Health/Health'; import Health from './Health/Health';
import MoreInfo from './MoreInfo/MoreInfo'; import MoreInfo from './MoreInfo/MoreInfo';
class Status extends Component { function Status() {
// return (
// Render <PageContent title={translate('Status')}>
<PageContentBody>
render() { <Health />
return ( <DiskSpace />
<PageContent title={translate('Status')}> <About />
<PageContentBody> <MoreInfo />
<Health /> </PageContentBody>
<DiskSpace /> </PageContent>
<About /> );
<MoreInfo />
</PageContentBody>
</PageContent>
);
}
} }
export default Status; export default Status;