feat(frontend): show fediverse handle @user@domain on local user profiles
This commit is contained in:
@@ -105,6 +105,12 @@ export default async function ProfilePage({ params }: ProfilePageProps) {
|
|||||||
const isOwnProfile = me?.username === user.username;
|
const isOwnProfile = me?.username === user.username;
|
||||||
const isFollowing = user.isFollowedByViewer;
|
const isFollowing = user.isFollowedByViewer;
|
||||||
|
|
||||||
|
const apiDomain = process.env.NEXT_PUBLIC_API_URL
|
||||||
|
? new URL(process.env.NEXT_PUBLIC_API_URL).hostname
|
||||||
|
: null;
|
||||||
|
const fediverseHandle =
|
||||||
|
user.local && apiDomain ? `@${user.username}@${apiDomain}` : null;
|
||||||
|
|
||||||
const authorDetails = new Map<string, { avatarUrl?: string | null }>();
|
const authorDetails = new Map<string, { avatarUrl?: string | null }>();
|
||||||
authorDetails.set(user.username, { avatarUrl: user.avatarUrl });
|
authorDetails.set(user.username, { avatarUrl: user.avatarUrl });
|
||||||
|
|
||||||
@@ -182,6 +188,11 @@ export default async function ProfilePage({ params }: ProfilePageProps) {
|
|||||||
>
|
>
|
||||||
@{user.username}
|
@{user.username}
|
||||||
</p>
|
</p>
|
||||||
|
{fediverseHandle && (
|
||||||
|
<p className="text-xs text-muted-foreground/70 mt-0.5 font-mono select-all">
|
||||||
|
{fediverseHandle}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p
|
<p
|
||||||
|
|||||||
Reference in New Issue
Block a user