Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions app/components/AppHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ const mobileLinks = computed<NavigationConfigWithGroups>(() => [
const showFullSearch = shallowRef(false)
const showMobileMenu = shallowRef(false)
const { env } = useAppConfig().buildInfo
const prId = env === 'preview' ? useRuntimeConfig().public.pullRequestID : undefined
Comment thread
btea marked this conversation as resolved.
Outdated

// On mobile, clicking logo+search button expands search
const route = useRoute()
Expand Down Expand Up @@ -227,6 +228,15 @@ onKeyStroke(
{{ env === 'release' ? 'alpha' : env }}
</span>
</NuxtLink>
<NuxtLink
v-if="prId"
:to="`https://github.com/npmx-dev/npmx.dev/pull/${prId}`"
:aria-label="`Open GitHub pull request ${prId}`"
>
<span class="text-xs px-1.5 py-0.5 rounded badge-green font-sans font-medium ms-2">
PR #{{ prId }}
</span>
</NuxtLink>
</div>
<!-- Spacer when logo is hidden on desktop -->
<span v-else class="hidden sm:block w-1" />
Expand Down
1 change: 1 addition & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export default defineNuxtConfig({
apiKey: 'f54e21fa3a2a0160595bb058179bfb1e',
indexName: 'npm-search',
},
pullRequestID: process.env.VERCEL_GIT_PULL_REQUEST_ID || undefined,
Comment thread
btea marked this conversation as resolved.
Outdated
},
},

Expand Down
Loading