feat: v2 rewrite — hexagonal arch, ActivityPub federation, NATS, deployment-ready #1
@@ -29,8 +29,6 @@ export function RemoteUserProfile({
|
||||
const [followLoading, setFollowLoading] = useState(false);
|
||||
const { token } = useAuth();
|
||||
|
||||
type ConnectionTab = "posts" | "followers" | "following";
|
||||
const [activeTab, setActiveTab] = useState<ConnectionTab>("posts");
|
||||
const [followersActive, setFollowersActive] = useState(false);
|
||||
const [followingActive, setFollowingActive] = useState(false);
|
||||
|
||||
@@ -57,7 +55,6 @@ export function RemoteUserProfile({
|
||||
};
|
||||
|
||||
const handleTabChange = (tab: string) => {
|
||||
setActiveTab(tab as ConnectionTab);
|
||||
if (tab === "followers") setFollowersActive(true);
|
||||
if (tab === "following") setFollowingActive(true);
|
||||
};
|
||||
|
||||
@@ -12,6 +12,13 @@ interface ProfileCardProps {
|
||||
}
|
||||
|
||||
export function ProfileCard({ actor, action }: ProfileCardProps) {
|
||||
let hostname: string | null = null;
|
||||
try {
|
||||
if (actor.url) hostname = new URL(actor.url).hostname;
|
||||
} catch {
|
||||
hostname = actor.url;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="flex justify-between items-start">
|
||||
@@ -47,7 +54,7 @@ export function ProfileCard({ actor, action }: ProfileCardProps) {
|
||||
className="flex items-center overflow-hidden"
|
||||
>
|
||||
<ExternalLink className="mr-2 h-4 w-4 shrink-0" />
|
||||
<span className="truncate">{new URL(actor.url).hostname}</span>
|
||||
<span className="truncate">{hostname}</span>
|
||||
</Link>
|
||||
</Button>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user