Skip to content

Commit f788192

Browse files
committed
feat(dashboard): fix collapse animation in sidebar, remove social buttons to sidebar footer, add tooltips for social buttons, add faceit in overlays
1 parent 0ee868c commit f788192

File tree

10 files changed

+171
-145
lines changed

10 files changed

+171
-145
lines changed

frontend/src/App.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,3 @@ useSeoMeta({
4040
<template>
4141
<RouterView />
4242
</template>
43-
44-
<style scoped></style>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<script setup lang="ts">
2+
interface Props {
3+
size?: number
4+
color?: string
5+
}
6+
7+
const props = withDefaults(defineProps<Props>(), {
8+
size: 24,
9+
color: '#F2F2F2',
10+
})
11+
</script>
12+
<template>
13+
<svg
14+
:width="props.size"
15+
:height="props.size"
16+
viewBox="0 0 33 31"
17+
fill="none"
18+
xmlns="http://www.w3.org/2000/svg"
19+
>
20+
<path
21+
d="M32.5 0.890631C32.5 0.605881 32.1982 0.535756 32.0792 0.748256C28.2224 7.79688 25.9932 11.7834 24.068 15.483H0.930992C0.631367 15.483 0.510242 15.9101 0.750367 16.0525C10.3299 20.3238 24.1849 26.8029 31.956 30.3601C32.1366 30.4324 32.4979 30.2178 32.4979 30.0754V0.890631H32.5Z"
22+
:fill="props.color"
23+
/>
24+
</svg>
25+
</template>

frontend/src/components/ui/AppSidebar.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ const data = NAV_DATA
3434
</span>
3535
<SidebarTrigger />
3636
</SidebarHeader>
37-
<SidebarContent class="relative text-lg">
38-
<NavMain :items="data.navMain" />
39-
<NavExtra class="absolute bottom-0" :items="data.navExtra" :buttons="data.buttons" />
37+
<SidebarContent class="text-lg">
38+
<NavMain title="Main" :items="data.navMain" />
39+
<NavExtra title="Extra" :items="data.navExtra" :buttons="data.buttons" />
4040
</SidebarContent>
4141
<SidebarFooter>
42-
<NavUser :user="data.user" />
42+
<NavUser :user="data.user" :buttons="data.buttons" />
4343
</SidebarFooter>
4444
<SidebarRail />
4545
</Sidebar>
Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
<script setup lang="ts">
2-
import { Button } from '@/components/ui/button'
32
import {
43
SidebarGroup,
54
SidebarGroupLabel,
65
SidebarMenu,
76
SidebarMenuButton,
87
SidebarMenuItem,
98
} from '@/components/ui/sidebar'
10-
import { openLink } from '@/utils'
119
1210
defineProps<{
1311
title?: string
14-
buttons?: {
15-
icon: any
16-
url: string
17-
}[]
1812
items: {
1913
title: string
2014
url: string
@@ -25,7 +19,7 @@ defineProps<{
2519

2620
<template>
2721
<SidebarGroup class="overflow-x-hidden">
28-
<SidebarGroupLabel v-if="title" class="uppercase">{{ title }}</SidebarGroupLabel>
22+
<SidebarGroupLabel v-if="title">{{ title }}</SidebarGroupLabel>
2923
<SidebarMenu v-for="item in items" :key="item.title">
3024
<SidebarMenuItem>
3125
<SidebarMenuButton :tooltip="item.title" as-child>
@@ -36,19 +30,5 @@ defineProps<{
3630
</SidebarMenuButton>
3731
</SidebarMenuItem>
3832
</SidebarMenu>
39-
<div
40-
v-if="buttons"
41-
class="m-2 mb-0 flex max-w-[16rem] flex-row justify-between gap-3 group-data-[collapsible=icon]:flex-col group-data-[collapsible=icon]:items-center"
42-
>
43-
<Button
44-
class="h-8 w-8 bg-white/5"
45-
variant="ghost"
46-
v-for="button in buttons"
47-
:key="button.url"
48-
@click="openLink(button.url)"
49-
>
50-
<component :size="16" :is="button.icon" v-if="button.icon" />
51-
</Button>
52-
</div>
5333
</SidebarGroup>
5434
</template>

frontend/src/components/ui/NavMain.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ defineProps<{
3030

3131
<template>
3232
<SidebarGroup>
33-
<SidebarGroupLabel v-if="title" class="uppercase">{{ title }}</SidebarGroupLabel>
33+
<SidebarGroupLabel v-if="title">{{ title }}</SidebarGroupLabel>
3434
<SidebarMenu>
3535
<Collapsible
3636
v-for="item in items"

frontend/src/components/ui/NavUser.vue

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,38 @@ import {
1818
SidebarMenuItem,
1919
useSidebar,
2020
} from '@/components/ui/sidebar'
21+
import { openLink } from '@/utils'
2122
2223
const props = defineProps<{
2324
user: {
2425
name: string
2526
avatar: string
2627
}
28+
buttons?: {
29+
icon: any
30+
url: string
31+
}[]
2732
}>()
2833
2934
const { isMobile } = useSidebar()
3035
</script>
3136

3237
<template>
3338
<SidebarMenu>
39+
<div
40+
v-if="buttons"
41+
class="m-2 mb-0 flex max-w-[16rem] flex-row justify-between gap-3 group-data-[collapsible=icon]:m-0 group-data-[collapsible=icon]:mb-3 group-data-[collapsible=icon]:flex-col group-data-[collapsible=icon]:items-start"
42+
>
43+
<SidebarMenuButton
44+
class="h-8 w-8 bg-white/5"
45+
v-for="button in buttons"
46+
:key="button.url"
47+
@click="openLink(button.url)"
48+
:tooltip="button.title"
49+
>
50+
<component :size="16" :is="button.icon" v-if="button.icon" />
51+
</SidebarMenuButton>
52+
</div>
3453
<SidebarMenuItem>
3554
<DropdownMenu>
3655
<DropdownMenuTrigger as-child>

frontend/src/components/ui/sidebar/Sidebar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const { isMobile, state, openMobile, setOpenMobile } = useSidebar()
8484
>
8585
<div
8686
data-sidebar="sidebar"
87-
class="flex h-full w-full flex-col bg-sidebar text-sidebar-foreground group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow"
87+
class="flex h-full w-full flex-col gap-2 bg-sidebar text-sidebar-foreground group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow"
8888
>
8989
<slot />
9090
</div>

frontend/src/components/ui/sidebar/SidebarGroupLabel.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ const props = defineProps<
1111
}
1212
>()
1313
</script>
14-
1514
<template>
1615
<Primitive
1716
data-sidebar="group-label"
1817
:as="as"
1918
:as-child="asChild"
2019
:class="
2120
cn(
22-
'text-sidebar-foreground/70 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
21+
'text-sidebar-foreground/70 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium uppercase text-white/60 outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
2322
'group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0',
2423
props.class,
2524
)

frontend/src/data/dashboard/HeaderNav.data.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { BookClosed, Hearts, HelpCircle, HomeLine, LayersThree01, Link03 } from 'untitledui-js/vue'
22

33
import Discord from '@/components/icons/Socials/Discord.vue'
4+
import Faceit from '@/components/icons/Socials/Faceit.vue'
45
import Github from '@/components/icons/Socials/Github.vue'
56
import Spotify from '@/components/icons/Socials/Spotify.vue'
67
import Telegram from '@/components/icons/Socials/Telegram.vue'
@@ -33,6 +34,7 @@ interface User {
3334
}
3435

3536
interface Button {
37+
title: string
3638
icon: any
3739
url: string
3840
}
@@ -60,13 +62,18 @@ export const NAV_DATA: NavData = {
6062
title: 'Overlays',
6163
url: '#',
6264
icon: LayersThree01,
63-
isActive: true,
65+
isActive: false,
6466
items: [
6567
{
6668
title: 'Valorant',
6769
url: '#',
6870
icon: Valorant,
6971
},
72+
{
73+
title: 'Faceit',
74+
url: '#',
75+
icon: Faceit,
76+
},
7077
{
7178
title: 'Spotify',
7279
url: '#',
@@ -99,22 +106,27 @@ export const NAV_DATA: NavData = {
99106
],
100107
buttons: [
101108
{
109+
title: 'Github',
102110
icon: Github,
103111
url: 'https://github.com/ValoryApp/Valory',
104112
},
105113
{
114+
title: 'Twitch',
106115
icon: Twitch,
107116
url: 'https://twitch.tv/MAGICXcmd',
108117
},
109118
{
119+
title: 'Discord',
110120
icon: Discord,
111121
url: 'https://discord.gg/valory',
112122
},
113123
{
124+
title: 'Telegram',
114125
icon: Telegram,
115126
url: 'https://t.me/magicxcmd',
116127
},
117128
{
129+
title: 'Donate',
118130
icon: Hearts,
119131
url: 'https://www.donationalerts.com/r/haxgun',
120132
},

0 commit comments

Comments
 (0)