mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-11-03 06: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:
commit
d21bfb1320
5867 files changed
+329019
No files matched your search
@@ -0,0 +1,53 @@
|
||||
// Copyright 2017-2025 @pezkuwi/app-extrinsics authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Props, RawParam } from '../types.js';
|
||||
|
||||
import React, { useCallback, useState } from 'react';
|
||||
|
||||
import { useApi } from '@pezkuwi/react-hooks';
|
||||
|
||||
import { extractInitial } from './Call.js';
|
||||
import ExtrinsicDisplay from './Extrinsic.js';
|
||||
|
||||
function ProposalDisplay ({ className = '', defaultValue, isDisabled, isError, label, onChange, onEnter, onEscape, withLabel }: Props): React.ReactElement<Props> {
|
||||
const { api, apiDefaultTxSudo } = useApi();
|
||||
|
||||
const [{ initialArgs, initialValue }] = useState(
|
||||
() => extractInitial(api, apiDefaultTxSudo, defaultValue)
|
||||
);
|
||||
|
||||
const _onChange = useCallback(
|
||||
({ isValid, value }: RawParam): void => {
|
||||
let proposal = null;
|
||||
|
||||
if (isValid && value) {
|
||||
proposal = api.createType('Proposal', value);
|
||||
}
|
||||
|
||||
onChange && onChange({
|
||||
isValid,
|
||||
value: proposal
|
||||
});
|
||||
},
|
||||
[api, onChange]
|
||||
);
|
||||
|
||||
return (
|
||||
<ExtrinsicDisplay
|
||||
className={className}
|
||||
defaultArgs={initialArgs}
|
||||
defaultValue={initialValue}
|
||||
isDisabled={isDisabled}
|
||||
isError={isError}
|
||||
isPrivate
|
||||
label={label}
|
||||
onChange={_onChange}
|
||||
onEnter={onEnter}
|
||||
onEscape={onEscape}
|
||||
withLabel={withLabel}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default React.memo(ProposalDisplay);
|
||||
Reference in new issue
Block a user