mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-11-15 10:57:06 +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,77 @@
|
||||
// Copyright 2017-2025 @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);
|
||||
Reference in new issue
Block a user