Show roles in account info

This commit is contained in:
Lim Chee Aun 2023-10-02 16:55:13 +08:00
parent 52c63690a3
commit 634e81e9d0

View file

@ -121,6 +121,7 @@ function AccountInfo({
username,
memorial,
moved,
roles,
} = info || {};
let headerIsAvatar = false;
let { header, headerStatic } = info || {};
@ -134,6 +135,12 @@ function AccountInfo({
}
}
const accountInstance = useMemo(() => {
if (!url) return null;
const domain = new URL(url).hostname;
return domain;
}, [url]);
const [headerCornerColors, setHeaderCornerColors] = useState([]);
const followersIterator = useRef();
@ -381,6 +388,17 @@ function AccountInfo({
<Icon icon="group" /> Group
</span>
)}
{roles?.map((role) => (
<span class="tag">
{role.name}
{!!accountInstance && (
<>
{' '}
<span class="more-insignificant">{accountInstance}</span>
</>
)}
</span>
))}
<div
class="note"
onClick={handleContentLinks({