mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-11-23 06:10:05 +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:
commit
d21bfb1320
5867 files changed
+329019
No files matched your search
@@ -0,0 +1,71 @@
|
||||
// Copyright 2017-2025 @pezkuwi/app-assets authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ForeignAssetInfo } from '../useForeignAssetInfos.js';
|
||||
|
||||
import React, { useMemo } from 'react';
|
||||
|
||||
import { AddressSmall, CopyButton, Expander, styled } from '@pezkuwi/react-components';
|
||||
import { FormatBalance } from '@pezkuwi/react-query';
|
||||
|
||||
interface Props {
|
||||
className?: string;
|
||||
value: ForeignAssetInfo;
|
||||
}
|
||||
|
||||
function Asset ({ className, value: { details, location, metadata } }: Props): React.ReactElement<Props> {
|
||||
const format = useMemo(
|
||||
(): [number, string] => metadata
|
||||
? [metadata.decimals.toNumber(), metadata.symbol.toUtf8()]
|
||||
: [0, '---'],
|
||||
[metadata]
|
||||
);
|
||||
|
||||
return (
|
||||
<tr className={className}>
|
||||
<Location>
|
||||
<Expander
|
||||
isLeft
|
||||
summary={JSON.stringify(location?.toJSON()).substring(0, 40)}
|
||||
>
|
||||
<pre>
|
||||
{JSON.stringify(location?.toJSON(), null, 2)}
|
||||
</pre>
|
||||
</Expander>
|
||||
<CopyButton value={JSON.stringify(location?.toJSON(), null, 2)} />
|
||||
</Location>
|
||||
<td className='together'>{metadata?.name.toUtf8()}</td>
|
||||
<td className='address media--1000'>{details && <AddressSmall value={details.owner} />}</td>
|
||||
<td className='address media--1300'>{details && <AddressSmall value={details.admin} />}</td>
|
||||
<td className='address media--1600'>{details && <AddressSmall value={details.issuer} />}</td>
|
||||
<td className='address media--1900'>{details && <AddressSmall value={details.freezer} />}</td>
|
||||
<td className='number media--800'>{details && (
|
||||
<FormatBalance
|
||||
format={format}
|
||||
value={details.supply}
|
||||
/>
|
||||
)}</td>
|
||||
<td className='number all'>{details?.accounts.toString() || '0'}</td>
|
||||
</tr>
|
||||
);
|
||||
}
|
||||
|
||||
const Location = styled.td`
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.6rem;
|
||||
white-space: nowrap;
|
||||
font-style: italic;
|
||||
pre {
|
||||
overflow: visible;
|
||||
white-space: pre-wrap;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.ui--Expander-summary svg {
|
||||
padding: 0.3rem 0.4rem;
|
||||
border-radius: 0.25rem;
|
||||
border: 1px solid var(--border-input);
|
||||
}
|
||||
`;
|
||||
|
||||
export default React.memo(Asset);
|
||||
@@ -0,0 +1,48 @@
|
||||
// Copyright 2017-2025 @pezkuwi/app-assets authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ForeignAssetInfo } from '../useForeignAssetInfos.js';
|
||||
|
||||
import React, { useRef } from 'react';
|
||||
|
||||
import { Table } from '@pezkuwi/react-components';
|
||||
|
||||
import { useTranslation } from '../translate.js';
|
||||
import Asset from './Asset.js';
|
||||
|
||||
interface Props {
|
||||
className?: string;
|
||||
infos?: ForeignAssetInfo[];
|
||||
}
|
||||
|
||||
function Assets ({ className, infos }: Props): React.ReactElement<Props> {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const headerRef = useRef<([React.ReactNode?, string?, number?] | false)[]>([
|
||||
[t('foreign assets'), 'start'],
|
||||
[],
|
||||
[t('owner'), 'address media--1000'],
|
||||
[t('admin'), 'address media--1300'],
|
||||
[t('issuer'), 'address media--1600'],
|
||||
[t('freezer'), 'address media--1900'],
|
||||
[t('supply'), 'media--800'],
|
||||
[t('holders')]
|
||||
]);
|
||||
|
||||
return (
|
||||
<Table
|
||||
className={className}
|
||||
empty={infos && t('No assets found')}
|
||||
header={headerRef.current}
|
||||
>
|
||||
{infos?.map((info) => (
|
||||
<Asset
|
||||
key={info.key}
|
||||
value={info}
|
||||
/>
|
||||
))}
|
||||
</Table>
|
||||
);
|
||||
}
|
||||
|
||||
export default React.memo(Assets);
|
||||
@@ -0,0 +1,28 @@
|
||||
// Copyright 2017-2025 @pezkuwi/app-assets authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
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;
|
||||
numAssets?: number;
|
||||
}
|
||||
|
||||
function Summary ({ className, numAssets }: Props): React.ReactElement<Props> {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<SummaryBox className={className}>
|
||||
<CardSummary label={t('foreign assets')}>
|
||||
{formatNumber(numAssets)}
|
||||
</CardSummary>
|
||||
</SummaryBox>
|
||||
);
|
||||
}
|
||||
|
||||
export default React.memo(Summary);
|
||||
@@ -0,0 +1,27 @@
|
||||
// Copyright 2017-2025 @pezkuwi/app-assets authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { StagingXcmV3MultiLocation } from '@pezkuwi/types/lookup';
|
||||
import type { ForeignAssetInfo } from '../useForeignAssetInfos.js';
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import Assets from './Assets.js';
|
||||
import Summary from './Summary.js';
|
||||
|
||||
interface Props {
|
||||
className?: string;
|
||||
foreignAssetInfos?: ForeignAssetInfo[]
|
||||
locations?: StagingXcmV3MultiLocation[];
|
||||
}
|
||||
|
||||
function ForeignAssets ({ className, foreignAssetInfos, locations }: Props): React.ReactElement<Props> {
|
||||
return (
|
||||
<div className={className}>
|
||||
<Summary numAssets={locations?.length} />
|
||||
<Assets infos={foreignAssetInfos} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default React.memo(ForeignAssets);
|
||||
Reference in new issue
Block a user