mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-02 14:16:39 +01:00
Show roles in account info
This commit is contained in:
parent
52c63690a3
commit
634e81e9d0
1 changed files with 18 additions and 0 deletions
|
@ -121,6 +121,7 @@ function AccountInfo({
|
||||||
username,
|
username,
|
||||||
memorial,
|
memorial,
|
||||||
moved,
|
moved,
|
||||||
|
roles,
|
||||||
} = info || {};
|
} = info || {};
|
||||||
let headerIsAvatar = false;
|
let headerIsAvatar = false;
|
||||||
let { header, headerStatic } = info || {};
|
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 [headerCornerColors, setHeaderCornerColors] = useState([]);
|
||||||
|
|
||||||
const followersIterator = useRef();
|
const followersIterator = useRef();
|
||||||
|
@ -381,6 +388,17 @@ function AccountInfo({
|
||||||
<Icon icon="group" /> Group
|
<Icon icon="group" /> Group
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
|
{roles?.map((role) => (
|
||||||
|
<span class="tag">
|
||||||
|
{role.name}
|
||||||
|
{!!accountInstance && (
|
||||||
|
<>
|
||||||
|
{' '}
|
||||||
|
<span class="more-insignificant">{accountInstance}</span>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
))}
|
||||||
<div
|
<div
|
||||||
class="note"
|
class="note"
|
||||||
onClick={handleContentLinks({
|
onClick={handleContentLinks({
|
||||||
|
|
Loading…
Reference in a new issue