|
8 | 8 | import UserAvatar from "$lib/sections/lists/components/UserAvatar.svelte"; |
9 | 9 | import { toLoadingState } from "$lib/utils/requests/toLoadingState"; |
10 | 10 | import { UrlBuilder } from "$lib/utils/url/UrlBuilder"; |
11 | | - import { map } from "rxjs"; |
12 | 11 |
|
13 | 12 | const { |
14 | 13 | slug, |
|
22 | 21 | } = $props(); |
23 | 22 |
|
24 | 23 | const profileQuery = $derived(useQuery(userProfileQuery({ slug }))); |
25 | | - const profile = $derived(profileQuery.pipe(map(($q) => $q.data))); |
| 24 | + const profile = $derived($profileQuery.data); |
26 | 25 |
|
27 | 26 | const now = new Date(); |
28 | 27 | const isAllTime = $derived(year === "all"); |
|
36 | 35 | : m.yir_title_year_in_review()), |
37 | 36 | ); |
38 | 37 |
|
39 | | - const isProfilePending = $derived( |
40 | | - profileQuery.pipe(map(($q) => toLoadingState($q))), |
41 | | - ); |
| 38 | + const isProfilePending = $derived(toLoadingState($profileQuery)); |
42 | 39 |
|
43 | | - const hasGradient = $derived(!$isProfilePending && !$profile?.cover?.url); |
44 | | - const coverSrc = $derived($profile?.cover?.url); |
| 40 | + const hasGradient = $derived(!isProfilePending && !profile?.cover?.url); |
| 41 | + const coverSrc = $derived(profile?.cover?.url); |
45 | 42 | </script> |
46 | 43 |
|
47 | 44 | <section class="trakt-yir-title-section" class:is-all-time={isAllTime}> |
|
52 | 49 | </div> |
53 | 50 | <div class="yir-titles-wrapper"> |
54 | 51 | <div class="yir-titles"> |
55 | | - {#if $profile} |
56 | | - <div class="yir-user"> |
| 52 | + <div class="yir-user"> |
| 53 | + {#if profile} |
57 | 54 | <span class="yir-avatar-link"> |
58 | | - <UserAvatar user={$profile} size="large" /> |
| 55 | + <UserAvatar user={profile} size="large" /> |
59 | 56 | </span> |
60 | 57 | <span class="yir-display-name"> |
61 | 58 | <Link href={UrlBuilder.profile.user(slug)} color="inherit"> |
62 | | - {$profile.name.full || $profile.username} |
| 59 | + {profile.name.full || profile.username} |
63 | 60 | </Link> |
64 | 61 | </span> |
65 | | - </div> |
66 | | - <div class="yir-under-user"></div> |
67 | | - {/if} |
| 62 | + {/if} |
| 63 | + </div> |
| 64 | + <div class="yir-under-user"></div> |
68 | 65 |
|
69 | 66 | <h1 class="yir-year" class:is-text={isAllTime}> |
70 | 67 | {isAllTime ? m.yir_label_all_time() : year} |
|
181 | 178 | display: inline-flex; |
182 | 179 | align-items: center; |
183 | 180 | gap: var(--ni-10); |
| 181 | + min-height: var(--ni-40); |
| 182 | +
|
| 183 | + @include for-mobile { |
| 184 | + min-height: var(--ni-30); |
| 185 | + } |
184 | 186 | } |
185 | 187 |
|
186 | 188 | .yir-avatar-link { |
|
0 commit comments