Refactor code based on comments from PR review

This commit is contained in:
aonomike 2019-05-09 02:27:03 +03:00
parent 399507c7fb
commit bf57198815
3 changed files with 4 additions and 15 deletions

View File

@ -12,7 +12,7 @@
> >
<hc-image <hc-image
:title="badge.key" :title="badge.key"
:image-props="imageProps(badge.icon)" :image-props="{ src: badge.icon}"
class="hc-badge" class="hc-badge"
/> />
</div> </div>
@ -30,11 +30,6 @@ export default {
type: Array, type: Array,
default: () => [] default: () => []
} }
},
methods: {
imageProps(icon) {
return { src: icon }
}
} }
} }
</script> </script>

View File

@ -58,11 +58,8 @@ export default {
} }
}, },
computed: { computed: {
iconPath() { imageProps() {
return `/img/empty/${this.icon}.svg` return { src: `/img/empty/${this.icon}.svg` }
},
imageProps: {
src: iconPath
} }
} }
} }

View File

@ -12,7 +12,7 @@
> >
<a :href="link.url"> <a :href="link.url">
<hc-image <hc-image
:image-props="imageProps(link.favicon)" :image-props="{ src: link.favicon }"
alt="Social Media link" alt="Social Media link"
width="16" width="16"
height="16" height="16"
@ -105,9 +105,6 @@ export default {
this.$toast.success(this.$t('settings.social-media.success')), this.$toast.success(this.$t('settings.social-media.success')),
(this.value = '') (this.value = '')
) )
},
imageProps(favicon) {
return { src: favicon }
} }
} }
} }