Skip to content

Commit 0e3d0e0

Browse files
committed
Merge branch 'preview'
2 parents b5d4d67 + 8debc42 commit 0e3d0e0

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

Diff for: src/components/contentDisplay/profileCard/ProfileCard.tsx

+8-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Avatar from "@/components/dataDisplay/avatar/Avatar";
33
import Link from "next/link";
44
import ViewerInfo from "@/components/dataDisplay/viewerInfo/ViewerInfo";
55
import { memo } from "react";
6+
import { isInvalidHandle } from "@/lib/utils/text";
67

78
interface Props {
89
profile: ProfileView;
@@ -37,9 +38,13 @@ const ProfileCard = memo(function ProfileCard(props: Props) {
3738
))}
3839
</div>
3940

40-
<h3 className="text-skin-tertiary break-all font-medium">
41-
@{profile?.handle}
42-
</h3>
41+
{isInvalidHandle(profile?.handle) ? (
42+
<ViewerInfo text="Invalid Handle" />
43+
) : (
44+
<h3 className="text-skin-tertiary break-all font-medium">
45+
@{profile?.handle}
46+
</h3>
47+
)}
4348
</div>
4449
</div>
4550
</div>

Diff for: src/components/contentDisplay/profileHeader/ProfileHeader.tsx

+9-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import ProfileBio from "@/components/dataDisplay/profileBio/ProfileBio";
1919
import usePreferences from "@/lib/hooks/bsky/actor/usePreferences";
2020
import EditProfile from "@/components/actions/editProfile/EditProfile";
2121
import JoinedDate from "@/components/dataDisplay/joinedDate/JoinedDate";
22+
import { isInvalidHandle } from "@/lib/utils/text";
2223

2324
interface Props {
2425
handle: string;
@@ -142,9 +143,14 @@ export default function ProfileHeader(props: Props) {
142143
)}
143144
</div>
144145
</div>
145-
<h2 className="text-skin-tertiary break-all font-medium">
146-
@{profile?.handle}
147-
</h2>
146+
{isInvalidHandle(profile?.handle) ? (
147+
<ViewerInfo text="Invalid Handle" />
148+
) : (
149+
<h2 className="text-skin-tertiary break-all font-medium">
150+
@{profile?.handle}
151+
</h2>
152+
)}
153+
148154
{profile?.description && (
149155
<ProfileBio description={profile.description} />
150156
)}

Diff for: src/lib/utils/text.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { JSONContent } from "@tiptap/react";
2-
import { AppBskyFeedThreadgate } from "@atproto/api";
32

43
export function getHandle(mention: string) {
54
return mention.slice(1);
@@ -27,6 +26,10 @@ export function getShortAddress(url: string) {
2726
return text;
2827
}
2928

29+
export function isInvalidHandle(handle: string): boolean {
30+
return handle === "handle.invalid";
31+
}
32+
3033
export function getNotificationLabel(reason: string) {
3134
switch (reason) {
3235
case "like":

0 commit comments

Comments
 (0)