From 206e32c3f2ad02910753db5a41adc923ce70cf6e Mon Sep 17 00:00:00 2001 From: Quentin Bellanger Date: Fri, 6 Sep 2024 15:58:42 +0200 Subject: [PATCH] add icon to transverse tab --- .../src/components/audit/AraTabs.vue | 10 +++------ .../src/components/icons/LayoutIcon.vue | 21 +++++++++++++++++++ .../src/pages/audit/AuditGenerationPage.vue | 2 +- 3 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 confiture-web-app/src/components/icons/LayoutIcon.vue diff --git a/confiture-web-app/src/components/audit/AraTabs.vue b/confiture-web-app/src/components/audit/AraTabs.vue index c2d0a67e..deb3a580 100644 --- a/confiture-web-app/src/components/audit/AraTabs.vue +++ b/confiture-web-app/src/components/audit/AraTabs.vue @@ -8,9 +8,10 @@ import { ref, watch } from "vue"; import { useUniqueId } from "../../composables/useUniqueId"; +import LayoutIcon from "../icons/LayoutIcon.vue"; const props = defineProps<{ - tabs: { label: string; data: T; icon?: string }[]; + tabs: { label: string; data: T; isTransverse?: boolean }[]; stickyTop: string; }>(); @@ -74,18 +75,13 @@ watch(currentTab, (currentTab) => { :aria-controls="panelId(i)" :aria-selected="i === currentTab ? 'true' : 'false'" :tabindex="i === currentTab ? undefined : '-1'" - :class="{ - 'fr-tabs__tab--icon-left': !!tab.icon, - ...(!!tab.icon && { - [`fr-icon-${tab.icon}`]: !!tab.icon - }) - }" @click="currentTab = i" @keydown.right.down.prevent="selectNextTab" @keydown.left.up.prevent="selectPreviousTab" @keydown.home.prevent="selectFirstTab" @keydown.end.prevent="selectLastTab" > + {{ tab.label }} diff --git a/confiture-web-app/src/components/icons/LayoutIcon.vue b/confiture-web-app/src/components/icons/LayoutIcon.vue new file mode 100644 index 00000000..0b36addf --- /dev/null +++ b/confiture-web-app/src/components/icons/LayoutIcon.vue @@ -0,0 +1,21 @@ + diff --git a/confiture-web-app/src/pages/audit/AuditGenerationPage.vue b/confiture-web-app/src/pages/audit/AuditGenerationPage.vue index 0732edbc..2a0ceda8 100644 --- a/confiture-web-app/src/pages/audit/AuditGenerationPage.vue +++ b/confiture-web-app/src/pages/audit/AuditGenerationPage.vue @@ -208,7 +208,7 @@ const tabsData = computed((): TabData[] => { auditStore.currentAudit?.pages.map((p) => ({ label: p.name, data: p, - icon: p.id === -1 ? "arrow-right-s-line-double" : null + isTransverse: p.id === -1 })) ?? [], (p) => p.data.order );