mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-04-23 03:37:57 +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,25 @@
|
||||
// Copyright 2017-2025 @pezkuwi/react-components authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DividerProps } from './types.js';
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { styled } from '../styled.js';
|
||||
|
||||
function Divider ({ className = '' }: DividerProps): React.ReactElement {
|
||||
return (
|
||||
<StyledDiv className={`${className} ui--Menu__Divider`} />
|
||||
);
|
||||
}
|
||||
|
||||
const StyledDiv = styled.div`
|
||||
margin: 0.25rem 0 1rem;
|
||||
border-top: 1px solid var(--border-table);
|
||||
|
||||
&:first-child, &:last-child {
|
||||
display: none
|
||||
}
|
||||
`;
|
||||
|
||||
export default React.memo(Divider);
|
||||
@@ -0,0 +1,25 @@
|
||||
// Copyright 2017-2025 @pezkuwi/react-components authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HeaderProps } from './types.js';
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { styled } from '../styled.js';
|
||||
|
||||
function Header ({ children, className }: HeaderProps): React.ReactElement {
|
||||
return (
|
||||
<StyledDiv className={className}>
|
||||
{children}
|
||||
</StyledDiv>
|
||||
);
|
||||
}
|
||||
|
||||
const StyledDiv = styled.div`
|
||||
color: var(--color-label);
|
||||
font-size: var(--font-size-tiny);
|
||||
line-height: 0.857rem;
|
||||
margin-bottom: 0.3rem;
|
||||
`;
|
||||
|
||||
export default React.memo(Header);
|
||||
@@ -0,0 +1,66 @@
|
||||
// Copyright 2017-2025 @pezkuwi/react-components authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ItemProps } from './types.js';
|
||||
|
||||
import React, { useCallback } from 'react';
|
||||
|
||||
import Icon from '../Icon.js';
|
||||
import { styled } from '../styled.js';
|
||||
|
||||
function Item ({ children, className = '', icon, isDisabled, label, onClick }: ItemProps): React.ReactElement<ItemProps> {
|
||||
const _onClick = useCallback(
|
||||
(): void => {
|
||||
!isDisabled && onClick && Promise
|
||||
.resolve(onClick())
|
||||
.catch(console.error);
|
||||
},
|
||||
[isDisabled, onClick]
|
||||
);
|
||||
|
||||
return (
|
||||
<StyledDiv
|
||||
className={`${className} ui--Menu__Item ${icon ? 'hasIcon' : ''} ${isDisabled ? 'isDisabled' : ''}`}
|
||||
onClick={_onClick}
|
||||
>
|
||||
{icon && (
|
||||
<Icon
|
||||
color='darkGray'
|
||||
icon={icon}
|
||||
/>
|
||||
)}
|
||||
{label}{children}
|
||||
</StyledDiv>
|
||||
);
|
||||
}
|
||||
|
||||
const StyledDiv = styled.div`
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
font-size: var(--font-size-small);
|
||||
line-height: 0.93rem;
|
||||
padding: 0.5rem 1rem;
|
||||
position: relative;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
&.hasIcon {
|
||||
padding-left: 2.6rem;
|
||||
}
|
||||
|
||||
.ui--Icon {
|
||||
position: absolute;
|
||||
left: 1rem;
|
||||
}
|
||||
|
||||
&.isDisabled {
|
||||
cursor: default;
|
||||
opacity: 0.5;
|
||||
}
|
||||
`;
|
||||
|
||||
export default React.memo(Item);
|
||||
@@ -0,0 +1,39 @@
|
||||
// Copyright 2017-2025 @pezkuwi/react-components authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { BaseProps, MenuType } from './types.js';
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { styled } from '../styled.js';
|
||||
import Divider from './Divider.js';
|
||||
import Header from './Header.js';
|
||||
import Item from './Item.js';
|
||||
|
||||
function Base ({ children, className = '' }: BaseProps): React.ReactElement<BaseProps> {
|
||||
return (
|
||||
<StyledDiv className={`${className} ui--Menu`}>
|
||||
{children}
|
||||
</StyledDiv>
|
||||
);
|
||||
}
|
||||
|
||||
const StyledDiv = styled.div`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 14.286rem;
|
||||
margin: 1rem 0;
|
||||
|
||||
& > *:not(.ui--Menu__Item):not(.ui--Menu__Divider) {
|
||||
margin-right: 1rem;
|
||||
margin-left: 1rem;
|
||||
}
|
||||
`;
|
||||
|
||||
const Menu = React.memo(Base) as unknown as MenuType;
|
||||
|
||||
Menu.Divider = Divider;
|
||||
Menu.Item = Item;
|
||||
Menu.Header = Header;
|
||||
|
||||
export default Menu;
|
||||
@@ -0,0 +1,34 @@
|
||||
// Copyright 2017-2025 @pezkuwi/react-components authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { IconName } from '@fortawesome/fontawesome-svg-core';
|
||||
import type React from 'react';
|
||||
|
||||
export interface HeaderProps {
|
||||
children?: React.ReactNode;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export interface ItemProps {
|
||||
children?: React.ReactNode;
|
||||
className?: string;
|
||||
icon?: IconName;
|
||||
isDisabled?: boolean;
|
||||
label?: React.ReactNode;
|
||||
onClick?: () => void | Promise<void> | null;
|
||||
}
|
||||
|
||||
export interface BaseProps {
|
||||
children?: React.ReactNode;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export interface DividerProps {
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export type MenuType = React.FC<BaseProps> & {
|
||||
Divider: React.FC<DividerProps>;
|
||||
Item: React.FC<ItemProps>;
|
||||
Header: React.FC<HeaderProps>;
|
||||
};
|
||||
Reference in New Issue
Block a user