added no copies div

This commit is contained in:
Patrick O'Carroll 2018-02-22 09:58:52 +01:00
parent 5e5a4cf1b0
commit ce9c8ae854
2 changed files with 17 additions and 4 deletions

View File

@ -112,11 +112,8 @@ export class AddPanelPanel extends React.Component<AddPanelPanelProps, AddPanelP
}
renderText(text: string) {
//if(this.state.filter) {
let searchWords = this.state.filter.split('');
return <Highlighter highlightClassName="highlight-search-match" textToHighlight={text} searchWords={searchWords} />;
//}
//return text;
}
renderPanelItem(panel, index) {
@ -128,6 +125,10 @@ export class AddPanelPanel extends React.Component<AddPanelPanelProps, AddPanelP
);
}
noCopiedPanelPlugins() {
return <div className="add-panel__no-panels">No copied panels yet.</div>;
}
filterChange(evt) {
this.setState({
filter: evt.target.value,
@ -173,7 +174,12 @@ export class AddPanelPanel extends React.Component<AddPanelPanelProps, AddPanelP
} else if (this.state.tab === 'Copy') {
addClass = '';
copyClass = 'active active--panel';
console.log(this.state.copiedPanelPlugins);
if (this.state.copiedPanelPlugins.length > 0) {
panelTab = this.state.copiedPanelPlugins.map(this.renderPanelItem);
} else {
panelTab = this.noCopiedPanelPlugins();
}
}
return (

View File

@ -86,3 +86,10 @@
margin-bottom: 10px;
margin-top: 7px;
}
.add-panel__no-panels {
color: $text-color-weak;
font-style: italic;
width: 100%;
padding: 3px 8px;
}