fix(netlify-cms-core): fix prop-types warnings (#1906)
This commit is contained in:
parent
955f94f72b
commit
751ec091fb
@ -174,7 +174,6 @@ class EditorToolbar extends React.Component {
|
|||||||
isDeleting: PropTypes.bool,
|
isDeleting: PropTypes.bool,
|
||||||
onPersist: PropTypes.func.isRequired,
|
onPersist: PropTypes.func.isRequired,
|
||||||
onPersistAndNew: PropTypes.func.isRequired,
|
onPersistAndNew: PropTypes.func.isRequired,
|
||||||
enableSave: PropTypes.bool.isRequired,
|
|
||||||
showDelete: PropTypes.bool.isRequired,
|
showDelete: PropTypes.bool.isRequired,
|
||||||
onDelete: PropTypes.func.isRequired,
|
onDelete: PropTypes.func.isRequired,
|
||||||
onDeleteUnpublishedChanges: PropTypes.func.isRequired,
|
onDeleteUnpublishedChanges: PropTypes.func.isRequired,
|
||||||
|
@ -60,6 +60,10 @@ class MediaLibrary extends React.Component {
|
|||||||
t: PropTypes.func.isRequired,
|
t: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static defaultProps = {
|
||||||
|
files: [],
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The currently selected file and query are tracked in component state as
|
* The currently selected file and query are tracked in component state as
|
||||||
* they do not impact the rest of the application.
|
* they do not impact the rest of the application.
|
||||||
@ -120,7 +124,7 @@ class MediaLibrary extends React.Component {
|
|||||||
/**
|
/**
|
||||||
* Filter an array of file data to include only images.
|
* Filter an array of file data to include only images.
|
||||||
*/
|
*/
|
||||||
filterImages = (files = []) => {
|
filterImages = files => {
|
||||||
return files.filter(file => {
|
return files.filter(file => {
|
||||||
const ext = fileExtension(file.name).toLowerCase();
|
const ext = fileExtension(file.name).toLowerCase();
|
||||||
return IMAGE_EXTENSIONS.includes(ext);
|
return IMAGE_EXTENSIONS.includes(ext);
|
||||||
@ -277,7 +281,7 @@ class MediaLibrary extends React.Component {
|
|||||||
const {
|
const {
|
||||||
isVisible,
|
isVisible,
|
||||||
canInsert,
|
canInsert,
|
||||||
files = [],
|
files,
|
||||||
dynamicSearch,
|
dynamicSearch,
|
||||||
dynamicSearchActive,
|
dynamicSearchActive,
|
||||||
forImage,
|
forImage,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user