Link from avatar to user
Build LinkLog Development Image / development-image (push) Successful in 13s
Build LinkLog Development Image / development-image (push) Successful in 13s
This commit is contained in:
@@ -146,12 +146,17 @@ function renderFeed(items, showIdentity = true) {
|
||||
if (showIdentity) {
|
||||
const header = document.createElement('div');
|
||||
header.className = 'link-header';
|
||||
header.appendChild(createAvatar(item.user));
|
||||
|
||||
const username = item.user?.username || 'unknown';
|
||||
const profileLink = document.createElement('a');
|
||||
profileLink.className = 'user-link';
|
||||
profileLink.href = `/${encodeURIComponent(username)}/`;
|
||||
profileLink.setAttribute('aria-label', `View ${username}'s profile`);
|
||||
profileLink.appendChild(createAvatar(item.user));
|
||||
const userName = document.createElement('div');
|
||||
userName.className = 'user-name';
|
||||
userName.textContent = item.user?.username || 'unknown';
|
||||
header.appendChild(userName);
|
||||
userName.textContent = username;
|
||||
profileLink.appendChild(userName);
|
||||
header.appendChild(profileLink);
|
||||
article.appendChild(header);
|
||||
}
|
||||
article.appendChild(title);
|
||||
|
||||
@@ -548,6 +548,12 @@ button:disabled {
|
||||
margin: 0 0 12px 18px;
|
||||
}
|
||||
|
||||
.user-link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
display: grid;
|
||||
width: 38px;
|
||||
@@ -592,7 +598,7 @@ button:disabled {
|
||||
}
|
||||
|
||||
.meta {
|
||||
margin-top: 14px;
|
||||
margin-top: 4px;
|
||||
color: var(--muted);
|
||||
font-size: 0.82rem;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user