-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: add saved search component (resolves #151) * fix: move variables into config file
- Loading branch information
1 parent
76b22c4
commit 872b2de
Showing
4 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.saved-search { | ||
padding: rem(12) 0 rem(24); | ||
|
||
p + p { | ||
margin-top: rem(12); | ||
} | ||
|
||
.badges { | ||
margin-top: 0; | ||
} | ||
} | ||
|
||
.saved-search + .saved-search { | ||
border-top: solid rem(1) $grey-500; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/components/02-molecules/09-saved-search/saved-search.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = { | ||
title: 'Saved Search', | ||
status: 'wip', | ||
context: { | ||
title: 'Cooperative economy paper', | ||
searchTerm: 'Cooperative Economy', | ||
tags: [ | ||
{label: 'Cooperative economy'}, | ||
{label: 'Australia'}, | ||
{label: 'Academic paper'} | ||
] | ||
} | ||
}; |
15 changes: 15 additions & 0 deletions
15
src/components/02-molecules/09-saved-search/saved-search.njk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{% if not standAlone %}<div class="spacer"></div>{% endif %} | ||
<div class="saved-search"> | ||
<h4><a href="/?s=Cooperative%20Economy">{{ title }}</a></h4> | ||
<span class="disclosure-label" hidden>Show details</span> | ||
<div class="saved-search__details"> | ||
<p><strong>Search term</strong><br /> | ||
“{{ searchTerm }}”</p> | ||
<p><strong>Tags</strong></p> | ||
<ul class="badges"> | ||
{% for tag in tags %} | ||
{% render '@badge', {standAlone: true, label: tag.label}, true %} | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
</div> |