Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enh: breadcrumbs icons are now more visually descriptive #43604

Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions apps/files/src/components/BreadCrumbs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@
v-bind="section"
dir="auto"
:to="section.to"
:force-icon-text="true"
:title="titleForSection(index, section)"
:aria-description="ariaForSection(section)"
@click.native="onClick(section.to)">
<template v-if="index === 0" #icon>
<Home :size="20"/>
<NcIconSvgWrapper v-if="section.icon" :size="20" :svg="section.icon" />
<Home v-else :size="20"/>
</template>
</NcBreadcrumb>

Expand All @@ -53,6 +55,7 @@ import { basename } from 'path'
import Home from 'vue-material-design-icons/Home.vue'
import NcBreadcrumb from '@nextcloud/vue/dist/Components/NcBreadcrumb.js'
import NcBreadcrumbs from '@nextcloud/vue/dist/Components/NcBreadcrumbs.js'
import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js'
import { defineComponent } from 'vue'

import { useFilesStore } from '../store/files.ts'
Expand All @@ -65,6 +68,7 @@ export default defineComponent({
Home,
NcBreadcrumbs,
NcBreadcrumb,
NcIconSvgWrapper,
},

props: {
Expand Down Expand Up @@ -105,6 +109,7 @@ export default defineComponent({
exact: true,
name: this.getDirDisplayName(dir),
to,
icon: this.$navigation.active?.icon || null,
}
})
},
Expand All @@ -119,7 +124,7 @@ export default defineComponent({
},
getDirDisplayName(path: string): string {
if (path === '/') {
return t('files', 'Home')
return this.$navigation?.active?.name || t('files', 'Home')
}

const fileId: number | undefined = this.getFileIdFromPath(path)
Expand Down
Loading