Skip to content

Commit fd81384

Browse files
committed
feat(frontend): update open source section and header
1 parent 853079c commit fd81384

File tree

13 files changed

+65
-44
lines changed

13 files changed

+65
-44
lines changed

frontend/src/assets/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
--input: 240 5.9% 90%;
2727
--ring: 240 5.9% 10%;
2828
--radius: 0.5rem;
29-
--sidebar-background: #090909;
29+
--sidebar-background: #0f0f0f;
3030
--sidebar-foreground: #f2f2f2;
3131
--sidebar-primary: 224.3 76.3% 48%;
3232
--sidebar-primary-foreground: 0 0% 100%;

frontend/src/components/HomePage/OpenSource.vue

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
11
<script lang="ts" setup>
2-
import { useFetch } from '@vueuse/core'
3-
import { GitBranch01, Star01 } from 'untitledui-js/vue'
4-
import { computed, ref } from 'vue'
2+
import { Star01 } from 'untitledui-js/vue'
53
64
import Github from '@/components/icons/Socials/Github.vue'
75
import { Button } from '@/components/ui/button'
86
import { openLink } from '@/utils'
9-
10-
const repoUrl = ref('https://api.github.com/repos/ValoryApp/Valory')
11-
const contributorsUrl = ref('https://api.github.com/repos/ValoryApp/Valory/contributors')
12-
13-
const { data: repoData } = useFetch(repoUrl).get().json()
14-
const { data: contributorsData } = useFetch(contributorsUrl).json()
15-
16-
const forksCount = computed(() => repoData.value?.forks_count ?? 0)
17-
const starsCount = computed(() => repoData.value?.stargazers_count ?? 0)
18-
const contributorsCount = computed(() => contributorsData.value?.length ?? 0)
197
</script>
208

219
<template>
@@ -28,19 +16,16 @@ const contributorsCount = computed(() => contributorsData.value?.length ?? 0)
2816
{{ $t('source.subtitle') }}
2917
</span>
3018
<div class="flex gap-2">
31-
<Button @click="openLink('https://github.com/ValoryApp/Valory')" class="px-6"
32-
>{{ $t('source.contribute') }} ({{ contributorsCount }})</Button
33-
>
34-
<Button variant="outline2" @click="openLink('https://github.com/ValoryApp/Valory/forks')">
35-
<GitBranch01 :size="22" />
36-
{{ forksCount }}
19+
<Button @click="openLink('https://github.com/ValoryApp/Valory')" class="px-6">
20+
<Github :size="16" color="#000" />
21+
{{ $t('source.contribute') }}
3722
</Button>
3823
<Button
3924
variant="outline2"
4025
@click="openLink('https://github.com/ValoryApp/Valory/stargazers')"
4126
>
42-
<Star01 color="#E3B341" :size="22" />
43-
{{ starsCount }}
27+
<Star01 color="#E3B341" :size="16" />
28+
{{ $t('source.star') }}
4429
</Button>
4530
</div>
4631
</section>

frontend/src/components/ui/AppSidebar.vue

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,11 @@ const data = NAV_DATA
2222

2323
<template>
2424
<Sidebar v-bind="props">
25-
<SidebarHeader
26-
class="flex flex-row justify-between p-4 group-data-[collapsible=icon]:justify-center"
27-
>
28-
<span
29-
@click="$router.push('/')"
30-
class="flex w-fit cursor-pointer items-center gap-3 group-data-[collapsible=icon]:hidden"
31-
>
25+
<SidebarHeader class="flex flex-row justify-start p-4">
26+
<span @click="$router.push('/')" class="flex w-fit cursor-pointer items-center gap-3">
3227
<Valory />
33-
<span class="font-valory group-data-[collapsible=icon]:hidden">VALORY</span>
28+
<span class="font-valory">VALORY</span>
3429
</span>
35-
<SidebarTrigger />
3630
</SidebarHeader>
3731
<SidebarContent class="text-lg">
3832
<NavMain title="Main" :items="data.navMain" />
@@ -41,6 +35,5 @@ const data = NAV_DATA
4135
<SidebarFooter>
4236
<NavUser :user="data.user" :buttons="data.buttons" />
4337
</SidebarFooter>
44-
<SidebarRail />
4538
</Sidebar>
4639
</template>

frontend/src/components/ui/Header.vue

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
<script setup lang="ts">
2+
import { useFetch } from '@vueuse/core'
3+
import { computed, ref } from 'vue'
4+
5+
import Github from '@/components/icons/Socials/Github.vue'
26
import Twitch from '@/components/icons/Socials/Twitch.vue'
37
import Valory from '@/components/icons/Valory.vue'
48
import LanguageSwitcher from '@/components/ui/LanguageSwitcher.vue'
59
import { Button } from '@/components/ui/button'
610
import { NAV_DATA } from '@/data/HeaderNav.data'
711
import router from '@/router'
8-
import { hidden } from '@/utils'
12+
import { hidden, openLink } from '@/utils'
913
import { moveTo } from '@/utils'
14+
15+
const repoUrl = ref('https://api.github.com/repos/ValoryApp/Valory')
16+
17+
const { data: repoData } = useFetch(repoUrl).get().json()
18+
19+
const starsCount = computed(() => repoData.value?.stargazers_count ?? 0)
1020
</script>
1121

1222
<template>
@@ -28,6 +38,13 @@ import { moveTo } from '@/utils'
2838
<Valory :size="30" />
2939
</div>
3040
<div class="right flex flex-row items-center gap-2">
41+
<Button
42+
class="rounded-full border border-transparent bg-transparent text-white opacity-50 transition hover:border-white/10 hover:bg-white/10 hover:opacity-100"
43+
@click="openLink('https://github.com/ValoryApp/Valory')"
44+
>
45+
<Github :size="16" />
46+
{{ starsCount }}
47+
</Button>
3148
<LanguageSwitcher />
3249
<Button class="text-sm" size="sm" @click="router.push('/dashboard')">
3350
{{ $t('nav.login') }}

frontend/src/components/ui/LanguageSwitcher.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ const currentLocale = useLocalStorage<string>('lang', 'en')
2222
<template>
2323
<DropdownMenu>
2424
<DropdownMenuTrigger as-child>
25-
<Button aria-label="Language switcher" variant="ghost" class="w-9 px-2">
25+
<Button
26+
aria-label="Language switcher"
27+
variant="ghost"
28+
class="h-fit w-9 rounded-full border border-transparent p-2 hover:border-white/10 hover:bg-white/10"
29+
>
2630
<Globe04 :size="16" />
2731
</Button>
2832
</DropdownMenuTrigger>

frontend/src/components/ui/NavUser.vue

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script setup lang="ts">
22
import { ChevronsUpDown, LogOut } from 'lucide-vue-next'
3+
import { DropdownMenuPortal } from 'radix-vue'
34
import { File05, Globe04, Lock01, Settings02 } from 'untitledui-js/vue'
45
56
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'
@@ -10,6 +11,9 @@ import {
1011
DropdownMenuItem,
1112
DropdownMenuLabel,
1213
DropdownMenuSeparator,
14+
DropdownMenuSub,
15+
DropdownMenuSubContent,
16+
DropdownMenuSubTrigger,
1317
DropdownMenuTrigger,
1418
} from '@/components/ui/dropdown-menu'
1519
import {
@@ -91,10 +95,22 @@ const { isMobile } = useSidebar()
9195
<Settings02 />
9296
Settings
9397
</DropdownMenuItem>
94-
<DropdownMenuItem>
95-
<Globe04 />
96-
Language
97-
</DropdownMenuItem>
98+
<DropdownMenuSub>
99+
<DropdownMenuSubTrigger>
100+
<Globe04 />
101+
Language
102+
</DropdownMenuSubTrigger>
103+
<DropdownMenuPortal>
104+
<DropdownMenuSubContent>
105+
<DropdownMenuItem>
106+
<span>Russian</span>
107+
</DropdownMenuItem>
108+
<DropdownMenuItem>
109+
<span>English</span>
110+
</DropdownMenuItem>
111+
</DropdownMenuSubContent>
112+
</DropdownMenuPortal>
113+
</DropdownMenuSub>
98114
</DropdownMenuGroup>
99115
<DropdownMenuSeparator />
100116
<DropdownMenuGroup>

frontend/src/components/ui/button/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const buttonVariants = cva(
1616
ghost: 'hover:bg-accent hover:text-accent-foreground',
1717
link: 'text-primary underline-offset-4 hover:underline',
1818
outline2:
19-
'border border-white/10 bg-[#19191A] px-3 text-[#F2F2F2] hover:border-white text-[#f2f2f2] shadow h-10 gap-1',
19+
'border border-white/10 bg-[#19191A] px-3 text-[#F2F2F2] hover:border-white/30 text-[#f2f2f2] shadow h-10 gap-2',
2020
},
2121
size: {
2222
default: 'h-10 px-4 py-2',

frontend/src/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const forwardedProps = useForwardProps(delegatedProps)
2424
v-bind="forwardedProps"
2525
:class="
2626
cn(
27-
'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent',
27+
'flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&>svg]:size-4 [&>svg]:shrink-0',
2828
props.class,
2929
)
3030
"

frontend/src/locales/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@
4545
},
4646
"source": {
4747
"title": "Open Source",
48+
"category": "Community-Driven Development",
4849
"subtitle": "Our application's source code is fully accessible on GitHub.\nWe welcome everyone to view, utilize, and contribute to its development.",
49-
"contribute": "Contribute"
50+
"contribute": "Contribute on Github",
51+
"star": "Star the Project"
5052
},
5153
"footer": {
5254
"left": {

frontend/src/locales/ru.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@
4545
},
4646
"source": {
4747
"title": "Открытый исходный код",
48-
"subtitle": "Исходный код нашего приложения полностью доступен на GitHub.\nМы приглашаем всех желающих ознакомиться с ним, использовать его и внести свой вклад в его разработку.",
49-
"contribute": "Участвовать"
48+
"category": "Разработка силами сообщества",
49+
"subtitle": "Исходный код нашего приложения полностью доступен на GitHub.\nМы приглашаем всех желающих ознакомиться с ним, использовать его\n и внести свой вклад в его разработку.",
50+
"contribute": "Внести свой вклад",
51+
"star": "Отметить звёздочкой"
5052
},
5153
"footer": {
5254
"left": {

0 commit comments

Comments
 (0)