Skip to content

Commit

Permalink
feat: hide tabs without data
Browse files Browse the repository at this point in the history
  • Loading branch information
ymarcon committed Feb 12, 2025
1 parent b7614f2 commit 3b63037
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions frontend/src/components/CampaignView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
active-color="secondary"
active-bg-color="light-blue-1"
indicator-color="secondary"
align="justify">
:align="tabAlignment">
<q-tab name="info" :label="t('info')" />
<q-tab name="references" :label="t('references')" />
<q-tab name="instruments" :label="t('instrument_measures')" />
<q-tab name="fundings" :label="t('funding')" />
<q-tab v-if="campaign.references?.length" name="references" :label="t('references')" />
<q-tab v-if="campaign.instruments?.length" name="instruments" :label="t('instrument_measures')" />
<q-tab v-if="campaign.fundings?.length" name="fundings" :label="t('funding')" />
</q-tabs>
<q-separator />
<q-tab-panels v-model="tab" animated>
Expand Down Expand Up @@ -187,6 +187,13 @@ const props = defineProps<Props>();
const tab = ref('info');
const slide = ref(1);
const tabAlignment = computed(() => {
if (props.campaign.references?.length || props.campaign.instruments?.length || props.campaign.fundings?.length) {
return 'justify';
}
return 'left';
});
const imageUrls = computed(() => {
return props.campaign.images ? props.campaign.images.map((image) => `${cdnUrl}/${image.path}`) : [];
});
Expand Down

0 comments on commit 3b63037

Please sign in to comment.