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

fix search titles

This commit is contained in:
Matthias Kretschmann 2019-04-29 12:02:51 +02:00
parent 4bce7b0138
commit fe08ccc8b2
Signed by: m
GPG Key ID: 606EEEF3C479A91F
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