1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

improve empty search view

This commit is contained in:
Matthias Kretschmann 2019-05-24 11:15:08 +02:00
parent f8cff63c79
commit 66655adbf5
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 19 additions and 9 deletions

View File

@ -24,3 +24,9 @@
grid-template-columns: repeat(3, 1fr);
}
}
.empty {
text-align: center;
margin-top: $spacer * 4;
color: $brand-grey-light;
}

View File

@ -1,4 +1,5 @@
import React, { PureComponent } from 'react'
import { Link } from 'react-router-dom'
import queryString from 'query-string'
import { History, Location } from 'history'
import { Logger } from '@oceanprotocol/squid'
@ -123,7 +124,10 @@ export default class Search extends PureComponent<SearchProps, SearchState> {
))}
</div>
) : (
<div>No data sets found.</div>
<div className={styles.empty}>
<p>No Data Sets Found.</p>
<Link to="/publish">+ Publish A Data Set</Link>
</div>
)
public render() {
@ -132,16 +136,16 @@ export default class Search extends PureComponent<SearchProps, SearchState> {
return (
<Route title="Search" wide>
<Content wide>
{totalResults > 0 && (
<h2
className={styles.resultsTitle}
dangerouslySetInnerHTML={{
__html: `${totalResults} results for <span>${decodeURIComponent(
{!this.state.isLoading && (
<h2 className={styles.resultsTitle}>
{totalResults} results for{' '}
<span>
{decodeURIComponent(
this.state.searchTerm ||
this.state.searchCategories
)}</span>`
}}
/>
)}
</span>
</h2>
)}
{this.renderResults()}