mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
Merge pull request #112 from oceanprotocol/fix/search-title
fix search titles
This commit is contained in:
commit
4dc4befbd3
@ -18,12 +18,3 @@
|
||||
margin-top: $spacer / 2;
|
||||
font-size: $font-size-large;
|
||||
}
|
||||
|
||||
.titleReverse {
|
||||
composes: title;
|
||||
color: $brand-grey-light;
|
||||
|
||||
span {
|
||||
color: $brand-grey-dark;
|
||||
}
|
||||
}
|
||||
|
@ -7,14 +7,12 @@ import meta from '../../data/meta.json'
|
||||
const Route = ({
|
||||
title,
|
||||
description,
|
||||
titleReverse,
|
||||
wide,
|
||||
children,
|
||||
className
|
||||
}: {
|
||||
title: string
|
||||
description?: string
|
||||
titleReverse?: boolean
|
||||
children: any
|
||||
wide?: boolean
|
||||
className?: string
|
||||
@ -29,13 +27,7 @@ const Route = ({
|
||||
<Content wide={wide}>
|
||||
<article>
|
||||
<header className={styles.header}>
|
||||
<h1
|
||||
className={
|
||||
titleReverse ? styles.titleReverse : styles.title
|
||||
}
|
||||
>
|
||||
{title}
|
||||
</h1>
|
||||
<h1 className={styles.title}>{title}</h1>
|
||||
{description && (
|
||||
<p
|
||||
className={styles.description}
|
||||
|
@ -1,5 +1,16 @@
|
||||
@import '../styles/variables';
|
||||
|
||||
.resultsTitle {
|
||||
color: $brand-grey-light;
|
||||
font-size: $font-size-h3;
|
||||
margin-top: -($spacer / 2);
|
||||
margin-bottom: $spacer;
|
||||
|
||||
span {
|
||||
color: $brand-grey-dark;
|
||||
}
|
||||
}
|
||||
|
||||
.results {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
|
@ -102,13 +102,17 @@ export default class Search extends PureComponent<SearchProps, SearchState> {
|
||||
const { totalResults, totalPages, currentPage } = this.state
|
||||
|
||||
return (
|
||||
<Route
|
||||
title={`${
|
||||
totalResults > 0 ? totalResults : ''
|
||||
} Results for <span>${this.searchTerm}</span>`}
|
||||
titleReverse
|
||||
wide
|
||||
>
|
||||
<Route title="Search" wide>
|
||||
{totalResults > 0 && (
|
||||
<h2
|
||||
className={styles.resultsTitle}
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `${totalResults} results for <span>${
|
||||
this.searchTerm
|
||||
}</span>`
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{this.renderResults()}
|
||||
|
||||
<Pagination
|
||||
|
Loading…
Reference in New Issue
Block a user