mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-11-02 06:31:07 +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,48 @@
|
||||
// Copyright 2017-2025 @pezkuwi/react-components authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { BN } from '@pezkuwi/util';
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { FormatBalance } from '@pezkuwi/react-query';
|
||||
|
||||
export interface Props {
|
||||
children?: React.ReactNode;
|
||||
className?: string;
|
||||
colSpan?: number;
|
||||
label?: React.ReactNode;
|
||||
labelPost?: React.ReactNode;
|
||||
rowSpan?: number;
|
||||
value?: BN | null;
|
||||
withLoading?: boolean;
|
||||
}
|
||||
|
||||
function Balance ({ children, className = '', colSpan, label, labelPost, rowSpan, value, withLoading }: Props): React.ReactElement<Props> {
|
||||
return (
|
||||
<td
|
||||
className={`${className} ui--Table-Column-Balance number`}
|
||||
colSpan={colSpan}
|
||||
rowSpan={rowSpan}
|
||||
>
|
||||
{value
|
||||
? (
|
||||
<FormatBalance
|
||||
label={label}
|
||||
labelPost={labelPost}
|
||||
value={value}
|
||||
/>
|
||||
)
|
||||
: withLoading && (
|
||||
<FormatBalance
|
||||
className='--tmp'
|
||||
value={1}
|
||||
/>
|
||||
)
|
||||
}
|
||||
{children}
|
||||
</td>
|
||||
);
|
||||
}
|
||||
|
||||
export default React.memo(Balance);
|
||||
@@ -0,0 +1,60 @@
|
||||
// Copyright 2017-2025 @pezkuwi/react-components authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import Icon from '../../Icon.js';
|
||||
import { styled } from '../../styled.js';
|
||||
|
||||
export interface Props {
|
||||
className?: string;
|
||||
colSpan?: number;
|
||||
rowSpan?: number;
|
||||
isExpanded: boolean;
|
||||
toggle: () => void;
|
||||
}
|
||||
|
||||
function Expand ({ className = '', colSpan, isExpanded, rowSpan, toggle }: Props): React.ReactElement<Props> {
|
||||
return (
|
||||
<StyledTd
|
||||
className={`${className} ui--Table-Column-Expand`}
|
||||
colSpan={colSpan}
|
||||
onClick={toggle}
|
||||
rowSpan={rowSpan}
|
||||
>
|
||||
<div>
|
||||
<Icon
|
||||
icon={
|
||||
isExpanded
|
||||
? 'caret-up'
|
||||
: 'caret-down'
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</StyledTd>
|
||||
);
|
||||
}
|
||||
|
||||
const StyledTd = styled.td`
|
||||
&& {
|
||||
box-sizing: content-box;
|
||||
cursor: pointer;
|
||||
min-width: 1.7rem;
|
||||
padding-left: 0;
|
||||
text-align: left;
|
||||
width: 1.7rem;
|
||||
|
||||
> div {
|
||||
align-items: center;
|
||||
border: 1px solid var(--border-table);
|
||||
border-radius: 4px;
|
||||
box-sizing: border-box;
|
||||
display: inline-flex;
|
||||
height: 1.7rem;
|
||||
justify-content: center;
|
||||
width: 1.7rem;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export default React.memo(Expand);
|
||||
@@ -0,0 +1,54 @@
|
||||
// Copyright 2017-2025 @pezkuwi/react-components authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import React, { useCallback } from 'react';
|
||||
|
||||
import Icon from '../../Icon.js';
|
||||
import { styled } from '../../styled.js';
|
||||
|
||||
export interface Props {
|
||||
address: string;
|
||||
className?: string;
|
||||
colSpan?: number;
|
||||
isFavorite: boolean;
|
||||
rowSpan?: number;
|
||||
toggle: (address: string) => void;
|
||||
}
|
||||
|
||||
function Favorite ({ address, className = '', colSpan, isFavorite, rowSpan, toggle }: Props): React.ReactElement<Props> {
|
||||
const onClick = useCallback(
|
||||
() => toggle(address),
|
||||
[address, toggle]
|
||||
);
|
||||
|
||||
return (
|
||||
<StyledTd
|
||||
className={`${className} ui--Table-Column-Favorite`}
|
||||
colSpan={colSpan}
|
||||
onClick={onClick}
|
||||
rowSpan={rowSpan}
|
||||
>
|
||||
<Icon
|
||||
color={
|
||||
isFavorite
|
||||
? 'orange'
|
||||
: 'gray'
|
||||
}
|
||||
icon='star'
|
||||
/>
|
||||
</StyledTd>
|
||||
);
|
||||
}
|
||||
|
||||
const StyledTd = styled.td`
|
||||
&& {
|
||||
box-sizing: content-box;
|
||||
cursor: pointer;
|
||||
min-width: 1rem;
|
||||
padding-right: 0.35rem;
|
||||
text-align: right;
|
||||
width: 1rem;
|
||||
}
|
||||
`;
|
||||
|
||||
export default React.memo(Favorite);
|
||||
@@ -0,0 +1,46 @@
|
||||
// Copyright 2017-2025 @pezkuwi/react-components authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { BN } from '@pezkuwi/util';
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { formatNumber } from '@pezkuwi/util';
|
||||
|
||||
import { styled } from '../../styled.js';
|
||||
|
||||
export interface Props {
|
||||
children?: React.ReactNode;
|
||||
className?: string;
|
||||
colSpan?: number;
|
||||
rowSpan?: number;
|
||||
value: BN | number;
|
||||
}
|
||||
|
||||
function Id ({ children, className = '', colSpan, rowSpan, value }: Props): React.ReactElement<Props> {
|
||||
return (
|
||||
<StyledTd
|
||||
className={`${className} ui--Table-Column-Id`}
|
||||
colSpan={colSpan}
|
||||
rowSpan={rowSpan}
|
||||
>
|
||||
<h2 className='--digits'>{formatNumber(value)}</h2>
|
||||
{children}
|
||||
</StyledTd>
|
||||
);
|
||||
}
|
||||
|
||||
// We want 5.5ch (which should be ok-ish for 5 decimals, i.e. 99,999), however
|
||||
// we wrap the display in an h2 with max size text at ~1.3rem, so multiply it out
|
||||
const WIDTH = `${(5.5 * 1.3).toFixed(3)}ch`;
|
||||
|
||||
const StyledTd = styled.td`
|
||||
&& {
|
||||
box-sizing: content-box;
|
||||
min-width: ${WIDTH};
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
width: ${WIDTH};
|
||||
`;
|
||||
|
||||
export default React.memo(Id);
|
||||
@@ -0,0 +1,36 @@
|
||||
// Copyright 2017-2025 @pezkuwi/react-components authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import Balance from './Balance.js';
|
||||
import Expand from './Expand.js';
|
||||
import Favorite from './Favorite.js';
|
||||
import Id from './Id.js';
|
||||
|
||||
interface Props {
|
||||
children?: React.ReactNode;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
function ColumnBase ({ children, className = '' }: Props): React.ReactElement<Props> {
|
||||
return (
|
||||
<td className={`${className} ui--Table-Column`}>
|
||||
{children}
|
||||
</td>
|
||||
);
|
||||
}
|
||||
|
||||
const Column = React.memo(ColumnBase) as unknown as typeof ColumnBase & {
|
||||
Balance: typeof Balance,
|
||||
Expand: typeof Expand,
|
||||
Favorite: typeof Favorite,
|
||||
Id: typeof Id
|
||||
};
|
||||
|
||||
Column.Balance = Balance;
|
||||
Column.Expand = Expand;
|
||||
Column.Favorite = Favorite;
|
||||
Column.Id = Id;
|
||||
|
||||
export default Column;
|
||||
Reference in new issue
Block a user