1
0
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:
Matthias Kretschmann 2019-04-29 12:17:23 +02:00 committed by GitHub
commit 4dc4befbd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 25 deletions

View File

@ -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;
}
}

View File

@ -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}

View File

@ -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;

View File

@ -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