mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-17 04:53:49 +00:00
Moved propTypes and defaultProps as static properties in class components
This commit is contained in:
@@ -9,13 +9,13 @@ import { createShortUrlResultType } from '../reducers/shortUrlCreationResult';
|
||||
import { stateFlagTimeout } from '../../utils/utils';
|
||||
import './CreateShortUrlResult.scss';
|
||||
|
||||
const propTypes = {
|
||||
resetCreateShortUrl: PropTypes.func,
|
||||
error: PropTypes.bool,
|
||||
result: createShortUrlResultType,
|
||||
};
|
||||
|
||||
export default class CreateShortUrlResult extends React.Component {
|
||||
static propTypes = {
|
||||
resetCreateShortUrl: PropTypes.func,
|
||||
error: PropTypes.bool,
|
||||
result: createShortUrlResultType,
|
||||
};
|
||||
|
||||
state = { showCopyTooltip: false };
|
||||
|
||||
componentDidMount() {
|
||||
@@ -62,5 +62,3 @@ export default class CreateShortUrlResult extends React.Component {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
CreateShortUrlResult.propTypes = propTypes;
|
||||
|
||||
@@ -13,18 +13,18 @@ import {
|
||||
import ExternalLink from '../../utils/ExternalLink';
|
||||
import { shortUrlType } from '../reducers/shortUrlsList';
|
||||
|
||||
const propTypes = {
|
||||
isOpen: PropTypes.bool.isRequired,
|
||||
toggle: PropTypes.func.isRequired,
|
||||
url: PropTypes.string.isRequired,
|
||||
shortUrl: shortUrlType.isRequired,
|
||||
shortUrlTags: shortUrlTagsType,
|
||||
editShortUrlTags: PropTypes.func,
|
||||
shortUrlTagsEdited: PropTypes.func,
|
||||
resetShortUrlsTags: PropTypes.func,
|
||||
};
|
||||
|
||||
export class EditTagsModalComponent extends React.Component {
|
||||
static propTypes = {
|
||||
isOpen: PropTypes.bool.isRequired,
|
||||
toggle: PropTypes.func.isRequired,
|
||||
url: PropTypes.string.isRequired,
|
||||
shortUrl: shortUrlType.isRequired,
|
||||
shortUrlTags: shortUrlTagsType,
|
||||
editShortUrlTags: PropTypes.func,
|
||||
shortUrlTagsEdited: PropTypes.func,
|
||||
resetShortUrlsTags: PropTypes.func,
|
||||
};
|
||||
|
||||
saveTags = () => {
|
||||
const { editShortUrlTags, shortUrl, toggle } = this.props;
|
||||
|
||||
@@ -90,8 +90,6 @@ export class EditTagsModalComponent extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
EditTagsModalComponent.propTypes = propTypes;
|
||||
|
||||
const EditTagsModal = connect(
|
||||
pick([ 'shortUrlTags' ]),
|
||||
{ editShortUrlTags, resetShortUrlsTags, shortUrlTagsEdited }
|
||||
|
||||
@@ -11,14 +11,14 @@ import { stateFlagTimeout } from '../../utils/utils';
|
||||
import { ShortUrlsRowMenu } from './ShortUrlsRowMenu';
|
||||
import './ShortUrlsRow.scss';
|
||||
|
||||
const propTypes = {
|
||||
refreshList: PropTypes.func,
|
||||
shortUrlsListParams: shortUrlsListParamsType,
|
||||
selectedServer: serverType,
|
||||
shortUrl: shortUrlType,
|
||||
};
|
||||
|
||||
export class ShortUrlsRow extends React.Component {
|
||||
static propTypes = {
|
||||
refreshList: PropTypes.func,
|
||||
shortUrlsListParams: shortUrlsListParamsType,
|
||||
selectedServer: serverType,
|
||||
shortUrl: shortUrlType,
|
||||
};
|
||||
|
||||
state = { copiedToClipboard: false };
|
||||
|
||||
renderTags(tags) {
|
||||
@@ -73,5 +73,3 @@ export class ShortUrlsRow extends React.Component {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
ShortUrlsRow.propTypes = propTypes;
|
||||
|
||||
@@ -17,14 +17,14 @@ import QrCodeModal from './QrCodeModal';
|
||||
import './ShortUrlsRowMenu.scss';
|
||||
import EditTagsModal from './EditTagsModal';
|
||||
|
||||
const propTypes = {
|
||||
completeShortUrl: PropTypes.string,
|
||||
onCopyToClipboard: PropTypes.func,
|
||||
selectedServer: serverType,
|
||||
shortUrl: shortUrlType,
|
||||
};
|
||||
|
||||
export class ShortUrlsRowMenu extends React.Component {
|
||||
static propTypes = {
|
||||
completeShortUrl: PropTypes.string,
|
||||
onCopyToClipboard: PropTypes.func,
|
||||
selectedServer: serverType,
|
||||
shortUrl: shortUrlType,
|
||||
};
|
||||
|
||||
state = {
|
||||
isOpen: false,
|
||||
isQrModalOpen: false,
|
||||
@@ -91,5 +91,3 @@ export class ShortUrlsRowMenu extends React.Component {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
ShortUrlsRowMenu.propTypes = propTypes;
|
||||
|
||||
Reference in New Issue
Block a user