Skip to content

Commit 15bf1e3

Browse files
committed
refactor: rename link variants
1 parent 037638a commit 15bf1e3

6 files changed

Lines changed: 18 additions & 12 deletions

File tree

app/components/Link/Base.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ const props = withDefaults(
1212
* If you want a button use `TagButton` instead.
1313
* */
1414
type?: never
15-
variant?: 'primary' | 'secondary' | 'tag'
15+
variant?: 'button-primary' | 'button-secondary' | 'tag'
1616
} &
1717
/** This makes sure the link always has either `to` or `href` */
1818
(Required<Pick<NuxtLinkProps, 'to'>> | Required<Pick<NuxtLinkProps, 'href'>>) &
1919
NuxtLinkProps
2020
>(),
21-
{ variant: 'secondary' },
21+
{ variant: 'button-secondary' },
2222
)
2323
</script>
2424

@@ -30,8 +30,8 @@ const props = withDefaults(
3030
'text-sm px-4 py-2': variant !== 'tag',
3131
'text-xs px-2 py-0.5': variant === 'tag',
3232
'bg-bg-muted text-fg-muted': variant === 'tag',
33-
'text-bg bg-fg': variant === 'primary',
34-
'bg-transparent text-fg': variant === 'secondary',
33+
'text-bg bg-fg': variant === 'button-primary',
34+
'bg-transparent text-fg': variant === 'button-secondary',
3535
}"
3636
><slot
3737
/></span>
@@ -42,8 +42,8 @@ const props = withDefaults(
4242
'text-sm px-4 py-2': variant !== 'tag',
4343
'text-xs px-2 py-0.5': variant === 'tag',
4444
'bg-bg-muted text-fg-muted hover:(text-fg border-border-hover)': variant === 'tag',
45-
'text-bg bg-fg hover:(bg-fg/90)': variant === 'primary',
46-
'bg-transparent text-fg hover:(bg-fg text-bg border-fg)': variant === 'secondary',
45+
'text-bg bg-fg hover:(bg-fg/90)': variant === 'button-primary',
46+
'bg-transparent text-fg hover:(bg-fg text-bg border-fg)': variant === 'button-secondary',
4747
}"
4848
:to="to"
4949
:href="href"

app/pages/@[org].vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ defineOgImageComponent('Default', {
234234
<p class="text-fg-muted mb-4">
235235
{{ error?.message ?? $t('org.page.failed_to_load') }}
236236
</p>
237-
<LinkBase to="/">{{ $t('common.go_back_home') }}</LinkBase>
237+
<LinkBase variant="button-secondary" to="/">{{ $t('common.go_back_home') }}</LinkBase>
238238
</div>
239239

240240
<!-- Empty state -->

app/pages/package-code/[...path].vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,9 @@ defineOgImageComponent('Default', {
359359
<!-- Error: no version -->
360360
<div v-if="!version" class="container py-20 text-center">
361361
<p class="text-fg-muted mb-4">{{ $t('code.version_required') }}</p>
362-
<LinkBase :to="packageRoute()">{{ $t('code.go_to_package') }}</LinkBase>
362+
<LinkBase variant="button-secondary" :to="packageRoute()">{{
363+
$t('code.go_to_package')
364+
}}</LinkBase>
363365
</div>
364366

365367
<!-- Loading state -->
@@ -371,7 +373,9 @@ defineOgImageComponent('Default', {
371373
<!-- Error state -->
372374
<div v-else-if="treeStatus === 'error'" class="container py-20 text-center" role="alert">
373375
<p class="text-fg-muted mb-4">{{ $t('code.failed_to_load_tree') }}</p>
374-
<LinkBase :to="packageRoute(version)">{{ $t('code.back_to_package') }}</LinkBase>
376+
<LinkBase variant="button-secondary" :to="packageRoute(version)">{{
377+
$t('code.back_to_package')
378+
}}</LinkBase>
375379
</div>
376380

377381
<!-- Main content: file tree + file viewer -->
@@ -473,6 +477,7 @@ defineOgImageComponent('Default', {
473477
{{ $t('code.file_size_warning', { size: formatBytes(currentNode?.size ?? 0) }) }}
474478
</p>
475479
<LinkBase
480+
variant="button-secondary"
476481
:href="`https://cdn.jsdelivr.net/npm/${packageName}@${version}/${filePath}`"
477482
target="_blank"
478483
rel="noopener noreferrer"
@@ -527,6 +532,7 @@ defineOgImageComponent('Default', {
527532
<p class="text-fg-muted mb-2">{{ $t('code.failed_to_load') }}</p>
528533
<p class="text-fg-subtle text-sm mb-4">{{ $t('code.unavailable_hint') }}</p>
529534
<LinkBase
535+
variant="button-secondary"
530536
:href="`https://cdn.jsdelivr.net/npm/${packageName}@${version}/${filePath}`"
531537
target="_blank"
532538
rel="noopener noreferrer"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ defineOgImageComponent('Package', {
11511151
<p class="text-fg-muted mb-8">
11521152
{{ error?.message ?? $t('package.not_found_message') }}
11531153
</p>
1154-
<LinkBase to="/">{{ $t('common.go_back_home') }}</LinkBase>
1154+
<LinkBase variant="button-secondary" to="/">{{ $t('common.go_back_home') }}</LinkBase>
11551155
</div>
11561156
</main>
11571157
</template>

app/pages/~[username]/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ defineOgImageComponent('Default', {
224224
<p class="text-fg-muted mb-4">
225225
{{ error?.message ?? $t('user.page.failed_to_load') }}
226226
</p>
227-
<LinkBase to="/">{{ $t('common.go_back_home') }}</LinkBase>
227+
<LinkBase variant="button-secondary" to="/">{{ $t('common.go_back_home') }}</LinkBase>
228228
</div>
229229

230230
<!-- Package list -->

app/pages/~[username]/orgs.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ defineOgImageComponent('Default', {
156156
<!-- Not own profile state -->
157157
<div v-else-if="!isOwnProfile" class="py-12 text-center">
158158
<p class="text-fg-muted">{{ $t('user.orgs_page.own_orgs_only') }}</p>
159-
<LinkBase :to="`/~${npmUser}/orgs`" class="mt-4">{{
159+
<LinkBase variant="button-secondary" :to="`/~${npmUser}/orgs`" class="mt-4">{{
160160
$t('user.orgs_page.view_your_orgs')
161161
}}</LinkBase>
162162
</div>

0 commit comments

Comments
 (0)