1
1
<template >
2
2
<main class =" flex flex-1 overflow-hidden" >
3
- <Head >
4
- <title >{{ $t('stats.head.title') }}</title >
5
- </Head >
6
3
<div class =" flex flex-1 flex-col overflow-y-auto xl:overflow-hidden" >
7
4
<!-- Mobile navigation -->
8
5
<Menu as =" nav" class =" relative inline-block text-left xl:hidden" >
9
6
<MenuButton
10
- class =" group w-full border-b border-gray-200 bg-white px-3.5 py-2 text-left text-sm font-medium text-gray-700 hover:bg-gray-200" >
11
- <span class =" flex w-full items-center justify-between" >
12
- <p class =" min-w-0 text-lg font-medium text-gray-900" >
13
- {{ tabs.find(({ active }) => active)?.label }}
14
- </p >
7
+ class =" group w-full border-b border-gray-200 bg-white px-6 py-4 text-gray-700 hover:bg-gray-200" >
8
+ <span class =" flex w-full flex-row items-start justify-between" >
9
+ <SvgIcon
10
+ aria-hidden =" true"
11
+ class =" h-6 w-6 shrink-0 text-indigo-400"
12
+ :path =" activeTab?.icon"
13
+ type =" mdi" />
14
+ <div class =" mx-3 text-left text-sm" >
15
+ <p class =" text-base font-medium text-gray-900" >{{ activeTab?.label }}</p >
16
+ <p class =" mt-1 text-gray-500" >{{ activeTab?.description }}</p >
17
+ </div >
15
18
16
19
<SvgIcon
17
20
aria-hidden =" true"
18
- class =" h-5 w-5 shrink-0 text-gray-400 group-hover:text-gray-500"
21
+ class =" ml-auto h-6 w-6 shrink-0 self-center text-gray-400 group-hover:text-gray-500"
19
22
:path =" mdiUnfoldMoreHorizontal"
20
23
type =" mdi" />
21
24
</span >
30
33
<MenuItems
31
34
class =" absolute inset-x-0 z-10 mt-1 origin-top divide-y divide-gray-200 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-[5%] focus:outline-none" >
32
35
<div class =" py-1" >
33
- <MenuItem v-for =" tab in tabs" :key =" tab.label" v-slot =" { close }" >
36
+ <MenuItem
37
+ v-for =" tab in tabs.filter(({ active }) => !active)"
38
+ :key =" tab.label"
39
+ v-slot =" { close }" >
34
40
<router-link
35
41
:aria-current =" tab.active ? 'page' : undefined"
36
42
:class =" [
37
43
tab.active ? 'bg-gray-100 text-gray-900' : 'text-gray-700',
38
- 'block px-4 py-2 text-sm ',
44
+ 'flex px-6 py-2',
39
45
]"
40
46
:to =" tab.to"
41
47
@click.capture =" close" >
42
- {{ tab.label }}
48
+ <SvgIcon
49
+ aria-hidden =" true"
50
+ class =" h-6 w-6 shrink-0 text-indigo-400"
51
+ :path =" tab.icon"
52
+ type =" mdi" />
53
+ <div class =" ml-3 overflow-hidden text-left text-sm" >
54
+ <p class =" font-medium text-gray-900" >{{ tab.label }}</p >
55
+ <p class =" mt-1 truncate text-gray-500" >
56
+ {{ tab.description }}
57
+ </p >
58
+ </div >
43
59
</router-link >
44
60
</MenuItem >
45
61
</div >
64
80
tab.active
65
81
? 'bg-indigo-50 bg-opacity-[50%]'
66
82
: 'hover:bg-indigo-50 hover:bg-opacity-[50%]',
67
- 'flex border-b border-gray-200 p-6',
83
+ 'group flex border-b border-gray-200 p-6 pr-3 ',
68
84
]"
69
85
:to =" tab.to" >
70
86
<SvgIcon
76
92
<p class =" font-medium text-gray-900" >{{ tab.label }}</p >
77
93
<p class =" mt-1 text-gray-500" >{{ tab.description }}</p >
78
94
</div >
95
+ <SvgIcon
96
+ aria-hidden =" true"
97
+ :class =" [
98
+ 'h-6 w-6 shrink-0 self-center text-gray-500 group-hover:text-gray-600 group-hover:!opacity-100',
99
+ tab.active ? 'opacity-80' : 'opacity-0',
100
+ ]"
101
+ :path =" mdiChevronRight"
102
+ type =" mdi" />
79
103
</router-link >
80
104
</div >
81
105
</nav >
93
117
import { doesRouteBelongsTo } from ' @/router/helpers' ;
94
118
import { ROUTE_NAMES } from ' @/router/names' ;
95
119
import { Menu , MenuButton , MenuItem , MenuItems } from ' @headlessui/vue' ;
96
- import { mdiCashMultiple , mdiHomeAnalytics , mdiUnfoldMoreHorizontal } from ' @mdi/js' ;
97
- import { Head } from ' @unhead/vue/components' ;
120
+ import {
121
+ mdiCashMultiple ,
122
+ mdiChevronRight ,
123
+ mdiHomeAnalytics ,
124
+ mdiUnfoldMoreHorizontal ,
125
+ } from ' @mdi/js' ;
98
126
import { computed } from ' vue' ;
99
127
import { useI18n } from ' vue-i18n' ;
100
128
import { useRoute } from ' vue-router' ;
@@ -121,4 +149,6 @@ const tabs = computed(() => [
121
149
active: doesRouteBelongsTo (route , ROUTE_NAMES .STATS .ACTIVITY ),
122
150
},
123
151
]);
152
+
153
+ const activeTab = computed (() => tabs .value .find ((tab ) => tab .active ));
124
154
</script >
0 commit comments