Skip to content

Commit

Permalink
[desk-tool] Rename empty list message component and refrain from usin…
Browse files Browse the repository at this point in the history
…g any Pane
  • Loading branch information
Thomas Drevon committed May 29, 2019
1 parent a7469af commit 2340e3a
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react'
import styles from './styles/MissingDocumentTypesMessage.css'

export default function MissingDocumentTypesMessage(props) {
return (
<div className={styles.root}>
<h2>Empty schema</h2>
<p>
Your{' '}
<a
title="Schema documentation"
target="_blank"
rel="noopener noreferrer"
href="https://www.sanity.io/docs/content-studio/the-schema"
>
schema
</a>{' '}
does not contain any document types. If it did, those types would be listed here.
</p>
</div>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@import 'part:@sanity/base/theme/variables-style';

.root {
composes: absoluteCenter from 'part:@sanity/base/theme/layout/positioning-style';
text-align: left;
}
4 changes: 2 additions & 2 deletions packages/@sanity/desk-tool/src/defaultStructure.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react'
import Structure from '../structure-builder'
import EmptyListPane from './pane/EmptyListPane'
import MissingDocumentTypesMessage from './components/MissingDocumentTypesMessage'

export default () => {
const items = Structure.documentTypeListItems()
if (items.length === 0) {
return Structure.component({
id: 'empty-list-pane',
component: <EmptyListPane />
component: <MissingDocumentTypesMessage />
})
}
return Structure.list()
Expand Down
24 changes: 0 additions & 24 deletions packages/@sanity/desk-tool/src/pane/EmptyListPane.js

This file was deleted.

8 changes: 0 additions & 8 deletions packages/@sanity/desk-tool/src/pane/styles/EmptyListPane.css

This file was deleted.

0 comments on commit 2340e3a

Please sign in to comment.