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); 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 React, { PureComponent } from 'react'
import { Link } from 'react-router-dom'
import queryString from 'query-string' import queryString from 'query-string'
import { History, Location } from 'history' import { History, Location } from 'history'
import { Logger } from '@oceanprotocol/squid' import { Logger } from '@oceanprotocol/squid'
@ -123,7 +124,10 @@ export default class Search extends PureComponent<SearchProps, SearchState> {
))} ))}
</div> </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() { public render() {
@ -132,16 +136,16 @@ export default class Search extends PureComponent<SearchProps, SearchState> {
return ( return (
<Route title="Search" wide> <Route title="Search" wide>
<Content wide> <Content wide>
{totalResults > 0 && ( {!this.state.isLoading && (
<h2 <h2 className={styles.resultsTitle}>
className={styles.resultsTitle} {totalResults} results for{' '}
dangerouslySetInnerHTML={{ <span>
__html: `${totalResults} results for <span>${decodeURIComponent( {decodeURIComponent(
this.state.searchTerm || this.state.searchTerm ||
this.state.searchCategories this.state.searchCategories
)}</span>` )}
}} </span>
/> </h2>
)} )}
{this.renderResults()} {this.renderResults()}