mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-07-24 08:55:46 +00:00
971df8edba
- Remove all 3rd party parachain configurations from endpoints: - productionRelayPolkadot.ts: Keep only system parachains - productionRelayDicle.ts: Keep only system parachains - testingRelayZagros.ts: Keep only system parachains - testingRelayTeyrChain.ts: Keep only system parachains - Update domain references: - polkadot.js.org → pezkuwichain.app - wiki.polkadot.network → wiki.pezkuwichain.io - dotapps.io → pezkuwichain.app - statement.polkadot.network → docs.pezkuwichain.io/statement - support.polkadot.network → docs.pezkuwichain.io - Update repository references: - github.com/pezkuwi-js/apps → github.com/pezkuwichain/pwap - Rename system parachains to Pezkuwi ecosystem: - PolkadotAssetHub → PezkuwiAssetHub - polkadotBridgeHub → pezkuwiBridgeHub - polkadotCollectives → pezkuwiCollectives - polkadotCoretime → pezkuwiCoretime - polkadotPeople → pezkuwiPeople - Update network name in claims utility: - Polkadot → Pezkuwi
58 lines
1.4 KiB
TypeScript
58 lines
1.4 KiB
TypeScript
// Copyright 2017-2026 @pezkuwi/app-storage authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { ComponentProps as Props } from '../types.js';
|
|
|
|
import React, { useCallback, useState } from 'react';
|
|
|
|
import { Button, Input } from '@pezkuwi/react-components';
|
|
import { compactAddLength, u8aToU8a } from '@pezkuwi/util';
|
|
|
|
import { useTranslation } from '../translate.js';
|
|
|
|
function Raw ({ onAdd }: Props): React.ReactElement<Props> {
|
|
const { t } = useTranslation();
|
|
const [{ isValid, key }, setValue] = useState<{ isValid: boolean; key: Uint8Array }>(() => ({ isValid: false, key: new Uint8Array([]) }));
|
|
|
|
const _onAdd = useCallback(
|
|
(): void => {
|
|
isValid && onAdd({ isConst: false, key });
|
|
},
|
|
[isValid, key, onAdd]
|
|
);
|
|
|
|
const _onChangeKey = useCallback(
|
|
(key: string): void => {
|
|
const u8a = u8aToU8a(key);
|
|
|
|
setValue({
|
|
isValid: u8a.length !== 0,
|
|
key: compactAddLength(u8a)
|
|
});
|
|
},
|
|
[]
|
|
);
|
|
|
|
return (
|
|
<section className='storage--actionrow'>
|
|
<div className='storage--actionrow-value'>
|
|
<Input
|
|
autoFocus
|
|
label={t('hex-encoded storage key')}
|
|
onChange={_onChangeKey}
|
|
onEnter={_onAdd}
|
|
/>
|
|
</div>
|
|
<div className='storage--actionrow-buttons'>
|
|
<Button
|
|
icon='plus'
|
|
isDisabled={!isValid}
|
|
onClick={_onAdd}
|
|
/>
|
|
</div>
|
|
</section>
|
|
);
|
|
}
|
|
|
|
export default React.memo(Raw);
|