Skip to content

Commit ba044c9

Browse files
refactor: move block next to no results found
1 parent ab61f5a commit ba044c9

1 file changed

Lines changed: 21 additions & 21 deletions

File tree

app/pages/search.vue

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -604,25 +604,6 @@ defineOgImageComponent('Default', {
604604
<h1 class="font-mono text-2xl sm:text-3xl font-medium mb-4">
605605
{{ $t('search.title') }}
606606
</h1>
607-
<div
608-
v-if="hasTextLengthError"
609-
class="mb-6 p-4 bg-bg-subtle border border-border rounded-lg flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-4"
610-
>
611-
<div class="flex-1 min-w-0">
612-
<p class="font-mono text-sm text-fg">
613-
{{ $t('search.not_invalid') }}
614-
</p>
615-
<p class="text-xs text-fg-muted mt-0.5">
616-
{{ $t('search.not_invalid_description') }}
617-
</p>
618-
</div>
619-
<NuxtLink
620-
:to="{ name: 'package', params: { package: [query] } }"
621-
class="shrink-0 px-4 py-2 font-mono text-sm text-bg bg-fg rounded-md hover:text-fg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50"
622-
>
623-
{{ $t('search.not_invalid_button_label', { name: query }) }}
624-
</NuxtLink>
625-
</div>
626607

627608
<section v-if="query">
628609
<!-- Initial loading (only after user interaction, not during view transition) -->
@@ -727,8 +708,27 @@ defineOgImageComponent('Default', {
727708
</div>
728709

729710
<!-- No results found -->
730-
<div v-else-if="status !== 'pending' && !hasTextLengthError" role="status" class="py-12">
731-
<p class="text-fg-muted font-mono mb-6 text-center">
711+
<div v-else-if="status !== 'pending'" role="status" class="py-12">
712+
<div
713+
v-if="hasTextLengthError"
714+
class="mb-6 p-4 bg-bg-subtle border border-border rounded-lg flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-4"
715+
>
716+
<div class="flex-1 min-w-0">
717+
<p class="font-mono text-sm text-fg">
718+
{{ $t('search.not_invalid') }}
719+
</p>
720+
<p class="text-xs text-fg-muted mt-0.5">
721+
{{ $t('search.not_invalid_description') }}
722+
</p>
723+
</div>
724+
<NuxtLink
725+
:to="{ name: 'package', params: { package: [query] } }"
726+
class="shrink-0 px-4 py-2 font-mono text-sm text-bg bg-fg rounded-md hover:text-fg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50"
727+
>
728+
{{ $t('search.not_invalid_button_label', { name: query }) }}
729+
</NuxtLink>
730+
</div>
731+
<p v-else class="text-fg-muted font-mono mb-6 text-center">
732732
{{ $t('search.no_results', { query }) }}
733733
</p>
734734

0 commit comments

Comments
 (0)