Centrally define filled icons
So we don't have to manually pass the option everywhere
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import Component from '@glimmer/component';
|
||||
import { htmlSafe } from '@ember/template';
|
||||
import { getIcon } from '../utils/icons';
|
||||
import { getIcon, isIconFilled } from '../utils/icons';
|
||||
|
||||
export default class IconComponent extends Component {
|
||||
get svg() {
|
||||
@@ -25,10 +25,14 @@ export default class IconComponent extends Component {
|
||||
return this.args.title || '';
|
||||
}
|
||||
|
||||
get isFilled() {
|
||||
return this.args.filled || isIconFilled(this.args.name);
|
||||
}
|
||||
|
||||
<template>
|
||||
{{#if this.svg}}
|
||||
<span
|
||||
class="icon {{if @filled 'icon-filled'}}"
|
||||
class="icon {{if this.isFilled 'icon-filled'}}"
|
||||
style={{this.style}}
|
||||
title={{this.title}}
|
||||
>
|
||||
|
||||
@@ -318,7 +318,7 @@ export default class PlaceDetails extends Component {
|
||||
|
||||
{{#if this.cuisine}}
|
||||
<p class="content-with-icon">
|
||||
<Icon @name="fork-and-knife" @title="Cuisine" @filled={{true}} />
|
||||
<Icon @name="fork-and-knife" @title="Cuisine" />
|
||||
<span>
|
||||
{{this.cuisine}}
|
||||
</span>
|
||||
@@ -393,7 +393,7 @@ export default class PlaceDetails extends Component {
|
||||
|
||||
{{#if this.wikipedia}}
|
||||
<p class="content-with-icon">
|
||||
<Icon @name="wikipedia" @title="Wikipedia" @filled={{true}} />
|
||||
<Icon @name="wikipedia" @title="Wikipedia" />
|
||||
<span>
|
||||
<a
|
||||
href="https://wikipedia.org/wiki/{{this.wikipedia}}"
|
||||
|
||||
Reference in New Issue
Block a user