|
7 | 7 | interface Props { |
8 | 8 | selectedCountry: string | null; |
9 | 9 | selectedArtist: Artist | null; |
| 10 | + showBackButton?: boolean; |
10 | 11 | onCloseCountry: () => void; |
11 | 12 | onCloseArtist: () => void; |
12 | 13 | onArtistSelect: (artist: Artist) => void; |
13 | 14 | } |
14 | 15 |
|
15 | | - let { selectedCountry, selectedArtist, onCloseCountry, onCloseArtist, onArtistSelect }: Props = |
16 | | - $props(); |
| 16 | + let { |
| 17 | + selectedCountry, |
| 18 | + selectedArtist, |
| 19 | + showBackButton = false, |
| 20 | + onCloseCountry, |
| 21 | + onCloseArtist, |
| 22 | + onArtistSelect |
| 23 | + }: Props = $props(); |
17 | 24 |
|
18 | 25 | type State = 'closed' | 'country' | 'artist'; |
19 | 26 | type Detent = 'medium' | 'large'; |
|
389 | 396 | tabindex="-1" |
390 | 397 | > |
391 | 398 | <!-- Handle --> |
392 | | - <div class="flex shrink-0 justify-center py-2.5"> |
| 399 | + <div class="flex shrink-0 justify-center py-2.5 pb-0"> |
393 | 400 | <div class="h-1 w-10 rounded-full bg-black/15"></div> |
394 | 401 | </div> |
395 | 402 |
|
396 | 403 | <!-- Header: back-to-country button on artist (only if country context exists), country name on country state --> |
397 | | - <div class="relative flex shrink-0 items-center justify-between gap-2 px-4 pb-2"> |
| 404 | + <div class="relative flex shrink-0 items-center justify-between gap-2 px-4 pt-3 pb-2"> |
398 | 405 | <div class="relative h-7 min-w-0 flex-1"> |
399 | 406 | {#if selectedCountry} |
400 | 407 | <h3 |
|
406 | 413 | > |
407 | 414 | {selectedCountry} |
408 | 415 | </h3> |
409 | | - <button |
410 | | - class="absolute inset-y-0 left-0 flex cursor-pointer items-center gap-1 border-none bg-transparent px-0 text-[0.65rem] tracking-[0.15em] text-black/50 uppercase focus-ring transition-colors duration-150 hover:text-pink" |
411 | | - style="transform: translateX({100 * |
412 | | - (1 - |
413 | | - navProgress)}%); opacity: {navProgress}; transition: {navTransition}; pointer-events: {isArtistView |
414 | | - ? 'auto' |
415 | | - : 'none'};" |
416 | | - onclick={handleBack} |
417 | | - aria-label="Back to country list" |
418 | | - tabindex={isArtistView ? 0 : -1} |
419 | | - > |
420 | | - <svg |
421 | | - xmlns="http://www.w3.org/2000/svg" |
422 | | - width="14" |
423 | | - height="14" |
424 | | - viewBox="0 0 24 24" |
425 | | - fill="none" |
426 | | - stroke="currentColor" |
427 | | - stroke-width="2" |
428 | | - stroke-linecap="round" |
429 | | - stroke-linejoin="round" |
| 416 | + {#if showBackButton} |
| 417 | + <button |
| 418 | + class="absolute inset-y-0 left-0 flex cursor-pointer items-center gap-1 border-none bg-transparent px-0 text-[0.65rem] tracking-[0.15em] text-black/50 uppercase focus-ring transition-colors duration-150 hover:text-pink" |
| 419 | + style="transform: translateX({100 * |
| 420 | + (1 - |
| 421 | + navProgress)}%); opacity: {navProgress}; transition: {navTransition}; pointer-events: {isArtistView |
| 422 | + ? 'auto' |
| 423 | + : 'none'};" |
| 424 | + onclick={handleBack} |
| 425 | + aria-label="Back to country list" |
| 426 | + tabindex={isArtistView ? 0 : -1} |
430 | 427 | > |
431 | | - <polyline points="15 18 9 12 15 6"></polyline> |
432 | | - </svg> |
433 | | - <span class="truncate">{selectedCountry}</span> |
434 | | - </button> |
| 428 | + <svg |
| 429 | + xmlns="http://www.w3.org/2000/svg" |
| 430 | + width="14" |
| 431 | + height="14" |
| 432 | + viewBox="0 0 24 24" |
| 433 | + fill="none" |
| 434 | + stroke="currentColor" |
| 435 | + stroke-width="2" |
| 436 | + stroke-linecap="round" |
| 437 | + stroke-linejoin="round" |
| 438 | + > |
| 439 | + <polyline points="15 18 9 12 15 6"></polyline> |
| 440 | + </svg> |
| 441 | + </button> |
| 442 | + {/if} |
435 | 443 | {/if} |
436 | 444 | </div> |
437 | 445 |
|
|
0 commit comments