Skip to content

Commit ec4edd6

Browse files
committed
move star button next to likes
1 parent 70b1b01 commit ec4edd6

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
@@ -910,42 +910,68 @@ const showSkeleton = shallowRef(false)
910910
class="self-baseline"
911911
/>
912912

913-
<!-- Package likes -->
914-
<TooltipApp
915-
:text="
916-
isLoadingLikeData
917-
? $t('common.loading')
918-
: likesData?.userHasLiked
919-
? $t('package.likes.unlike')
920-
: $t('package.likes.like')
921-
"
922-
position="bottom"
923-
class="items-center"
924-
strategy="fixed"
925-
>
926-
<ButtonBase
927-
@click="likeAction"
928-
size="small"
929-
:aria-label="
930-
likesData?.userHasLiked ? $t('package.likes.unlike') : $t('package.likes.like')
913+
<div class="flex gap-1.5">
914+
<!-- Package likes -->
915+
<TooltipApp
916+
:text="
917+
isLoadingLikeData
918+
? $t('common.loading')
919+
: likesData?.userHasLiked
920+
? $t('package.likes.unlike')
921+
: $t('package.likes.like')
931922
"
932-
:aria-pressed="likesData?.userHasLiked"
933-
:classicon="
934-
likesData?.userHasLiked
935-
? 'i-lucide:heart-minus text-red-500'
936-
: 'i-lucide:heart-plus'
923+
position="bottom"
924+
class="items-center"
925+
strategy="fixed"
926+
>
927+
<ButtonBase
928+
@click="likeAction"
929+
size="small"
930+
:aria-label="
931+
likesData?.userHasLiked ? $t('package.likes.unlike') : $t('package.likes.like')
932+
"
933+
:aria-pressed="likesData?.userHasLiked"
934+
:classicon="
935+
likesData?.userHasLiked
936+
? 'i-lucide:heart-minus text-red-500'
937+
: 'i-lucide:heart-plus'
938+
"
939+
>
940+
<span
941+
v-if="isLoadingLikeData"
942+
class="i-svg-spinners:ring-resize w-3 h-3 my-0.5"
943+
aria-hidden="true"
944+
/>
945+
<span v-else>
946+
{{ compactNumberFormatter.format(likesData?.totalLikes ?? 0) }}
947+
</span>
948+
</ButtonBase>
949+
</TooltipApp>
950+
951+
<TooltipApp
952+
v-if="isGitHubRepo && isGitHubConnected"
953+
:text="
954+
isStarred ? $t('package.github_star.unstar') : $t('package.github_star.star')
937955
"
956+
position="bottom"
957+
strategy="fixed"
938958
>
939-
<span
940-
v-if="isLoadingLikeData"
941-
class="i-svg-spinners:ring-resize w-3 h-3 my-0.5"
942-
aria-hidden="true"
943-
/>
944-
<span v-else>
945-
{{ compactNumberFormatter.format(likesData?.totalLikes ?? 0) }}
946-
</span>
947-
</ButtonBase>
948-
</TooltipApp>
959+
<ButtonBase
960+
@click="toggleStar"
961+
size="small"
962+
:title="
963+
isStarred ? $t('package.github_star.unstar') : $t('package.github_star.star')
964+
"
965+
:aria-label="
966+
isStarred ? $t('package.github_star.unstar') : $t('package.github_star.star')
967+
"
968+
:aria-pressed="isStarred"
969+
:disabled="isStarActionPending"
970+
:classicon="isStarred ? 'i-lucide:star text-yellow-400' : 'i-lucide:star'"
971+
>
972+
</ButtonBase>
973+
</TooltipApp>
974+
</div>
949975
</div>
950976
</div>
951977
</header>
@@ -976,31 +1002,7 @@ const showSkeleton = shallowRef(false)
9761002
</LinkBase>
9771003
</li>
9781004
<li v-if="repositoryUrl && repoMeta && starsLink">
979-
<TooltipApp
980-
v-if="isGitHubRepo && isGitHubConnected"
981-
:text="
982-
isStarred ? $t('package.github_star.unstar') : $t('package.github_star.star')
983-
"
984-
position="bottom"
985-
strategy="fixed"
986-
>
987-
<ButtonBase
988-
size="small"
989-
:title="
990-
isStarred ? $t('package.github_star.unstar') : $t('package.github_star.star')
991-
"
992-
:aria-label="
993-
isStarred ? $t('package.github_star.unstar') : $t('package.github_star.star')
994-
"
995-
:aria-pressed="isStarred"
996-
:disabled="isStarActionPending"
997-
:classicon="isStarred ? 'i-lucide:star text-yellow-400' : 'i-lucide:star'"
998-
@click="toggleStar"
999-
>
1000-
{{ compactNumberFormatter.format(stars) }}
1001-
</ButtonBase>
1002-
</TooltipApp>
1003-
<LinkBase v-else :to="starsLink" classicon="i-lucide:star">
1005+
<LinkBase :to="starsLink" classicon="i-lucide:star">
10041006
{{ compactNumberFormatter.format(stars) }}
10051007
</LinkBase>
10061008
</li>

0 commit comments

Comments
 (0)