@@ -10,6 +10,8 @@ import { Icons } from './Icons'
1010import SidebarButton from ' ./SidebarButton.vue'
1111import Popover from ' ./Popover.vue'
1212import MenuItems , { menuItem } from ' ./MenuItems.vue'
13+ import Tooltip from ' ./Tooltip.vue'
14+ import SlotRef from ' ./SlotRef.vue'
1315
1416const store = useStore ()
1517
@@ -44,60 +46,91 @@ const moreItems = computed(() => [
4446<template >
4547 <nav class =" nav" >
4648 <div class =" upper" >
47- <button
48- class =" nav-logo"
49- @click =" open(REPO_LINK)"
50- >
51- <img
52- title =" Go to Gitification repository"
53- draggable =" false"
54- src =" /src/assets/img/icon.png"
55- >
56- </button >
49+ <SlotRef >
50+ <template #default >
51+ <button
52+ class =" nav-logo"
53+ @click =" open(REPO_LINK)"
54+ >
55+ <img
56+ title =" Go to Gitification repository"
57+ draggable =" false"
58+ src =" /src/assets/img/icon.png"
59+ >
60+ </button >
61+ </template >
62+
63+ <template #ref =" { el } " >
64+ <Tooltip
65+ :target =" el"
66+ position =" right"
67+ text =" Navigate to repository"
68+ />
69+ </template >
70+ </SlotRef >
5771 </div >
72+
5873 <div class =" lower" >
59- <SidebarButton
60- v-if =" store.newRelease != null"
61- highlight
62- title =" An update is available"
63- @click =" open(`${REPO_RELEASES_LINK}/tag/${store.newRelease!.tag_name}`)"
64- >
65- <Icons .Download16 />
66- </SidebarButton >
67-
68- <SidebarButton
69- :disabled =" store.currentPage !== Page.Home"
70- title =" Reload notifications"
71- @click =" store.fetchNotifications(true)"
72- >
73- <Icons .Sync16 />
74- </SidebarButton >
75-
76- <!-- <SidebarButton
77- :disabled="store.currentPage === Page.Settings"
78- title="Go to settings"
79- @click="store.setPage(Page.Settings)"
80- >
81- <Icons.Gear16 />
82- </SidebarButton> -->
83-
84- <Popover
85- :wowerlayOptions =" {
86- position: 'right-end',
87- noBackground: true,
88- style: 'display: flex; flex-direction: column: flex-wrap: nowrap: gap: 5px; padding: 5px;',
89- }"
90- >
74+ <SlotRef v-if =" store.newRelease != null" >
9175 <template #default >
92- <SidebarButton title =" More" >
76+ <SidebarButton
77+ highlight
78+ @click =" open(`${REPO_RELEASES_LINK}/tag/${store.newRelease!.tag_name}`)"
79+ >
80+ <Icons .Download16 />
81+ </SidebarButton >
82+ </template >
83+
84+ <template #ref =" { el } " >
85+ <Tooltip
86+ :target =" el"
87+ position =" right"
88+ text =" A new version is available"
89+ />
90+ </template >
91+ </SlotRef >
92+
93+ <SlotRef >
94+ <template #default >
95+ <SidebarButton
96+ :disabled =" store.currentPage !== Page.Home"
97+ @click =" store.fetchNotifications(true)"
98+ >
99+ <Icons .Sync16 />
100+ </SidebarButton >
101+ </template >
102+
103+ <template #ref =" { el } " >
104+ <Tooltip
105+ :target =" el"
106+ position =" right"
107+ text =" Reload notifications"
108+ />
109+ </template >
110+ </SlotRef >
111+
112+ <SlotRef >
113+ <template #default >
114+ <SidebarButton >
93115 <Icons .More />
94116 </SidebarButton >
95117 </template >
96118
97- <template #content >
98- <MenuItems :items =" moreItems" />
119+ <template #ref =" { el } " >
120+ <Tooltip
121+ position =" right"
122+ :target =" el"
123+ text =" More"
124+ />
125+
126+ <Popover
127+ :target =" el"
128+ :wowerlayOptions =" { position: 'right-end' }"
129+ >
130+ <MenuItems :items =" moreItems" />
131+ </Popover >
99132 </template >
100- </Popover >
133+ </SlotRef >
101134 </div >
102135 </nav >
103136</template >
@@ -134,10 +167,10 @@ const moreItems = computed(() => [
134167.nav-logo {
135168 opacity : .8 ;
136169 @include focus-visible ;
137- border :1px solid black ;
138170 border-radius : 50% ;
139171 width : 30px ;
140172 height : 30px ;
173+ overflow : hidden ;
141174
142175 img {
143176 border-radius : 50% ;
0 commit comments