Profile redesign: Account name (#37527)

This commit is contained in:
Echo authored and GitHub committed 2026-01-20 11:10:46 +00:00
1 parent fa9b905fdf
commit a1c17fef3a
4 files changed
+140 -41

No files matched your search

@@ -1,3 +1,4 @@
import type { ReactNode } from 'react';
import { useState, useRef, useCallback, useId } from 'react';
import { FormattedMessage } from 'react-intl';
@@ -15,7 +16,9 @@ export const DomainPill: React.FC<{
domain: string;
username: string;
isSelf: boolean;
}> = ({ domain, username, isSelf }) => {
children?: ReactNode;
className?: string;
}> = ({ domain, username, isSelf, children, className }) => {
const accessibilityId = useId();
const [open, setOpen] = useState(false);
const [expanded, setExpanded] = useState(false);
@@ -32,7 +35,9 @@ export const DomainPill: React.FC<{
return (
<>
<button
className={classNames('account__domain-pill', { active: open })}
className={classNames('account__domain-pill', className, {
active: open,
})}
ref={triggerRef}
onClick={handleClick}
aria-expanded={open}
@@ -40,6 +45,7 @@ export const DomainPill: React.FC<{
type='button'
>
{domain}
{children}
</button>
<Overlay