1
1
import { $ , component$ , useComputed$ , useContext } from '@builder.io/qwik' ;
2
- import { routeLoader$ , useLocation , useNavigate } from '@builder.io/qwik-city' ;
2
+ import {
3
+ Link ,
4
+ routeLoader$ ,
5
+ useLocation ,
6
+ useNavigate ,
7
+ } from '@builder.io/qwik-city' ;
3
8
import { Image } from 'qwik-image' ;
4
9
import { useTranslate } from 'qwik-speak' ;
5
10
import {
@@ -78,22 +83,22 @@ export default component$(() => {
78
83
</ div >
79
84
</ li >
80
85
< li class = "peer hidden sm:flex peer-[:nth-of-type(even)]:before:content-['/'] peer-[:nth-of-type(even)]:before:px-2 peer-[:nth-of-type(even)]:before:leading-5 last-of-type:flex last-of-type:before:font-normal last-of-type:before:text-neutral-500 text-neutral-500 last-of-type:text-neutral-900 last-of-type:font-medium" >
81
- < a
86
+ < Link
82
87
class = 'focus-visible:outline focus-visible:outline-offset focus-visible:rounded-sm underline hover:text-primary-800 active:text-primary-900 leading-5 no-underline hover:underline active:underline whitespace-nowrap outline-secondary-600 text-inherit'
83
88
data-testid = 'link'
84
89
href = '/'
85
90
>
86
91
{ t ( 'home' ) }
87
- </ a >
92
+ </ Link >
88
93
</ li >
89
94
< li class = "peer hidden sm:flex peer-[:nth-of-type(even)]:before:content-['/'] peer-[:nth-of-type(even)]:before:px-2 peer-[:nth-of-type(even)]:before:leading-5 last-of-type:flex last-of-type:before:font-normal last-of-type:before:text-neutral-500 text-neutral-500 last-of-type:text-neutral-900 last-of-type:font-medium" >
90
- < a
95
+ < Link
91
96
class = 'focus-visible:outline focus-visible:outline-offset focus-visible:rounded-sm underline hover:text-primary-800 active:text-primary-900 leading-5 no-underline hover:underline active:underline whitespace-nowrap outline-secondary-600 text-inherit'
92
97
data-testid = 'link'
93
98
href = '/category'
94
99
>
95
100
{ t ( 'allProducts' ) }
96
- </ a >
101
+ </ Link >
97
102
</ li >
98
103
</ ol >
99
104
</ nav >
@@ -139,7 +144,7 @@ export default component$(() => {
139
144
>
140
145
category
141
146
</ span >
142
- < a data-testid = 'category-tree-item' href = '/category' >
147
+ < Link data-testid = 'category-tree-item' href = '/category' >
143
148
< span
144
149
class = 'inline-flex items-center gap-2 w-full hover:bg-neutral-100 active:bg-neutral-200 cursor-pointer focus-visible:outline focus-visible:outline-offset focus-visible:relative focus-visible:z-10 p-4 md:sf-list-item-sm md:py-1.5 sf-list-item'
145
150
data-testid = 'list-item'
@@ -163,9 +168,9 @@ export default component$(() => {
163
168
</ span >
164
169
</ span >
165
170
</ span >
166
- </ a >
171
+ </ Link >
167
172
< div class = 'mt-4 mb-6 md:mt-2' data-testid = 'categories' >
168
- < a data-testid = 'category-tree-item' href = '/category' >
173
+ < Link data-testid = 'category-tree-item' href = '/category' >
169
174
< span
170
175
class = 'inline-flex items-center gap-2 w-full hover:bg-neutral-100 active:bg-neutral-200 cursor-pointer focus-visible:outline focus-visible:outline-offset focus-visible:relative focus-visible:z-10 p-4 md:sf-list-item-sm md:py-1.5 sf-list-item'
171
176
data-testid = 'list-item'
@@ -187,8 +192,8 @@ export default component$(() => {
187
192
</ span >
188
193
</ span >
189
194
</ span >
190
- </ a >
191
- < a data-testid = 'category-tree-item' href = '/category' >
195
+ </ Link >
196
+ < Link data-testid = 'category-tree-item' href = '/category' >
192
197
< span
193
198
class = 'inline-flex items-center gap-2 w-full hover:bg-neutral-100 active:bg-neutral-200 cursor-pointer focus-visible:outline focus-visible:outline-offset focus-visible:relative focus-visible:z-10 p-4 md:sf-list-item-sm md:py-1.5 sf-list-item'
194
199
data-testid = 'list-item'
@@ -210,8 +215,8 @@ export default component$(() => {
210
215
</ span >
211
216
</ span >
212
217
</ span >
213
- </ a >
214
- < a data-testid = 'category-tree-item' href = '/category' >
218
+ </ Link >
219
+ < Link data-testid = 'category-tree-item' href = '/category' >
215
220
< span
216
221
class = 'inline-flex items-center gap-2 w-full hover:bg-neutral-100 active:bg-neutral-200 cursor-pointer focus-visible:outline focus-visible:outline-offset focus-visible:relative focus-visible:z-10 p-4 md:sf-list-item-sm md:py-1.5 sf-list-item'
217
222
data-testid = 'list-item'
@@ -233,8 +238,8 @@ export default component$(() => {
233
238
</ span >
234
239
</ span >
235
240
</ span >
236
- </ a >
237
- < a data-testid = 'category-tree-item' href = '/category' >
241
+ </ Link >
242
+ < Link data-testid = 'category-tree-item' href = '/category' >
238
243
< span
239
244
class = 'inline-flex items-center gap-2 w-full hover:bg-neutral-100 active:bg-neutral-200 cursor-pointer focus-visible:outline focus-visible:outline-offset focus-visible:relative focus-visible:z-10 p-4 md:sf-list-item-sm md:py-1.5 sf-list-item'
240
245
data-testid = 'list-item'
@@ -256,8 +261,8 @@ export default component$(() => {
256
261
</ span >
257
262
</ span >
258
263
</ span >
259
- </ a >
260
- < a data-testid = 'category-tree-item' href = '/category' >
264
+ </ Link >
265
+ < Link data-testid = 'category-tree-item' href = '/category' >
261
266
< span
262
267
class = 'inline-flex items-center gap-2 w-full hover:bg-neutral-100 active:bg-neutral-200 cursor-pointer focus-visible:outline focus-visible:outline-offset focus-visible:relative focus-visible:z-10 p-4 md:sf-list-item-sm md:py-1.5 sf-list-item'
263
268
data-testid = 'list-item'
@@ -279,7 +284,7 @@ export default component$(() => {
279
284
</ span >
280
285
</ span >
281
286
</ span >
282
- </ a >
287
+ </ Link >
283
288
</ div >
284
289
< span
285
290
class = 'block py-2 px-4 mb-6 bg-neutral-100 typography-headline-6 font-bold text-neutral-900 uppercase tracking-widest md:rounded-md'
@@ -378,7 +383,7 @@ export default component$(() => {
378
383
data-testid = 'product-card'
379
384
>
380
385
< div class = 'relative' >
381
- < a
386
+ < Link
382
387
class = 'focus-visible:outline focus-visible:outline-offset focus-visible:rounded-sm text-primary-700 underline hover:text-primary-800 active:text-primary-900 relative block w-[230px] p-1'
383
388
data-testid = 'link'
384
389
href = { `/product/${ product . slug } ` }
@@ -393,23 +398,23 @@ export default component$(() => {
393
398
src = { product . image . url }
394
399
alt = { product . image . alt }
395
400
/>
396
- </ a >
401
+ </ Link >
397
402
</ div >
398
403
< div class = 'p-2 border-t border-neutral-200 typography-text-sm px-6 py-4' >
399
- < a
404
+ < Link
400
405
class = 'focus-visible:outline focus-visible:outline-offset focus-visible:rounded-sm underline hover:text-primary-800 active:text-primary-900 no-underline'
401
406
data-testid = 'link'
402
407
href = { `/product/${ product . slug } ` }
403
408
>
404
409
{ product . name }
405
- </ a >
410
+ </ Link >
406
411
< div class = 'flex items-center mt-2' >
407
412
< SfRating
408
413
size = 'xs'
409
414
value = { product . rating . average }
410
415
ariaLabel = { `${ product . rating . average } out of 5` }
411
416
/>
412
- < a
417
+ < Link
413
418
class = 'focus-visible:outline focus-visible:outline-offset focus-visible:rounded-sm underline hover:text-primary-800 active:text-primary-900 ml-1 no-underline'
414
419
data-testid = 'link'
415
420
href = '/category#'
@@ -420,7 +425,7 @@ export default component$(() => {
420
425
>
421
426
{ product . rating . count }
422
427
</ span >
423
- </ a >
428
+ </ Link >
424
429
</ div >
425
430
< p class = 'block py-2 font-normal typography-text-xs text-neutral-700 text-justify' > </ p >
426
431
< div class = 'flex items-center justify-between' >
0 commit comments