feat(userVignette): add external badge when needed
This commit is contained in:
@@ -49,14 +49,6 @@ export function createPendingEmailVignette(email, size = 'sm') {
|
||||
const [local, domain] = trimmed.split('@');
|
||||
const synthName = local && domain ? `${local[0]} ${domain[0]}` : trimmed.slice(0, 2);
|
||||
avatar.textContent = _initials(synthName);
|
||||
|
||||
// Forced external badge — this is the whole point of the component.
|
||||
const badge = document.createElement('i');
|
||||
badge.className = 'user-vignette__origin user-vignette__origin--external fa-solid fa-building-circle-xmark';
|
||||
badge.title = 'External invitation';
|
||||
badge.setAttribute('aria-hidden', 'true');
|
||||
avatar.appendChild(badge);
|
||||
|
||||
wrapper.appendChild(avatar);
|
||||
|
||||
// The "name" for a pending invite is just the email itself — there
|
||||
@@ -66,5 +58,16 @@ export function createPendingEmailVignette(email, size = 'sm') {
|
||||
nameEl.textContent = trimmed;
|
||||
wrapper.appendChild(nameEl);
|
||||
|
||||
// Forced external badge — this is the whole point of the component.
|
||||
// Lives as a sibling at the end of the wrapper (mirrors the
|
||||
// userVignette layout) so it stays visible regardless of avatar
|
||||
// content (initials today, possibly a photo in a future "saved
|
||||
// email contact" mode).
|
||||
const badge = document.createElement('i');
|
||||
badge.className = 'user-vignette__origin user-vignette__origin--external fa-solid fa-building-circle-xmark';
|
||||
badge.title = 'External invitation';
|
||||
badge.setAttribute('aria-hidden', 'true');
|
||||
wrapper.appendChild(badge);
|
||||
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user