your personal website on atproto - mirror blento.app

Merge pull request #138 from flo-bit/custom-domains

updated blentos redirect to custom domains

authored by Florian and committed by GitHub ef98dedc dddc492c

+13 -4
+3 -1
src/lib/atproto/methods.ts
··· 104 export async function getBlentoOrBskyProfile(data: { did: Did; client?: Client }): Promise< 105 Awaited<ReturnType<typeof getDetailedProfile>> & { 106 hasBlento: boolean; 107 } 108 > { 109 let blentoProfile; ··· 127 displayName: blentoProfile?.value?.name || response?.displayName || response?.handle, 128 avatar: (getCDNImageBlobUrl({ did: data?.did, blob: blentoProfile?.value?.icon }) || 129 response?.avatar) as `${string}:${string}`, 130 - hasBlento: Boolean(blentoProfile.value) 131 }; 132 } 133
··· 104 export async function getBlentoOrBskyProfile(data: { did: Did; client?: Client }): Promise< 105 Awaited<ReturnType<typeof getDetailedProfile>> & { 106 hasBlento: boolean; 107 + url?: string; 108 } 109 > { 110 let blentoProfile; ··· 128 displayName: blentoProfile?.value?.name || response?.displayName || response?.handle, 129 avatar: (getCDNImageBlobUrl({ did: data?.did, blob: blentoProfile?.value?.icon }) || 130 response?.avatar) as `${string}:${string}`, 131 + hasBlento: Boolean(blentoProfile.value), 132 + url: blentoProfile?.value?.url as string | undefined 133 }; 134 } 135
+8 -3
src/lib/cards/SpecialCards/UpdatedBlentos/UpdatedBlentosCard.svelte
··· 6 7 let { item }: ContentComponentProps = $props(); 8 9 const data = getAdditionalUserData(); 10 // svelte-ignore state_referenced_locally 11 - const profiles = data[item.cardType] as AppBskyActorDefs.ProfileViewDetailed[]; 12 13 - function getLink(profile: AppBskyActorDefs.ProfileViewDetailed): string { 14 - if (profile.handle && profile.handle !== 'handle.invalid') { 15 return `/${profile.handle}`; 16 } else { 17 return `/${profile.did}`; ··· 26 href={getLink(profile)} 27 class="bg-base-100 dark:bg-base-800 hover:bg-base-200 dark:hover:bg-base-700 accent:bg-accent-200/30 accent:hover:bg-accent-200/50 flex h-52 w-44 min-w-44 flex-col items-center justify-center gap-2 rounded-xl p-2 transition-colors duration-150" 28 target="_blank" 29 > 30 <Avatar src={profile.avatar} class="size-28" alt="" /> 31 <div class="text-md line-clamp-1 max-w-full text-center font-bold">
··· 6 7 let { item }: ContentComponentProps = $props(); 8 9 + type ProfileWithUrl = AppBskyActorDefs.ProfileViewDetailed & { url?: string }; 10 + 11 const data = getAdditionalUserData(); 12 // svelte-ignore state_referenced_locally 13 + const profiles = data[item.cardType] as ProfileWithUrl[]; 14 15 + function getLink(profile: ProfileWithUrl): string { 16 + if (profile.url) { 17 + return profile.url; 18 + } else if (profile.handle && profile.handle !== 'handle.invalid') { 19 return `/${profile.handle}`; 20 } else { 21 return `/${profile.did}`; ··· 30 href={getLink(profile)} 31 class="bg-base-100 dark:bg-base-800 hover:bg-base-200 dark:hover:bg-base-700 accent:bg-accent-200/30 accent:hover:bg-accent-200/50 flex h-52 w-44 min-w-44 flex-col items-center justify-center gap-2 rounded-xl p-2 transition-colors duration-150" 32 target="_blank" 33 + rel={profile.url ? 'nofollow noopener noreferrer' : undefined} 34 > 35 <Avatar src={profile.avatar} class="size-28" alt="" /> 36 <div class="text-md line-clamp-1 max-w-full text-center font-bold">
+2
src/lib/website/CustomDomainModal.svelte
··· 11 import { user } from '$lib/atproto'; 12 import { Button, Input } from '@foxui/core'; 13 import Modal from '$lib/components/modal/Modal.svelte'; 14 15 let step: 'input' | 'instructions' | 'verifying' | 'success' | 'error' = $state('input'); 16 let domain = $state(''); ··· 55 const data = await res.json(); 56 57 if (data.success) { 58 step = 'success'; 59 } else if (data.error) { 60 errorMessage = data.error;
··· 11 import { user } from '$lib/atproto'; 12 import { Button, Input } from '@foxui/core'; 13 import Modal from '$lib/components/modal/Modal.svelte'; 14 + import { launchConfetti } from '@foxui/visual'; 15 16 let step: 'input' | 'instructions' | 'verifying' | 'success' | 'error' = $state('input'); 17 let domain = $state(''); ··· 56 const data = await res.json(); 57 58 if (data.success) { 59 + launchConfetti(); 60 step = 'success'; 61 } else if (data.error) { 62 errorMessage = data.error;