mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-08-01 23:25:43 +00:00
feat: initial Pezkuwi Apps rebrand from polkadot-apps
Rebranded terminology: - Polkadot → Pezkuwi - Kusama → Dicle - Westend → Zagros - Rococo → PezkuwiChain - Substrate → Bizinikiwi - parachain → teyrchain Custom logos with Kurdistan brand colors (#e6007a → #86e62a): - bizinikiwi-hexagon.svg - sora-bizinikiwi.svg - hezscanner.svg - heztreasury.svg - pezkuwiscan.svg - pezkuwistats.svg - pezkuwiassembly.svg - pezkuwiholic.svg
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
// Copyright 2017-2025 @pezkuwi/app-ranked authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { FlagColor } from '@pezkuwi/react-components/types';
|
||||
import type { Member as MemberType } from '../types.js';
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { AddressSmall, Tag } from '@pezkuwi/react-components';
|
||||
|
||||
import { useTranslation } from '../translate.js';
|
||||
|
||||
interface Props {
|
||||
className?: string;
|
||||
value: MemberType;
|
||||
}
|
||||
|
||||
const COLOR_LST: FlagColor[] = ['grey', 'grey', 'yellow', 'orange', 'purple', 'blue', 'green', 'black'];
|
||||
const COLOR_DEF = COLOR_LST[COLOR_LST.length - 1];
|
||||
|
||||
function Member ({ className, value: { accountId, info: { rank } } }: Props): React.ReactElement<Props> {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<tr className={className}>
|
||||
<td className='address all relative'>
|
||||
<AddressSmall value={accountId} />
|
||||
<Tag
|
||||
className='absolute'
|
||||
color={COLOR_LST[rank.toNumber()] || COLOR_DEF}
|
||||
hover={t('Membership rank')}
|
||||
label={rank.toString()}
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
);
|
||||
}
|
||||
|
||||
export default React.memo(Member);
|
||||
@@ -0,0 +1,33 @@
|
||||
// Copyright 2017-2025 @pezkuwi/app-referenda authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Member as MemberType } from '../types.js';
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { CardSummary, SummaryBox } from '@pezkuwi/react-components';
|
||||
import { formatNumber } from '@pezkuwi/util';
|
||||
|
||||
import { useTranslation } from '../translate.js';
|
||||
|
||||
interface Props {
|
||||
className?: string;
|
||||
members?: MemberType[];
|
||||
}
|
||||
|
||||
function Summary ({ className, members }: Props): React.ReactElement<Props> {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<SummaryBox className={className}>
|
||||
<CardSummary label={t('members')}>
|
||||
{members === undefined
|
||||
? <span className='--tmp'>99</span>
|
||||
: formatNumber(members.length)
|
||||
}
|
||||
</CardSummary>
|
||||
</SummaryBox>
|
||||
);
|
||||
}
|
||||
|
||||
export default React.memo(Summary);
|
||||
@@ -0,0 +1,46 @@
|
||||
// Copyright 2017-2025 @pezkuwi/app-ranked authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Member as MemberType } from '../types.js';
|
||||
|
||||
import React, { useRef } from 'react';
|
||||
|
||||
import { Table } from '@pezkuwi/react-components';
|
||||
|
||||
import { useTranslation } from '../translate.js';
|
||||
import Member from './Member.js';
|
||||
import Summary from './Summary.js';
|
||||
|
||||
interface Props {
|
||||
className?: string;
|
||||
members?: MemberType[];
|
||||
}
|
||||
|
||||
function Members ({ className, members }: Props): React.ReactElement<Props> {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const headerRef = useRef<([React.ReactNode?, string?, number?] | false)[]>([
|
||||
[t('members'), 'start']
|
||||
]);
|
||||
|
||||
return (
|
||||
<div className={className}>
|
||||
<Summary members={members} />
|
||||
<Table
|
||||
className={className}
|
||||
empty={members && t('No members found')}
|
||||
header={headerRef.current}
|
||||
isSplit
|
||||
>
|
||||
{members?.map((a): React.ReactNode => (
|
||||
<Member
|
||||
key={a.accountId}
|
||||
value={a}
|
||||
/>
|
||||
))}
|
||||
</Table>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default React.memo(Members);
|
||||
Reference in New Issue
Block a user