Browse Source

fix: View icon fix

pull/6444/head
Muhammed Mustafa 1 year ago
parent
commit
51e2c9f2b5
  1. 22
      packages/nc-gui/components/smartsheet/toolbar/ViewInfo.vue

22
packages/nc-gui/components/smartsheet/toolbar/ViewInfo.vue

@ -1,9 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ViewTypes } from 'nocodb-sdk' import { ViewTypes } from 'nocodb-sdk'
import { ActiveViewInj, inject } from '#imports'
const selectedView = inject(ActiveViewInj) const { openedViewsTab, activeView } = storeToRefs(useViewsStore())
const { openedViewsTab } = storeToRefs(useViewsStore())
const { activeTable } = storeToRefs(useTablesStore()) const { activeTable } = storeToRefs(useTablesStore())
</script> </script>
@ -12,19 +10,13 @@ const { activeTable } = storeToRefs(useTablesStore())
<div <div
class="flex flex-row font-medium items-center border-gray-50 mt-0.5" class="flex flex-row font-medium items-center border-gray-50 mt-0.5"
:class="{ :class="{
'min-w-2/5 max-w-2/5': selectedView?.type !== ViewTypes.KANBAN, 'min-w-2/5 max-w-2/5': activeView?.type !== ViewTypes.KANBAN,
'min-w-1/4 max-w-1/4': selectedView?.type === ViewTypes.KANBAN, 'min-w-1/4 max-w-1/4': activeView?.type === ViewTypes.KANBAN,
}" }"
> >
<LazyGeneralEmojiPicker :emoji="activeTable?.meta?.icon" readonly size="xsmall"> <LazyGeneralEmojiPicker :emoji="activeTable?.meta?.icon" readonly size="xsmall">
<template #default> <template #default>
<MdiTable <MdiTable class="min-w-5 !text-gray-500" />
class="min-w-5 !text-gray-500"
:class="{
'!text-gray-500': !selectedView?.is_default,
'!text-gray-800 mr-0.25': selectedView?.is_default,
}"
/>
</template> </template>
</LazyGeneralEmojiPicker> </LazyGeneralEmojiPicker>
<span <span
@ -35,14 +27,14 @@ const { activeTable } = storeToRefs(useTablesStore())
</span> </span>
<div class="px-2 text-gray-300">/</div> <div class="px-2 text-gray-300">/</div>
<LazyGeneralEmojiPicker :emoji="selectedView?.meta?.icon" readonly size="xsmall"> <LazyGeneralEmojiPicker :emoji="activeView?.meta?.icon" readonly size="xsmall">
<template #default> <template #default>
<GeneralViewIcon :meta="{ type: selectedView?.type }" class="min-w-4.5 text-lg flex" /> <GeneralViewIcon :meta="{ type: activeView?.type }" class="min-w-4.5 text-lg flex" />
</template> </template>
</LazyGeneralEmojiPicker> </LazyGeneralEmojiPicker>
<span class="truncate pl-1.25 text-gray-700 max-w-28/100"> <span class="truncate pl-1.25 text-gray-700 max-w-28/100">
{{ selectedView?.is_default ? $t('title.defaultView') : selectedView?.title }} {{ activeView?.is_default ? $t('title.defaultView') : activeView?.title }}
</span> </span>
<LazySmartsheetToolbarReload v-if="openedViewsTab === 'view'" /> <LazySmartsheetToolbarReload v-if="openedViewsTab === 'view'" />

Loading…
Cancel
Save