Skip to content
Merged
Changes from 1 commit
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
Next Next commit
fix: changed text alignment and icon logic
Signed-off-by: Eduardo Morales <[email protected]>
  • Loading branch information
emoral435 committed Feb 29, 2024
commit 25eebd31ed4d6621177681089517df77a8976553
13 changes: 8 additions & 5 deletions apps/files/src/components/BreadCrumbs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
:aria-description="ariaForSection(section)"
@click.native="onClick(section.to)">
<template v-if="index === 0" #icon>
<NcIconSvgWrapper v-if="section.icon" :size="20" :svg="section.icon" />
<Home v-else :size="20"/>
<NcIconSvgWrapper :size="20"
:svg="viewIcon" />
</template>
</NcBreadcrumb>

Expand All @@ -53,7 +53,7 @@ import type { Node } from '@nextcloud/files'

import { translate as t} from '@nextcloud/l10n'
import { basename } from 'path'
import Home from 'vue-material-design-icons/Home.vue'
import homeSvg from '@mdi/svg/svg/home.svg?raw'
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'
Expand All @@ -68,7 +68,6 @@ export default defineComponent({
name: 'BreadCrumbs',

components: {
Home,
NcBreadcrumbs,
NcBreadcrumb,
NcIconSvgWrapper,
Expand Down Expand Up @@ -119,7 +118,6 @@ export default defineComponent({
exact: true,
name: this.getDirDisplayName(dir),
to,
icon: this.$navigation.active?.icon || null,
}
})
},
Expand All @@ -132,6 +130,11 @@ export default defineComponent({
shouldShowBreadcrumbs(): boolean {
return this.filesListWidth < 768 && !this.isUploadInProgress
},

// used to show the views icon for the first breadcrumb
viewIcon(): string {
return this.currentView?.icon ?? homeSvg
}
},

methods: {
Expand Down