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; margin-top: $spacer / 2;
font-size: $font-size-large; 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 = ({ const Route = ({
title, title,
description, description,
titleReverse,
wide, wide,
children, children,
className className
}: { }: {
title: string title: string
description?: string description?: string
titleReverse?: boolean
children: any children: any
wide?: boolean wide?: boolean
className?: string className?: string
@ -29,13 +27,7 @@ const Route = ({
<Content wide={wide}> <Content wide={wide}>
<article> <article>
<header className={styles.header}> <header className={styles.header}>
<h1 <h1 className={styles.title}>{title}</h1>
className={
titleReverse ? styles.titleReverse : styles.title
}
>
{title}
</h1>
{description && ( {description && (
<p <p
className={styles.description} className={styles.description}

View File

@ -1,5 +1,16 @@
@import '../styles/variables'; @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 { .results {
display: grid; display: grid;
grid-template-columns: 1fr; grid-template-columns: 1fr;

View File

@ -102,13 +102,17 @@ export default class Search extends PureComponent<SearchProps, SearchState> {
const { totalResults, totalPages, currentPage } = this.state const { totalResults, totalPages, currentPage } = this.state
return ( return (
<Route <Route title="Search" wide>
title={`${ {totalResults > 0 && (
totalResults > 0 ? totalResults : '' <h2
} Results for <span>${this.searchTerm}</span>`} className={styles.resultsTitle}
titleReverse dangerouslySetInnerHTML={{
wide __html: `${totalResults} results for <span>${
> this.searchTerm
}</span>`
}}
/>
)}
{this.renderResults()} {this.renderResults()}
<Pagination <Pagination