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,
data,
downloadId,
isMarkingAsFailed,
isMarkingAsFailed = false,
shortDateFormat,
timeFormat,
onMarkAsFailedPress,
@ -93,8 +93,4 @@ function HistoryDetailsModal(props: HistoryDetailsModalProps) {
);
}
HistoryDetailsModal.defaultProps = {
isMarkingAsFailed: false,
};
export default HistoryDetailsModal;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -46,9 +46,9 @@ function SeriesTypeSelectInput(props: SeriesTypeSelectInputProps) {
const values = [...seriesTypeOptions];
const {
includeNoChange,
includeNoChange = false,
includeNoChangeDisabled = true,
includeMixed,
includeMixed = false,
} = props;
if (includeNoChange) {
@ -77,9 +77,4 @@ function SeriesTypeSelectInput(props: SeriesTypeSelectInputProps) {
);
}
SeriesTypeSelectInput.defaultProps = {
includeNoChange: false,
includeMixed: false,
};
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 PageContentBody from 'Components/Page/PageContentBody';
import translate from 'Utilities/String/translate';
@ -7,22 +7,17 @@ import DiskSpace from './DiskSpace/DiskSpace';
import Health from './Health/Health';
import MoreInfo from './MoreInfo/MoreInfo';
class Status extends Component {
//
// Render
render() {
return (
<PageContent title={translate('Status')}>
<PageContentBody>
<Health />
<DiskSpace />
<About />
<MoreInfo />
</PageContentBody>
</PageContent>
);
}
function Status() {
return (
<PageContent title={translate('Status')}>
<PageContentBody>
<Health />
<DiskSpace />
<About />
<MoreInfo />
</PageContentBody>
</PageContent>
);
}
export default Status;