Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
Hide tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
dzbo committed Oct 18, 2024
1 parent cc640cc commit ffcd631
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions domains/grid/components/GridTabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,21 @@ const { showModal } = useModal()
const { canEditGrid } = useGrid()
const tabs = computed<GridTab[]>(() => {
return props.grid.map(grid => {
return {
grid,
}
})
return (
props.grid
// filter out empty grids
.filter(grid => grid.grid.length > 0)
.map(grid => {
return {
grid,
}
})
)
})
// we only show tabs when user has more then one
const hasTabs = computed(() => tabs.value.length > 1)
const handleAddGrid = () => {
showModal({
template: 'AddEditGrid',
Expand All @@ -34,7 +42,7 @@ const handleAddGrid = () => {
</script>

<template>
<div class="pb-4">
<div v-if="hasTabs" class="pb-4">
<ul class="flex flex-wrap justify-start gap-x-6 gap-y-3">
<GridTabsItem
v-for="tab in tabs"
Expand Down

0 comments on commit ffcd631

Please sign in to comment.