Open source personal finance application
feat: add tooltip
Ilya Komichev79f9b0d7f9c0
diff --git a/app/components/layout/Sidebar.vue b/app/components/layout/Sidebar.vueindex 87a3fdf8..105064fb 100644--- a/app/components/layout/Sidebar.vue+++ b/app/components/layout/Sidebar.vue@@ -122,12 +122,17 @@ const isShowLogoMenu = ref(false)</div><div class="absolute bottom-1 left-1 hidden w-full items-center md:flex">- <UiItem1- class="z-10 text-4"- @click="emit('toggleSidebar')"+ <UTooltip+ :text="t('app.toggleSidebar')"+ :kbds="['Shift', 'D']">- <Icon :name="props.isShowSidebar ? 'lucide:panel-left-close' : 'lucide:panel-left'" size="18" />- </UiItem1>+ <UiItem1+ class="z-10 text-4"+ @click="emit('toggleSidebar')"+ >+ <Icon :name="props.isShowSidebar ? 'lucide:panel-left-close' : 'lucide:panel-left'" size="18" />+ </UiItem1>+ </UTooltip></div></aside></template>diff --git a/app/components/layout/SidebarMenu.vue b/app/components/layout/SidebarMenu.vueindex 50929c31..66c9cd92 100644--- a/app/components/layout/SidebarMenu.vue+++ b/app/components/layout/SidebarMenu.vue@@ -12,12 +12,18 @@ const { items } = useMenuData()<template><div>- <LayoutSidebarMenuItem+ <UTooltipv-for="(item, menuId) in items":key="menuId"- :item- :menuId- :isShowText- />+ :disabled="!item.tooltip"+ :text="item.tooltip?.text"+ :kbds="item.tooltip?.kbds"+ >+ <LayoutSidebarMenuItem+ :item+ :menuId+ :isShowText+ />+ </UTooltip></div></template>diff --git a/app/components/layout/useMenuData.ts b/app/components/layout/useMenuData.tsindex 4bfe053c..dc90ffd2 100644--- a/app/components/layout/useMenuData.ts+++ b/app/components/layout/useMenuData.ts@@ -7,6 +7,10 @@ import { useWalletsStore } from '~/components/wallets/useWalletsStore'export type MenuItem = {icon: stringname: string+ tooltip?: {+ kbds: string[]+ text: string+ }}export default function useMenuData() {@@ -22,6 +26,10 @@ export default function useMenuData() {trnForm: {icon: 'hugeicons:plus-sign-square',name: t('trnForm.createTrn'),+ tooltip: {+ text: t('trnForm.createTrn'),+ kbds: ['meta', 'G'],+ },},dashboard: {icon: 'lucide:chart-no-axes-combined',diff --git a/i18n/locales/en-US.js b/i18n/locales/en-US.jsindex 210c628f..208725a2 100644--- a/i18n/locales/en-US.js+++ b/i18n/locales/en-US.js@@ -10,6 +10,7 @@ export default {app: {desc: 'Finapp helps you to control personal finances easily and efficiently.',+ toggleSidebar: 'Toggle sidebar',},appName: 'Finapp',diff --git a/i18n/locales/ru-RU.js b/i18n/locales/ru-RU.jsindex 2ee54ecd..a5f210a9 100644--- a/i18n/locales/ru-RU.js+++ b/i18n/locales/ru-RU.js@@ -10,6 +10,7 @@ export default {app: {desc: 'Приложение для учета личных финансов',+ toggleSidebar: 'Скрыть/показать боковую панель',},appName: 'Финапка',