Skip to content

Commit

Permalink
[desk-tool] Remove unused props from withDocumentType HOC
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Oct 24, 2019
1 parent 5eec395 commit 7485d40
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions packages/@sanity/desk-tool/src/utils/withDocumentType.js
Expand Up @@ -5,28 +5,17 @@ import LoadingPane from '../pane/LoadingPane'
import ErrorPane from '../pane/ErrorPane'

// Resolves the type for a document if not present
export default function withDocument(Pane) {
export default function withDocumentType(Pane) {
return class WithDocumentType extends React.PureComponent {
static displayName = `withDocumentType(${Pane.displayName || Pane.name})`

static propTypes = {
isSelected: PropTypes.bool.isRequired,
isCollapsed: PropTypes.bool.isRequired,
onExpand: PropTypes.func,
onCollapse: PropTypes.func,
path: PropTypes.arrayOf(PropTypes.string),
options: PropTypes.shape({
id: PropTypes.string.isRequired,
type: PropTypes.string
}).isRequired
}

static defaultProps = {
path: [],
onExpand: undefined,
onCollapse: undefined
}

constructor(props) {
super(props)

Expand Down Expand Up @@ -69,7 +58,7 @@ export default function withDocument(Pane) {
}

// Undecided, still loading type from server
return <LoadingPane {...this.props} />
return <LoadingPane {...this.props} message="Resolving document type…" />
}
}
}

0 comments on commit 7485d40

Please sign in to comment.