Browse Source

fix: Improved breadcrumb UI

pull/6539/head
Muhammed Mustafa 1 year ago
parent
commit
5e09c5cca3
  1. 4
      packages/nc-gui/components/general/ProjectIcon.vue
  2. 12
      packages/nc-gui/components/smartsheet/Topbar.vue
  3. 80
      packages/nc-gui/components/smartsheet/toolbar/ViewInfo.vue
  4. 2
      packages/nc-gui/utils/iconUtils.ts

4
packages/nc-gui/components/general/ProjectIcon.vue

@ -6,8 +6,8 @@ const { hoverable } = defineProps<{
</script> </script>
<template> <template>
<img <GeneralIcon
src="~/assets/nc-icons/database.svg" icon="ncDatabase"
class="text-[#2824FB] nc-project-icon" class="text-[#2824FB] nc-project-icon"
:class="{ :class="{
'nc-project-icon-hoverable': hoverable, 'nc-project-icon-hoverable': hoverable,

12
packages/nc-gui/components/smartsheet/Topbar.vue

@ -29,18 +29,10 @@ const isSharedBase = computed(() => route.value.params.typeOrId === 'base')
<GeneralOpenLeftSidebarBtn /> <GeneralOpenLeftSidebarBtn />
<LazySmartsheetToolbarViewInfo v-if="!isPublic" /> <LazySmartsheetToolbarViewInfo v-if="!isPublic" />
<div class="flex-1" /> <div v-if="!isSharedBase && !isMobileMode" class="w-47.5">
<div
v-if="!isSharedBase && !isMobileMode"
class="absolute mx-auto transition-all duration-150 right-0 w-47.5"
:class="{
'-left-1/10': isLeftSidebarOpen,
'-left-0': !isLeftSidebarOpen,
}"
>
<SmartsheetTopbarSelectMode /> <SmartsheetTopbarSelectMode />
</div> </div>
<div class="flex-1" />
<GeneralApiLoader v-if="!isMobileMode" /> <GeneralApiLoader v-if="!isMobileMode" />

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

@ -5,6 +5,8 @@ const { isMobileMode } = useGlobal()
const { openedViewsTab, activeView } = storeToRefs(useViewsStore()) const { openedViewsTab, activeView } = storeToRefs(useViewsStore())
const { project } = storeToRefs(useProject())
const { activeTable } = storeToRefs(useTablesStore()) const { activeTable } = storeToRefs(useTablesStore())
</script> </script>
@ -12,13 +14,31 @@ 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': !isMobileMode && activeView?.type !== ViewTypes.KANBAN, 'min-w-37/100 max-w-37/100': !isMobileMode && activeView?.type !== ViewTypes.KANBAN,
'min-w-1/4 max-w-1/4': !isMobileMode && activeView?.type === ViewTypes.KANBAN, 'min-w-1/4 max-w-1/4': !isMobileMode && activeView?.type === ViewTypes.KANBAN,
'w-2/3 text-base ml-1.5': isMobileMode, 'w-2/3 text-base ml-1.5': isMobileMode,
}" }"
> >
<template v-if="!isMobileMode">
<NcTooltip class="ml-0.75">
<template #title>
{{ project?.title }}
</template>
<div class="flex flex-row items-center gap-x-1.5">
<GeneralProjectIcon
:meta="{ type: project?.type }"
class="!grayscale"
:style="{
filter: 'grayscale(100%)',
}"
/>
<div class="text-gray-500">..</div>
</div>
</NcTooltip>
<div class="px-1.5 text-gray-500">/</div>
</template>
<template v-if="!(isMobileMode && !activeView?.is_default)"> <template v-if="!(isMobileMode && !activeView?.is_default)">
<LazyGeneralEmojiPicker :emoji="activeTable?.meta?.icon" readonly size="xsmall"> <LazyGeneralEmojiPicker v-if="isMobileMode" :emoji="activeTable?.meta?.icon" readonly size="xsmall">
<template #default> <template #default>
<MdiTable <MdiTable
class="min-w-5" class="min-w-5"
@ -29,35 +49,61 @@ const { activeTable } = storeToRefs(useTablesStore())
/> />
</template> </template>
</LazyGeneralEmojiPicker> </LazyGeneralEmojiPicker>
<span <NcTooltip
class="text-ellipsis overflow-hidden pl-1 text-gray-500" class="truncate nc-active-table-title"
:class="{ :class="{
'text-gray-500': !isMobileMode, 'max-w-1/3': !isMobileMode,
'text-gray-700 max-w-1/2': isMobileMode, 'max-w-1/4': isMobileMode,
}" }"
:style="{ wordBreak: 'keep-all', whiteSpace: 'nowrap', display: 'inline' }"
> >
{{ activeTable?.title }} <template #title>
</span> {{ activeTable?.title }}
</template>
<span
class="text-ellipsis overflow-hidden text-gray-500"
:class="{
'text-gray-500': !isMobileMode,
'text-gray-700': isMobileMode,
}"
:style="{
wordBreak: 'keep-all',
whiteSpace: 'nowrap',
display: 'inline',
}"
>
{{ activeTable?.title }}
</span>
</NcTooltip>
</template> </template>
<div v-if="!isMobileMode" class="px-2 text-gray-300">/</div> <div v-if="!isMobileMode" class="px-1 text-gray-500">/</div>
<template v-if="!(isMobileMode && activeView?.is_default)"> <template v-if="!(isMobileMode && activeView?.is_default)">
<LazyGeneralEmojiPicker :emoji="activeView?.meta?.icon" readonly size="xsmall"> <!-- <LazyGeneralEmojiPicker :emoji="activeView?.meta?.icon" readonly size="xsmall">
<template #default> <template #default>
<GeneralViewIcon :meta="{ type: activeView?.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 <NcTooltip
class="truncate pl-1.25 text-gray-700" class="truncate nc-active-view-title"
:class="{ :class="{
'max-w-28/100': !isMobileMode, 'max-w-1/3': !isMobileMode,
'max-w-1/4': isMobileMode,
}" }"
> >
{{ activeView?.is_default ? $t('title.defaultView') : activeView?.title }} <template #title>
</span> {{ activeView?.is_default ? $t('title.defaultView') : activeView?.title }}
</template>
<span
class="truncate pl-1.25 text-gray-800 font-medium"
:class="{
'max-w-28/100': !isMobileMode,
}"
>
{{ activeView?.is_default ? $t('title.defaultView') : activeView?.title }}
</span>
</NcTooltip>
</template> </template>
<LazySmartsheetToolbarReload v-if="openedViewsTab === 'view' && !isMobileMode" /> <LazySmartsheetToolbarReload v-if="openedViewsTab === 'view' && !isMobileMode" />

2
packages/nc-gui/utils/iconUtils.ts

@ -80,6 +80,7 @@ import PhTriangleFill from '~icons/ph/triangle-fill'
import LcSend from '~icons/lucide/send' import LcSend from '~icons/lucide/send'
import NcCommentHere from '~icons/nc-icons/comment-here' import NcCommentHere from '~icons/nc-icons/comment-here'
import NcAddDataSource from '~icons/nc-icons/add-data-source' import NcAddDataSource from '~icons/nc-icons/add-data-source'
import NcDatabaseIcon from '~icons/nc-icons/database'
// Roles // Roles
import MaterialSymbolsManageAccountsOutline from '~icons/material-symbols/manage-accounts-outline' import MaterialSymbolsManageAccountsOutline from '~icons/material-symbols/manage-accounts-outline'
@ -414,6 +415,7 @@ export const iconMap = {
heightExtra: NcIconsRowHeightExtraTall, heightExtra: NcIconsRowHeightExtraTall,
databaseSearch: MdiDatabaseSearch, databaseSearch: MdiDatabaseSearch,
layers: NcLayers, layers: NcLayers,
ncDatabase: NcDatabaseIcon,
magic: PhSparkleFill, magic: PhSparkleFill,
magic1: MdiMagicStaff, magic1: MdiMagicStaff,
workspace: h('span', { class: 'material-symbols' }, 'dataset'), workspace: h('span', { class: 'material-symbols' }, 'dataset'),

Loading…
Cancel
Save