From 634e81e9d04dd25b7d5711d351edc3816883e020 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Mon, 2 Oct 2023 16:55:13 +0800 Subject: [PATCH] Show roles in account info --- src/components/account-info.jsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/components/account-info.jsx b/src/components/account-info.jsx index ebc55e48..3f3abeba 100644 --- a/src/components/account-info.jsx +++ b/src/components/account-info.jsx @@ -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({ Group )} + {roles?.map((role) => ( + + {role.name} + {!!accountInstance && ( + <> + {' '} + {accountInstance} + + )} + + ))}