Skip to content

Commit

Permalink
UX
Browse files Browse the repository at this point in the history
  • Loading branch information
alexy-os committed Dec 3, 2024
1 parent 7301b12 commit fffca7a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
25 changes: 23 additions & 2 deletions src/components/sections/navbar/MainNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useRouter, useRoute } from 'vue-router'
import { Navbar, NavbarBrand, NavbarLayer } from '@/components/sections/navbar'
import { DarkMode } from '@/components/darkMode'
import { ThemingSettings } from '@/components/theming'
import { Home, ChevronsRight, PackageCheck, AlignRight } from 'lucide-vue-next'
import { Home, ChevronsRight, PackageCheck, AlignRight, Combine } from 'lucide-vue-next'
import {
NavigationMenu,
NavigationMenuList,
Expand All @@ -29,11 +29,20 @@ import {
} from '@/components/ui/accordion'
import { ScrollArea } from '@/components/ui/scroll-area'
import { Separator } from '@/components/ui/separator'
import { defineAsyncComponent } from 'vue'
import { defineAsyncComponent, ref, watch, onMounted } from 'vue'
import { useCollecty } from '@/composables/useCollecty'
const router = useRouter()
// const route = useRoute()
const { collection } = useCollecty()
const isButtonVisible = ref(false)
// Следим за изменениями в коллекции
watch(() => collection.value, (newCollection) => {
isButtonVisible.value = newCollection.length > 0
}, { immediate: true, deep: true })
interface RouteChild {
name: string
path: string
Expand Down Expand Up @@ -132,6 +141,18 @@ const menuDescription = 'Main navigation menu with all available sections and pa
<NavbarLayer position="end" data-navbar-end>
<div class="flex items-center gap-1 md:gap-2">

<Button
v-if="isButtonVisible"
variant="default"
size="sm"
class="bg-primary text-white mr-2"
aria-label="Go to builder"
@click="router.push('/buildy')"
>
<Combine :stroke-width="2.5" class="!w-3.5 !h-3.5" />
<span class="font-base">BuildY</span>
</Button>

<DarkMode data-dark-mode />
<ThemingSettings />

Expand Down
2 changes: 1 addition & 1 deletion src/components/theming/ThemingSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const sheetContent = {
icon: Puzzle,
label: 'Go to BuildY',
action: () => router.push('/buildy'),
class: 'bg-primary text-primary-foreground'
class: 'bg-primary text-white'
},
{
icon: LoaderCircle,
Expand Down

0 comments on commit fffca7a

Please sign in to comment.