Society founder tag (#4871)

This commit is contained in:
Jaco Greeff 2021-03-19 15:54:11 +01:00 committed by GitHub
parent af5d26887c
commit 331f5cac01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -14,6 +14,7 @@ import { useTranslation } from '../translate';
interface Props {
className?: string;
isFounder?: boolean;
isHead?: boolean;
value: DeriveSocietyMember;
}
@ -23,7 +24,7 @@ const CANVAS_STYLE = {
margin: '0 auto'
};
function Member ({ className = '', isHead, value: { accountId, strikes } }: Props): React.ReactElement<Props> {
function Member ({ className = '', isFounder, isHead, value: { accountId, strikes } }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const { api } = useApi();
const suspended = useCall<bool>(api.query.society.suspendedMembers, [accountId]);
@ -50,10 +51,15 @@ function Member ({ className = '', isHead, value: { accountId, strikes } }: Prop
{isHead && (
<Tag
color='green'
hover={t<string>('Current society head, exempt')}
label={t<string>('society head')}
/>
)}
{isFounder && (
<Tag
color='green'
label={t<string>('society founder')}
/>
)}
{suspended?.isTrue && (
<Tag
color='yellow'

View File

@ -50,6 +50,7 @@ function Members ({ className = '', info }: Props): React.ReactElement<Props> {
>
{info && filtered && filtered.map((member): React.ReactNode => (
<Member
isFounder={info.founder?.eq(member.accountId)}
isHead={info.head?.eq(member.accountId)}
key={member.accountId.toString()}
value={member}