mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-06-13 18:41: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:
@@ -0,0 +1,51 @@
|
||||
// Copyright 2017-2025 @pezkuwi/app-contracts authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { RawParams } from '@pezkuwi/react-params/types';
|
||||
import type { Registry, TypeDef } from '@pezkuwi/types/types';
|
||||
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
|
||||
import UIParams from '@pezkuwi/react-params';
|
||||
|
||||
interface Props {
|
||||
isDisabled?: boolean;
|
||||
params?: ParamDef[] | null | '';
|
||||
onChange: (values: unknown[]) => void;
|
||||
onEnter?: () => void;
|
||||
registry: Registry;
|
||||
}
|
||||
|
||||
interface ParamDef {
|
||||
name: string;
|
||||
type: TypeDef;
|
||||
}
|
||||
|
||||
function Params ({ isDisabled, onChange, onEnter, params: propParams, registry }: Props): React.ReactElement<Props> | null {
|
||||
const [params, setParams] = useState<ParamDef[]>([]);
|
||||
|
||||
useEffect((): void => {
|
||||
propParams && setParams(propParams);
|
||||
}, [propParams]);
|
||||
|
||||
const _onChange = useCallback(
|
||||
(values: RawParams) => onChange(values.map(({ value }) => value)),
|
||||
[onChange]
|
||||
);
|
||||
|
||||
if (!params.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<UIParams
|
||||
isDisabled={isDisabled}
|
||||
onChange={_onChange}
|
||||
onEnter={onEnter}
|
||||
params={params}
|
||||
registry={registry}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default React.memo(Params);
|
||||
Reference in New Issue
Block a user