Skip to content

Commit

Permalink
enhancement: Improve Navbar to use new Nuxt UI Component (#262)
Browse files Browse the repository at this point in the history
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
HugoRCD and autofix-ci[bot] authored Nov 1, 2024
1 parent ee2ad40 commit 8a08891
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 66 deletions.
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/enhancement-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "🌈 Enhancement request"
description: Suggest an idea or enhancement for the project.
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Before requesting an enhancement, please make sure that you have read through our [documentation](https://shelve.hrcd.fr) and existing [issues](https://github.com/HugoRCD/shelve/issues) to see if the feature has already been requested or implemented. If it has, please add your reaction to the existing issue instead of creating a new one.
- type: textarea
id: description
attributes:
label: Description
description: A clear and concise description of what you think would be an helpful addition to the project, including the possible use cases and alternatives you have considered.
- type: textarea
id: additional
attributes:
label: Additional context
description: If applicable, add any other context or screenshots here.
16 changes: 15 additions & 1 deletion .github/workflows/continuous-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,32 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Check if there are changes
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
src:
- 'packages/cli/src/**'
- 'packages/cli/package.json'
- 'bun.lockb'
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: 📦 Install dependencies
- name: 📦 Install
if: steps.check.outputs.changed == 'true'
run: bun install

- name: 🚀 Prepare
if: steps.check.outputs.changed == 'true'
run: bun run dev:prepare

- name: 🛠️ Build
if: steps.check.outputs.changed == 'true'
run: bun run build

- name: 🚀 Continuous Release
if: steps.check.outputs.changed == 'true'
run: bunx pkg-pr-new publish './packages/cli'
32 changes: 0 additions & 32 deletions apps/shelve/app/components/landing/GithubStar.vue

This file was deleted.

71 changes: 44 additions & 27 deletions apps/shelve/app/components/layout/Navbar.vue
Original file line number Diff line number Diff line change
@@ -1,44 +1,61 @@
<script lang="ts" setup>
const navigation = getNavigation('home')
const items = navigation.map((item) => ({
...item,
to: item.path,
label: item.title,
slot: item.name.toLowerCase(),
}))
const githubStars = ref('0')
async function fetchRepo() {
try {
const res = await $fetch('https://ungh.cc/repos/hugorcd/shelve') as { repo: RepoType }
githubStars.value = res.repo.stars.toString()
} catch (e) { /* empty */ }
}
await fetchRepo()
const githubItem = {
label: 'GitHub',
icon: 'i-simple-icons-github',
badge: githubStars.value,
to: 'https://github.com/HugoRCD/shelve',
target: '_blank'
}
items.push(githubItem)
</script>

<template>
<div class="z-[99]">
<nav class="fixed top-0 flex w-full">
<div class="backdrop" />
<div class="z-50 flex w-full items-center justify-around p-4 sm:px-5 sm:py-2">
<div class="flex gap-2">
<div class="z-[99] relative">
<div class="fixed top-0 flex w-full">
<div class="fixed w-full top-0 z-40 h-40 bg-gradient-to-b from-neutral-950 to-transparent" />
<div class="z-50 flex w-full items-center justify-between sm:justify-around p-4 sm:px-5 sm:py-2">
<div class="flex items-center gap-4">
<NuxtLink to="/" class="font-newsreader text-2xl font-light italic">
Shelve
</NuxtLink>
<UDivider orientation="vertical" class="mx-2" />
<div class="flex items-center gap-3">
<NuxtLink
v-for="item in navigation"
:key="item.name"
class="font-geist-mono text-sm text-neutral-200 hover:text-neutral-400"
:to="item.path"
>
{{ item.name }}
</NuxtLink>
</div>
<UNavigationMenu :items color="neutral" class="hidden sm:flex" :ui="{ link: 'text-white' }">
<template #components-trailing>
<UBadge label="44" variant="subtle" size="sm" />
</template>
</UNavigationMenu>
</div>
<div class="flex items-center gap-5">
<LandingGithubStar class="hidden sm:flex" />
<div class="flex items-center gap-2">
<div class="flex sm:hidden">
<UDropdownMenu :items>
<UButton color="neutral" variant="ghost" icon="lucide:menu" />
</UDropdownMenu>
</div>
<AuthState>
<DropdownMenu />
</AuthState>
</div>
</div>
</nav>
</div>
</div>
</template>

<style scoped>
@import "tailwindcss";
.backdrop {
@apply absolute top-0 z-40 h-40;
@apply bg-gradient-to-b from-neutral-900 to-transparent;
}
</style>
10 changes: 5 additions & 5 deletions apps/shelve/app/utils/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ export type Navigation = {
name: string;
title: string;
path: string;
icon: string;
icon?: string;
};

export function getNavigation(where: Where): Navigation[] {
switch (where) {
case 'home':
return [
{ name: 'Home', path: '/', icon: 'heroicons:home', title: 'Home' },
{ name: 'Vault', path: '/vault', icon: 'lucide:share', title: 'Vault' },
{ name: 'Home', path: '/', title: 'Home' },
{ name: 'Vault', path: '/vault', title: 'Vault' },
/*{ name: 'Changelog', path: '/changelog', icon: 'i-heroicons-document-text', title: 'Changelog' },*/
{ name: 'Docs', path: '/docs', icon: 'heroicons:book-open', title: 'Docs' },
{ name: 'Roadmap', path: '/roadmap', icon: 'heroicons:clipboard-list', title: 'Roadmap' },
{ name: 'Docs', path: '/docs', title: 'Docs' },
{ name: 'Roadmap', path: '/roadmap', title: 'Roadmap' },
]
case 'app':
return [
Expand Down
2 changes: 1 addition & 1 deletion apps/shelve/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"devDependencies": {
"@iconify-json/heroicons": "^1.2.1",
"@iconify-json/lucide": "^1.2.10",
"@iconify-json/simple-icons": "^1.2.10",
"@nuxt/content": "^2.13.4",

"@nuxt/devtools": "^1.6.0",
"@nuxt/fonts": "^0.10.2",
"@nuxt/image": "^1.8.1",
Expand Down
Binary file modified bun.lockb
Binary file not shown.

0 comments on commit 8a08891

Please sign in to comment.