File tree 3 files changed +21
-7
lines changed
components/contentDisplay
3 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import Avatar from "@/components/dataDisplay/avatar/Avatar";
3
3
import Link from "next/link" ;
4
4
import ViewerInfo from "@/components/dataDisplay/viewerInfo/ViewerInfo" ;
5
5
import { memo } from "react" ;
6
+ import { isInvalidHandle } from "@/lib/utils/text" ;
6
7
7
8
interface Props {
8
9
profile : ProfileView ;
@@ -37,9 +38,13 @@ const ProfileCard = memo(function ProfileCard(props: Props) {
37
38
) ) }
38
39
</ div >
39
40
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
+ ) }
43
48
</ div >
44
49
</ div >
45
50
</ div >
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import ProfileBio from "@/components/dataDisplay/profileBio/ProfileBio";
19
19
import usePreferences from "@/lib/hooks/bsky/actor/usePreferences" ;
20
20
import EditProfile from "@/components/actions/editProfile/EditProfile" ;
21
21
import JoinedDate from "@/components/dataDisplay/joinedDate/JoinedDate" ;
22
+ import { isInvalidHandle } from "@/lib/utils/text" ;
22
23
23
24
interface Props {
24
25
handle : string ;
@@ -142,9 +143,14 @@ export default function ProfileHeader(props: Props) {
142
143
) }
143
144
</ div >
144
145
</ 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
+
148
154
{ profile ?. description && (
149
155
< ProfileBio description = { profile . description } />
150
156
) }
Original file line number Diff line number Diff line change 1
1
import { JSONContent } from "@tiptap/react" ;
2
- import { AppBskyFeedThreadgate } from "@atproto/api" ;
3
2
4
3
export function getHandle ( mention : string ) {
5
4
return mention . slice ( 1 ) ;
@@ -27,6 +26,10 @@ export function getShortAddress(url: string) {
27
26
return text ;
28
27
}
29
28
29
+ export function isInvalidHandle ( handle : string ) : boolean {
30
+ return handle === "handle.invalid" ;
31
+ }
32
+
30
33
export function getNotificationLabel ( reason : string ) {
31
34
switch ( reason ) {
32
35
case "like" :
You can’t perform that action at this time.
0 commit comments