From ec1e770feaef81574482b841bc04a286f9dc7249 Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Fri, 22 Mar 2024 12:59:35 +0100 Subject: [PATCH] Add the role ID to the badge component (#29707) --- app/javascript/mastodon/components/badge.jsx | 5 +++-- .../mastodon/features/account/components/header.jsx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/javascript/mastodon/components/badge.jsx b/app/javascript/mastodon/components/badge.jsx index 646655c249..5e0b2587bd 100644 --- a/app/javascript/mastodon/components/badge.jsx +++ b/app/javascript/mastodon/components/badge.jsx @@ -7,8 +7,8 @@ import PersonIcon from '@/material-icons/400-24px/person.svg?react'; import SmartToyIcon from '@/material-icons/400-24px/smart_toy.svg?react'; -export const Badge = ({ icon, label, domain }) => ( -
+export const Badge = ({ icon, label, domain, roleId }) => ( +
{icon} {label} {domain && {domain}} @@ -19,6 +19,7 @@ Badge.propTypes = { icon: PropTypes.node, label: PropTypes.node, domain: PropTypes.node, + roleId: PropTypes.string }; Badge.defaultProps = { diff --git a/app/javascript/mastodon/features/account/components/header.jsx b/app/javascript/mastodon/features/account/components/header.jsx index ecb1108ded..e9d6071a21 100644 --- a/app/javascript/mastodon/features/account/components/header.jsx +++ b/app/javascript/mastodon/features/account/components/header.jsx @@ -408,7 +408,7 @@ class Header extends ImmutablePureComponent { } account.get('roles', []).forEach((role) => { - badges.push({role.get('name')}} domain={domain} />); + badges.push({role.get('name')}} domain={domain} roleId={role.get('id')} />); }); return (