Skip to content

Commit

Permalink
Fix breadcrumb
Browse files Browse the repository at this point in the history
  • Loading branch information
jlpereira committed Mar 27, 2023
1 parent 00aeba2 commit 661e9e2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 22 deletions.
26 changes: 8 additions & 18 deletions src/modules/otus/components/Breadcrumb/Breadcrumb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,26 @@
>
<IconArrowRight
v-if="index"
class="w-3 h-3 mr-0.5 ml-0.5 opacity-50"
class="w-3 h-3 mr-0.5 ml-0.5 opacity-50"
/>
<router-link
<router-link
v-if="item.length === 1"
class="
inline-flex
items-center
text-sm
text-accent-100
hover:text-gray-900
dark:hover:text-gray-500
text-secondary-color
"
class="inline-flex items-center text-sm text-accent-100 hover:text-gray-900 dark:hover:text-gray-500 text-secondary-color"
:to="{ name: 'otus-id', params: { id: item[0].id } }"
>
{{ key }}
</router-link>
<BreadcrumbDropdown
v-else
:list="item.map(o => ({ ...o, name: o.name || key }))"
v-else
:list="item.map((o) => ({ ...o, name: o.name || key }))"
>
{{ key }}
</BreadcrumbDropdown>
</li>

<li
class="inline-flex items-center ml-0 text-sm"
>
<li class="inline-flex items-center ml-0 text-sm">
<IconArrowRight class="w-3 h-3 mr-0.5 ml-0.5 opacity-50" />
<span v-html="current.name_string" />
<span v-html="current.full_name_tag" />
</li>
</ul>
</template>
Expand All @@ -55,4 +45,4 @@ defineProps({
required: true
}
})
</script>
</script>
5 changes: 2 additions & 3 deletions src/modules/otus/components/Breadcrumb/BreadcrumbDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<router-link
v-for="otu in list"
:key="otu.id"
class="block px-4 py-2 text-sm capitalize text-gray-700 dark:text-slate-400 hover:bg-gray-700 hover:text-white"
class="block px-4 py-2 text-sm capitalize hover:bg-secondary-color hover:bg-opacity-5"
:to="{ name: 'otus-id', params: { id: otu.id } }"
>
{{ otu.name || key }}
Expand All @@ -54,5 +54,4 @@ const props = defineProps({
})
const dropdownOpen = ref(false)
</script>
</script>
2 changes: 1 addition & 1 deletion src/modules/otus/views/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class="flex flex-col-reverse md:flex-row justify-between items-start"
>
<Breadcrumb
class="w-3/4"
class="w-4/4 md:w-3/4"
:list="otu.parents"
:current="taxon"
/>
Expand Down

0 comments on commit 661e9e2

Please sign in to comment.