Skip to content

Commit

Permalink
feat: enhance actor profile display with preferredUsername support
Browse files Browse the repository at this point in the history
  • Loading branch information
akhileshthite committed Mar 19, 2024
1 parent 0212347 commit f1d9aa1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions actor-profile.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
.profile-name {
color: var(--rdp-text-color);
font-weight: bold;
}

.profile-username {
color: var(--rdp-text-color);
margin-top: 1px;
margin-bottom: 10px;
}

Expand Down
7 changes: 7 additions & 0 deletions actor-profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ class ActorProfile extends HTMLElement {
actorContainer.appendChild(pName); // Append to the actor container
}

if (actorInfo.preferredUsername) {
const pUserName = document.createElement("div");
pUserName.classList.add("profile-username");
pUserName.textContent = `@${actorInfo.preferredUsername}`;
actorContainer.appendChild(pUserName); // Append to the actor container
}

// Instead of creating a button, create a FollowButton component
const followButton = document.createElement("follow-button");
followButton.setAttribute("url", this.url);
Expand Down

0 comments on commit f1d9aa1

Please sign in to comment.