Fix PropType Errors

This commit is contained in:
Cassie Tarakajian 2020-02-04 18:40:54 -05:00
parent 01665fde54
commit 1ef4b66727
5 changed files with 9 additions and 27 deletions

View file

@ -86,8 +86,8 @@ AssetList.propTypes = {
key: PropTypes.string.isRequired,
name: PropTypes.string.isRequired,
url: PropTypes.string.isRequired,
sketchName: PropTypes.string.isRequired,
sketchId: PropTypes.string.isRequired
sketchName: PropTypes.string,
sketchId: PropTypes.string
})).isRequired,
getAssets: PropTypes.func.isRequired,
loading: PropTypes.bool.isRequired

View file

@ -62,7 +62,6 @@ class CollectionList extends React.Component {
}
hideAddSketches = () => {
console.log('hideAddSketches');
this.setState({
addingSketchesToCollectionId: null,
});
@ -161,28 +160,12 @@ class CollectionList extends React.Component {
}
}
const ProjectShape = PropTypes.shape({
id: PropTypes.string.isRequired,
name: PropTypes.string.isRequired,
createdAt: PropTypes.string.isRequired,
updatedAt: PropTypes.string.isRequired,
user: PropTypes.shape({
username: PropTypes.string.isRequired
}).isRequired,
});
const ItemsShape = PropTypes.shape({
createdAt: PropTypes.string.isRequired,
updatedAt: PropTypes.string.isRequired,
project: ProjectShape
});
CollectionList.propTypes = {
user: PropTypes.shape({
username: PropTypes.string,
authenticated: PropTypes.bool.isRequired
}).isRequired,
projectId: PropTypes.string.isRequired,
projectId: PropTypes.string,
getCollections: PropTypes.func.isRequired,
getProject: PropTypes.func.isRequired,
collections: PropTypes.arrayOf(PropTypes.shape({
@ -191,7 +174,6 @@ CollectionList.propTypes = {
description: PropTypes.string,
createdAt: PropTypes.string.isRequired,
updatedAt: PropTypes.string.isRequired,
items: PropTypes.arrayOf(ItemsShape),
})).isRequired,
username: PropTypes.string,
loading: PropTypes.bool.isRequired,
@ -210,6 +192,7 @@ CollectionList.propTypes = {
};
CollectionList.defaultProps = {
projectId: undefined,
project: {
id: undefined,
owner: undefined
@ -224,7 +207,7 @@ function mapStateToProps(state, ownProps) {
sorting: state.sorting,
loading: state.loading,
project: state.project,
projectId: ownProps && ownProps.params ? ownProps.prams.project_id : null,
projectId: ownProps && ownProps.params ? ownProps.params.project_id : null,
};
}

View file

@ -235,9 +235,6 @@ CollectionListRowBase.propTypes = {
})
}))
}).isRequired,
project: PropTypes.shape({
id: PropTypes.string.isRequired,
}).isRequired,
username: PropTypes.string.isRequired,
user: PropTypes.shape({
username: PropTypes.string,

View file

@ -23,7 +23,9 @@ const ItemType = PropTypes.shape({
});
Item.propTypes = {
...ItemType,
name: PropTypes.string.isRequired,
url: PropTypes.string.isRequired,
isAdded: PropTypes.bool.isRequired,
onSelect: PropTypes.func.isRequired,
};

View file

@ -171,7 +171,7 @@ DashboardView.propTypes = {
previousPath: PropTypes.string.isRequired,
theme: PropTypes.string.isRequired,
user: PropTypes.shape({
username: PropTypes.string.isRequired,
username: PropTypes.string,
}),
};