Skip to content

Commit 9fa2f8f

Browse files
feat(breadcrumbs): replace > with icon & improved displayed parents description
1 parent 34f9439 commit 9fa2f8f

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

src/presentation/components/breadcrumbs/BreadCrumbs.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33
v-for="(parent, index) in displayedParents"
44
:key="index"
55
:to="{ path: parent.id ? `/note/${parent.id}` : '' }"
6+
class="breadcrumb"
67
>
78
{{ parent.content ? getTitle(parent.content) : '...' }}
8-
<span v-if="index < displayedParents.length - 1"> > </span>
9+
<Icon
10+
v-if="index < displayedParents.length - 1"
11+
name="ChevronRight"
12+
/>
913
</RouterLink>
1014
</template>
1115

@@ -15,12 +19,14 @@ import { getTitle } from '@/infrastructure/utils/note.ts';
1519
import { RouterLink } from 'vue-router';
1620
import { computed } from 'vue';
1721
import { Note } from '@/domain/entities/Note.ts';
22+
import { Icon } from '@codexteam/ui/vue';
1823
1924
const props = defineProps<{
2025
noteParents: Note[];
2126
}>();
2227
/**
23-
* Displayed parents
28+
* Note's parents hierarchy
29+
* If there are more than 3, only the closest & the furthest ones are shown
2430
*/
2531
const displayedParents = computed(() => {
2632
if (props.noteParents.length > 3) {
@@ -37,5 +43,8 @@ const displayedParents = computed(() => {
3743
</script>
3844

3945
<style scoped>
40-
46+
.breadcrumb {
47+
display: inline-flex;
48+
align-items: center;
49+
}
4150
</style>

0 commit comments

Comments
 (0)