Skip to content

Commit

Permalink
UX: Add tag and category classes & refactor (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanvidrine committed Mar 3, 2022
1 parent c769ac0 commit fbbd4b5
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions about.json
@@ -1,6 +1,6 @@
{
"name": "Discourse Docs Card Filter",
"component": true,
"about_url": null,
"license_url": null,
"component": true
"license_url": null
}
5 changes: 5 additions & 0 deletions javascripts/discourse/components/category-wrapper.js
Expand Up @@ -62,6 +62,11 @@ export default Component.extend({
categoryName(categoryName) {
return categoryName;
},

@discourseComputed("categoryInfo.slug")
categorySlug(categorySlug) {
return categorySlug;
},

@discourseComputed("categoryInfo.description")
hasDescription(description) {
Expand Down
2 changes: 1 addition & 1 deletion javascripts/discourse/components/tag-wrapper.js
Expand Up @@ -54,7 +54,7 @@ export default Component.extend({

@discourseComputed("tag.id")
tagTitle(tagTitle) {
return tagTitle;
return tagTitle.replaceAll("-", " ");
},

@discourseComputed("tag")
Expand Down
@@ -1,4 +1,4 @@
<div class="docs-cards-filter categories-filter tag-filter">
<div class="docs-cards-filter">
{{#if includedCategories}}
{{#each includedCategories as |category|}}
{{category-wrapper category=category categoryOrders=categoryOrders categoryIcons=categoryIcons updateSelectedCategory=updateSelectedCategory}}
Expand Down
@@ -1,4 +1,4 @@
<a class="docs-card-box category-card" onclick={{selectCategory}}>
<a class="docs-card-box category-card {{categorySlug}}" onclick={{selectCategory}}>
<div class="docs-card-box-header">
{{#if categoryIcon}}
{{d-icon categoryIcon}}
Expand Down
2 changes: 1 addition & 1 deletion javascripts/discourse/templates/components/tag-wrapper.hbs
@@ -1,4 +1,4 @@
<a class="docs-card-box" onclick={{selectTag}}>
<a class="docs-card-box tag-card {{tag.id}}" onclick={{selectTag}}>
<div class="docs-card-box-header">
{{#if tagIcon}}
{{d-icon tagIcon}}
Expand Down
3 changes: 0 additions & 3 deletions mobile/mobile.scss

This file was deleted.

0 comments on commit fbbd4b5

Please sign in to comment.