Skip to content
This repository was archived by the owner on Jan 6, 2024. It is now read-only.

Commit 76222f5

Browse files
authored
feat: show description for npm packages when hovering (#194)
1 parent 34d0d0c commit 76222f5

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

packages/client/pages/npm.vue

+12-7
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,19 @@ useInfiniteScroll(
214214
<tr v-for="(item, index) in list" :key="index" class="group" h-8 border="b dashed transparent hover:base">
215215
<td text-sm op70>
216216
<div flex="inline gap3" items-center>
217-
<template v-if="item?.repository?.url">
218-
<a :href="item.repository.url" target="_blank" hover="text-primary">
217+
<VTooltip placement="top">
218+
<template v-if="item?.repository?.url">
219+
<a :href="item.repository.url" target="_blank" hover="text-primary">
220+
{{ item.name }}
221+
</a>
222+
</template>
223+
<template v-else>
219224
{{ item.name }}
220-
</a>
221-
</template>
222-
<template v-else>
223-
{{ item.name }}
224-
</template>
225+
</template>
226+
<template v-if="item?.description" #popper>
227+
{{ item?.description }}
228+
</template>
229+
</VTooltip>
225230
</div>
226231
</td>
227232
<VDropdown max-w="10" placement="bottom-start" :distance="5">

packages/client/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export interface DocumentInfo {
6565
export interface PackageInfo {
6666
name: string
6767
version: string
68-
descriptions: string
68+
description: string
6969
owner: {
7070
name: string
7171
link: string

0 commit comments

Comments
 (0)