mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-07-14 05:05:47 +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
78 lines
1.8 KiB
TypeScript
78 lines
1.8 KiB
TypeScript
// Copyright 2017-2026 @pezkuwi/app-js authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { AppProps as Props } from '@pezkuwi/react-components/types';
|
|
|
|
import React, { useRef } from 'react';
|
|
import { Route, Routes } from 'react-router';
|
|
|
|
import { Icon, Tabs } from '@pezkuwi/react-components';
|
|
import { useSudo } from '@pezkuwi/react-hooks';
|
|
|
|
import SetKey from './SetKey.js';
|
|
import Sudo from './Sudo.js';
|
|
import { useTranslation } from './translate.js';
|
|
|
|
function SudoApp ({ basePath }: Props): React.ReactElement<Props> {
|
|
const { t } = useTranslation();
|
|
const { allAccounts, hasSudoKey, sudoKey } = useSudo();
|
|
|
|
const itemsRef = useRef([
|
|
{
|
|
isRoot: true,
|
|
name: 'index',
|
|
text: t('Sudo access')
|
|
},
|
|
{
|
|
name: 'key',
|
|
text: t('Set sudo key')
|
|
}
|
|
]);
|
|
|
|
return (
|
|
<main>
|
|
<Tabs
|
|
basePath={basePath}
|
|
items={itemsRef.current}
|
|
/>
|
|
{hasSudoKey
|
|
? (
|
|
<Routes>
|
|
<Route path={basePath}>
|
|
<Route
|
|
element={
|
|
<SetKey
|
|
allAccounts={allAccounts}
|
|
isMine={hasSudoKey}
|
|
sudoKey={sudoKey}
|
|
/>
|
|
}
|
|
path='key'
|
|
/>
|
|
<Route
|
|
element={
|
|
<Sudo
|
|
isMine={hasSudoKey}
|
|
sudoKey={sudoKey}
|
|
/>
|
|
}
|
|
index
|
|
/>
|
|
</Route>
|
|
</Routes>
|
|
)
|
|
: (
|
|
<article className='error padded'>
|
|
<div>
|
|
<Icon icon='ban' />
|
|
{t('You do not have access to the current sudo key')}
|
|
</div>
|
|
</article>
|
|
)
|
|
}
|
|
</main>
|
|
);
|
|
}
|
|
|
|
export default React.memo(SudoApp);
|