Skip to content

Commit

Permalink
Hide parent type name when doc explorer is narrow
Browse files Browse the repository at this point in the history
As suggested by @leebyron here:

  #244 (comment)
  • Loading branch information
wincent committed Dec 10, 2016
1 parent e005447 commit 4623030
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions css/doc-explorer.css
Expand Up @@ -37,6 +37,10 @@
white-space: nowrap;
}

.doc-explorer-narrow .doc-explorer-back {
width: 0;
}

.graphiql-container .doc-explorer-back:before {
border-left: 2px solid #3B5998;
border-top: 2px solid #3B5998;
Expand Down
6 changes: 5 additions & 1 deletion src/components/GraphiQL.js
Expand Up @@ -278,6 +278,10 @@ export class GraphiQL extends React.Component {
display: this.state.docExplorerOpen ? 'block' : 'none',
width: this.state.docExplorerWidth,
};
const docExplorerWrapClasses = [
'docExplorerWrap',
this.state.docExplorerWidth < 200 ? 'doc-explorer-narrow' : '',
].join(' ');

const variableOpen = this.state.variableEditorOpen;
const variableStyle = {
Expand Down Expand Up @@ -357,7 +361,7 @@ export class GraphiQL extends React.Component {
</div>
</div>
</div>
<div className="docExplorerWrap" style={docWrapStyle}>
<div className={docExplorerWrapClasses} style={docWrapStyle}>
<div
className="docExplorerResizer"
onMouseDown={this.handleDocsResizeStart}
Expand Down

0 comments on commit 4623030

Please sign in to comment.