From d7d5c0291ce9e57da3cfdf8b207226857b9e5c9b Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sun, 30 Oct 2022 13:41:48 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Adds=20option=20for=20default=20ico?= =?UTF-8?q?n=20(#925)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/LinkItems/Item.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/LinkItems/Item.vue b/src/components/LinkItems/Item.vue index 581d4a7a..feafb75d 100644 --- a/src/components/LinkItems/Item.vue +++ b/src/components/LinkItems/Item.vue @@ -14,16 +14,16 @@ :style="customStyle" > -
+
{{ item.title }}

{{ item.description }}

- @@ -65,7 +65,6 @@ import MoveItemTo from '@/components/InteractiveEditor/MoveItemTo'; import ContextMenu from '@/components/LinkItems/ItemContextMenu'; import StoreKeys from '@/utils/StoreMutations'; import ItemMixin from '@/mixins/ItemMixin'; -// import { targetValidator } from '@/utils/ConfigHelpers'; import EditModeIcon from '@/assets/interface-icons/interactive-editor-edit-mode.svg'; import { modalNames } from '@/utils/defaults'; @@ -89,6 +88,10 @@ export default { EditModeIcon, }, computed: { + /* Returns either item.icon, or appConfig.defaultIcon, or null */ + itemIcon() { + return this.item.icon || this.$store.getters.appConfig?.defaultIcon; + }, makeColumnCount() { if ((this.sectionDisplayData || {}).itemCountX) return this.sectionDisplayData.itemCountX; if (this.sectionWidth < 380) return 1; @@ -101,8 +104,7 @@ export default { /* Based on item props, adjust class names */ makeClassList() { const { isAddNew, isEditMode, size } = this; - const { icon } = this.item; - return `size-${size} ${!icon ? 'short' : ''} ` + return `size-${size} ${!this.itemIcon ? 'short' : ''} ` + `${isAddNew ? 'add-new' : ''} ${isEditMode ? 'is-edit-mode' : ''}`; }, /* Used by certain themes (material), to show animated CSS icon */