Skip to content

Commit

Permalink
feat: add saved search component (resolves #151) (#155)
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
greatislander committed Jan 16, 2020
1 parent 76b22c4 commit 872b2de
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/assets/styles/components/_saved-search.scss
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;
}
1 change: 1 addition & 0 deletions src/assets/styles/pinecone.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
@import "components/menu--home";
@import "components/menu-button";
@import "components/search";
@import "components/saved-search";
@import "layouts/header";
@import "layouts/page";
@import "layouts/archive";
Expand Down
13 changes: 13 additions & 0 deletions src/components/02-molecules/09-saved-search/saved-search.config.js
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 src/components/02-molecules/09-saved-search/saved-search.njk
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 />
&ldquo;{{ searchTerm }}&rdquo;</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>

0 comments on commit 872b2de

Please sign in to comment.