mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-07-21 19:05:42 +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,46 @@
|
||||
// Copyright 2017-2025 @pezkuwi/app-utilities authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { RawParamOnChangeValue } from '@pezkuwi/react-params/types';
|
||||
import type { HexString } from '@pezkuwi/util/types';
|
||||
|
||||
import React, { useCallback, useState } from 'react';
|
||||
|
||||
import { statics } from '@pezkuwi/react-api';
|
||||
import { Output } from '@pezkuwi/react-components';
|
||||
import { createValue, Holder, ParamComp } from '@pezkuwi/react-params';
|
||||
import { getTypeDef } from '@pezkuwi/types/create';
|
||||
import { u8aToHex } from '@pezkuwi/util';
|
||||
|
||||
function Xcm (): React.ReactElement {
|
||||
const VersionedXcmTypeDef = getTypeDef('XcmVersionedXcm');
|
||||
const [encodedXcm, setEncodedXcm] = useState<HexString>('0x');
|
||||
|
||||
const onChange = useCallback(
|
||||
(_index: number, rawXcm: RawParamOnChangeValue): void => {
|
||||
const xcm = statics.api.createType(VersionedXcmTypeDef.type, rawXcm.value);
|
||||
|
||||
setEncodedXcm(u8aToHex(xcm.toU8a()));
|
||||
},
|
||||
[VersionedXcmTypeDef.type]
|
||||
);
|
||||
|
||||
return (
|
||||
<Holder>
|
||||
<ParamComp
|
||||
defaultValue={ createValue(statics.api.registry, { type: VersionedXcmTypeDef }) }
|
||||
index={0}
|
||||
onChange={onChange}
|
||||
registry={statics.api.registry}
|
||||
type={VersionedXcmTypeDef}
|
||||
/>
|
||||
<Output
|
||||
isDisabled={true}
|
||||
value={encodedXcm}
|
||||
withCopy={true}
|
||||
/>
|
||||
</Holder>
|
||||
);
|
||||
}
|
||||
|
||||
export default React.memo(Xcm);
|
||||
Reference in New Issue
Block a user