Skip to content

Commit 906315c

Browse files
committed
move star button next to likes
1 parent c449d5d commit 906315c

1 file changed

Lines changed: 60 additions & 58 deletions

File tree

app/pages/package/[[org]]/[name].vue

Lines changed: 60 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -921,42 +921,68 @@ const showSkeleton = shallowRef(false)
921921
class="self-baseline"
922922
/>
923923

924-
<!-- Package likes -->
925-
<TooltipApp
926-
:text="
927-
isLoadingLikeData
928-
? $t('common.loading')
929-
: likesData?.userHasLiked
930-
? $t('package.likes.unlike')
931-
: $t('package.likes.like')
932-
"
933-
position="bottom"
934-
class="items-center"
935-
strategy="fixed"
936-
>
937-
<ButtonBase
938-
@click="likeAction"
939-
size="small"
940-
:aria-label="
941-
likesData?.userHasLiked ? $t('package.likes.unlike') : $t('package.likes.like')
924+
<div class="flex gap-1.5">
925+
<!-- Package likes -->
926+
<TooltipApp
927+
:text="
928+
isLoadingLikeData
929+
? $t('common.loading')
930+
: likesData?.userHasLiked
931+
? $t('package.likes.unlike')
932+
: $t('package.likes.like')
942933
"
943-
:aria-pressed="likesData?.userHasLiked"
944-
:classicon="
945-
likesData?.userHasLiked
946-
? 'i-lucide:heart-minus text-red-500'
947-
: 'i-lucide:heart-plus'
934+
position="bottom"
935+
class="items-center"
936+
strategy="fixed"
937+
>
938+
<ButtonBase
939+
@click="likeAction"
940+
size="small"
941+
:aria-label="
942+
likesData?.userHasLiked ? $t('package.likes.unlike') : $t('package.likes.like')
943+
"
944+
:aria-pressed="likesData?.userHasLiked"
945+
:classicon="
946+
likesData?.userHasLiked
947+
? 'i-lucide:heart-minus text-red-500'
948+
: 'i-lucide:heart-plus'
949+
"
950+
>
951+
<span
952+
v-if="isLoadingLikeData"
953+
class="i-svg-spinners:ring-resize w-3 h-3 my-0.5"
954+
aria-hidden="true"
955+
/>
956+
<span v-else>
957+
{{ compactNumberFormatter.format(likesData?.totalLikes ?? 0) }}
958+
</span>
959+
</ButtonBase>
960+
</TooltipApp>
961+
962+
<TooltipApp
963+
v-if="isGitHubRepo && isGitHubConnected"
964+
:text="
965+
isStarred ? $t('package.github_star.unstar') : $t('package.github_star.star')
948966
"
967+
position="bottom"
968+
strategy="fixed"
949969
>
950-
<span
951-
v-if="isLoadingLikeData"
952-
class="i-svg-spinners:ring-resize w-3 h-3 my-0.5"
953-
aria-hidden="true"
954-
/>
955-
<span v-else>
956-
{{ compactNumberFormatter.format(likesData?.totalLikes ?? 0) }}
957-
</span>
958-
</ButtonBase>
959-
</TooltipApp>
970+
<ButtonBase
971+
@click="toggleStar"
972+
size="small"
973+
:title="
974+
isStarred ? $t('package.github_star.unstar') : $t('package.github_star.star')
975+
"
976+
:aria-label="
977+
isStarred ? $t('package.github_star.unstar') : $t('package.github_star.star')
978+
"
979+
:aria-pressed="isStarred"
980+
:disabled="isStarActionPending"
981+
:classicon="isStarred ? 'i-lucide:star text-yellow-400' : 'i-lucide:star'"
982+
>
983+
</ButtonBase>
984+
</TooltipApp>
985+
</div>
960986
</div>
961987
</div>
962988
</header>
@@ -987,31 +1013,7 @@ const showSkeleton = shallowRef(false)
9871013
</LinkBase>
9881014
</li>
9891015
<li v-if="repositoryUrl && repoMeta && starsLink">
990-
<TooltipApp
991-
v-if="isGitHubRepo && isGitHubConnected"
992-
:text="
993-
isStarred ? $t('package.github_star.unstar') : $t('package.github_star.star')
994-
"
995-
position="bottom"
996-
strategy="fixed"
997-
>
998-
<ButtonBase
999-
size="small"
1000-
:title="
1001-
isStarred ? $t('package.github_star.unstar') : $t('package.github_star.star')
1002-
"
1003-
:aria-label="
1004-
isStarred ? $t('package.github_star.unstar') : $t('package.github_star.star')
1005-
"
1006-
:aria-pressed="isStarred"
1007-
:disabled="isStarActionPending"
1008-
:classicon="isStarred ? 'i-lucide:star text-yellow-400' : 'i-lucide:star'"
1009-
@click="toggleStar"
1010-
>
1011-
{{ compactNumberFormatter.format(stars) }}
1012-
</ButtonBase>
1013-
</TooltipApp>
1014-
<LinkBase v-else :to="starsLink" classicon="i-lucide:star">
1016+
<LinkBase :to="starsLink" classicon="i-lucide:star">
10151017
{{ compactNumberFormatter.format(stars) }}
10161018
</LinkBase>
10171019
</li>

0 commit comments

Comments
 (0)