tangled
alpha
login
or
join now
flo-bit.dev
/
blento
21
fork
atom
your personal website on atproto - mirror
blento.app
21
fork
atom
overview
issues
pulls
pipelines
updated blentos redirect to custom domains
Florian
1 month ago
6d62bc2f
f80b41ce
+13
-4
3 changed files
expand all
collapse all
unified
split
src
lib
atproto
methods.ts
cards
SpecialCards
UpdatedBlentos
UpdatedBlentosCard.svelte
website
CustomDomainModal.svelte
+3
-1
src/lib/atproto/methods.ts
···
104
104
export async function getBlentoOrBskyProfile(data: { did: Did; client?: Client }): Promise<
105
105
Awaited<ReturnType<typeof getDetailedProfile>> & {
106
106
hasBlento: boolean;
107
107
+
url?: string;
107
108
}
108
109
> {
109
110
let blentoProfile;
···
127
128
displayName: blentoProfile?.value?.name || response?.displayName || response?.handle,
128
129
avatar: (getCDNImageBlobUrl({ did: data?.did, blob: blentoProfile?.value?.icon }) ||
129
130
response?.avatar) as `${string}:${string}`,
130
130
-
hasBlento: Boolean(blentoProfile.value)
131
131
+
hasBlento: Boolean(blentoProfile.value),
132
132
+
url: blentoProfile?.value?.url as string | undefined
131
133
};
132
134
}
133
135
+8
-3
src/lib/cards/SpecialCards/UpdatedBlentos/UpdatedBlentosCard.svelte
···
6
6
7
7
let { item }: ContentComponentProps = $props();
8
8
9
9
+
type ProfileWithUrl = AppBskyActorDefs.ProfileViewDetailed & { url?: string };
10
10
+
9
11
const data = getAdditionalUserData();
10
12
// svelte-ignore state_referenced_locally
11
11
-
const profiles = data[item.cardType] as AppBskyActorDefs.ProfileViewDetailed[];
13
13
+
const profiles = data[item.cardType] as ProfileWithUrl[];
12
14
13
13
-
function getLink(profile: AppBskyActorDefs.ProfileViewDetailed): string {
14
14
-
if (profile.handle && profile.handle !== 'handle.invalid') {
15
15
+
function getLink(profile: ProfileWithUrl): string {
16
16
+
if (profile.url) {
17
17
+
return profile.url;
18
18
+
} else if (profile.handle && profile.handle !== 'handle.invalid') {
15
19
return `/${profile.handle}`;
16
20
} else {
17
21
return `/${profile.did}`;
···
26
30
href={getLink(profile)}
27
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"
28
32
target="_blank"
33
33
+
rel={profile.url ? 'nofollow noopener noreferrer' : undefined}
29
34
>
30
35
<Avatar src={profile.avatar} class="size-28" alt="" />
31
36
<div class="text-md line-clamp-1 max-w-full text-center font-bold">
+2
src/lib/website/CustomDomainModal.svelte
···
11
11
import { user } from '$lib/atproto';
12
12
import { Button, Input } from '@foxui/core';
13
13
import Modal from '$lib/components/modal/Modal.svelte';
14
14
+
import { launchConfetti } from '@foxui/visual';
14
15
15
16
let step: 'input' | 'instructions' | 'verifying' | 'success' | 'error' = $state('input');
16
17
let domain = $state('');
···
55
56
const data = await res.json();
56
57
57
58
if (data.success) {
59
59
+
launchConfetti();
58
60
step = 'success';
59
61
} else if (data.error) {
60
62
errorMessage = data.error;