search: add results counter with styling
This commit is contained in:
@ -55,7 +55,7 @@ const PAGE_TYPES: Record<string, string> = {
|
||||
|
||||
function SearchResults({ results }: { results: any }) {
|
||||
if (!results.length) {
|
||||
return <div>Ingen resultater 😔</div>;
|
||||
return <div className={styles.noResults}>Ingen resultater</div>;
|
||||
}
|
||||
const supportedResults = results.filter(
|
||||
(result: any) =>
|
||||
@ -63,6 +63,7 @@ function SearchResults({ results }: { results: any }) {
|
||||
);
|
||||
return (
|
||||
<div>
|
||||
<p className={styles.resultsCounter}>{results.length} resultater</p>
|
||||
{supportedResults.map((result: any) => {
|
||||
let resultType = PAGE_TYPES[result.__typename] ?? "";
|
||||
if (result.__typename === "AssociationPage") {
|
||||
|
@ -1,6 +1,6 @@
|
||||
.searchContainer {
|
||||
max-width: var(--size-width-lead);
|
||||
margin: 0 auto;
|
||||
margin: 0 auto var(--spacing-section-bottom);
|
||||
}
|
||||
|
||||
.searchField {
|
||||
@ -37,3 +37,11 @@
|
||||
letter-spacing: 0.05em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.resultsCounter {
|
||||
margin: var(--spacing-s) 0;
|
||||
}
|
||||
|
||||
.noResults {
|
||||
margin: var(--spacing-s) 0 var(--spacing-section-bottom);
|
||||
}
|
Reference in New Issue
Block a user