File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,14 +103,14 @@ useHead({
103103 />
104104 </button >
105105
106- <div >
106+ <span >
107107 <LinkBase :to =" `#${id}`" >
108108 {{ title }}
109109 </LinkBase >
110110 <span v-if =" subtitle" class =" block text-2xs normal-case tracking-normal opacity-70" >{{
111111 subtitle
112112 }}</span >
113- </div >
113+ </span >
114114 </component >
115115
116116 <!-- Actions slot for buttons or other elements -->
Original file line number Diff line number Diff line change 11<script setup lang="ts">
22const props = defineProps <{
33 modalTitle: string
4+ modalSubtitle? : string
45}>()
56
67const dialogRef = useTemplateRef (' dialogRef' )
@@ -50,9 +51,12 @@ defineExpose({
5051 >
5152 <!-- Modal top header section -->
5253 <div class =" flex items-center justify-between mb-6" >
53- <h2 :id =" modalTitleId" class =" font-mono text-lg font-medium" >
54- {{ modalTitle }}
55- </h2 >
54+ <div >
55+ <h2 :id =" modalTitleId" class =" font-mono text-lg font-medium" >
56+ {{ modalTitle }}
57+ </h2 >
58+ <p v-if =" modalSubtitle" class =" text-xs text-fg-subtle" >{{ modalSubtitle }}</p >
59+ </div >
5660 <ButtonBase
5761 type =" button"
5862 :aria-label =" $t('common.close')"
Original file line number Diff line number Diff line change 11<script setup lang="ts">
22const props = defineProps <{
33 modalTitle? : string
4+ modalSubtitle? : string
45}>()
56
67const emit = defineEmits <{
@@ -11,6 +12,7 @@ const emit = defineEmits<{
1112<template >
1213 <Modal
1314 :modalTitle =" modalTitle ?? $t('package.trends.title')"
15+ :modalSubtitle =" modalSubtitle"
1416 id =" chart-modal"
1517 class =" h-full sm:h-min sm:border sm:border-border sm:rounded-lg shadow-xl sm:max-h-[90vh] sm:max-w-3xl"
1618 @transitioned =" emit('transitioned')"
Original file line number Diff line number Diff line change @@ -28,6 +28,12 @@ const modalTitle = computed(() => {
2828 return $t (' package.trends.items.downloads' )
2929})
3030
31+ const modalSubtitle = computed (() => {
32+ const facet = route .query .facet as string | undefined
33+ if (facet === ' likes' || facet === ' contributors' ) return undefined
34+ return $t (' package.downloads.subtitle' )
35+ })
36+
3137const isChartModalOpen = shallowRef <boolean >(false )
3238
3339function handleModalClose() {
@@ -355,6 +361,7 @@ const config = computed<VueUiSparklineConfig>(() => {
355361 <PackageChartModal
356362 v-if =" isChartModalOpen && hasWeeklyDownloads"
357363 :modal-title =" modalTitle"
364+ :modal-subtitle =" modalSubtitle"
358365 @close =" handleModalClose"
359366 @transitioned =" handleModalTransitioned"
360367 >
You can’t perform that action at this time.
0 commit comments