1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-17 12:01:13 +02:00

fix conditional rendering

This commit is contained in:
Kushagra Gour
2018-06-20 01:30:53 +05:30
parent d8fec965fa
commit 1b46020f85
2 changed files with 13 additions and 4 deletions

View File

@@ -228,8 +228,9 @@ export default class SavedItemPane extends Component {
/>
<div id="js-saved-items-wrap" class="saved-items-pane__container">
{!this.state.filteredItems.length &&
this.items.length && <div class="mt-1">No match found.</div>}
{!this.state.filteredItems.length && this.items.length ? (
<div class="mt-1">No match found.</div>
) : null}
{this.state.filteredItems.map(item => (
<div
class="js-saved-item-tile saved-item-tile"
@@ -258,9 +259,9 @@ export default class SavedItemPane extends Component {
</span>
</div>
))}
{!this.items.length && (
{!this.items.length ? (
<h2 class="opacity--30">Nothing saved here.</h2>
)}
) : null}
</div>
</div>
);

View File

@@ -109,6 +109,14 @@ p {
margin-bottom: 2rem;
}
.mt-1 {
margin-top: 1rem;
}
.mt-2 {
margin-top: 2rem;
}
.mb-0 {
margin-bottom: 0;
}