mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-08-02 07:45:40 +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
89 lines
2.3 KiB
TypeScript
89 lines
2.3 KiB
TypeScript
// Copyright 2017-2026 @pezkuwi/app-tech-comm authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { CollectiveType } from '@pezkuwi/react-hooks/types';
|
|
import type { Hash } from '@pezkuwi/types/interfaces';
|
|
|
|
import React, { useMemo } from 'react';
|
|
import { Route, Routes } from 'react-router';
|
|
|
|
import { Tabs } from '@pezkuwi/react-components';
|
|
import { useApi, useCall, useCollectiveMembers } from '@pezkuwi/react-hooks';
|
|
|
|
import Overview from './Overview/index.js';
|
|
import Proposals from './Proposals/index.js';
|
|
import { useTranslation } from './translate.js';
|
|
|
|
interface Props {
|
|
basePath: string;
|
|
className?: string;
|
|
type: CollectiveType;
|
|
}
|
|
|
|
const HIDDEN_EMPTY: string[] = [];
|
|
const HIDDEN_PROPOSALS: string[] = ['proposals'];
|
|
|
|
function TechCommApp ({ basePath, className, type }: Props): React.ReactElement<Props> {
|
|
const { t } = useTranslation();
|
|
const { api } = useApi();
|
|
const { isMember, members, prime } = useCollectiveMembers(type);
|
|
const hasProposals = useCall<boolean>(api.derive[type].hasProposals);
|
|
const proposalHashes = useCall<Hash[]>(api.derive[type].proposalHashes);
|
|
|
|
const items = useMemo(() => [
|
|
{
|
|
isRoot: true,
|
|
name: 'overview',
|
|
text: t('Overview')
|
|
},
|
|
{
|
|
name: 'proposals',
|
|
text: t('Proposals ({{count}})', { replace: { count: proposalHashes?.length || 0 } })
|
|
}
|
|
], [proposalHashes, t]);
|
|
|
|
return (
|
|
<main className={className}>
|
|
<Tabs
|
|
basePath={basePath}
|
|
hidden={
|
|
hasProposals
|
|
? HIDDEN_EMPTY
|
|
: HIDDEN_PROPOSALS
|
|
}
|
|
items={items}
|
|
/>
|
|
<Routes>
|
|
<Route path={basePath}>
|
|
<Route
|
|
element={
|
|
<Proposals
|
|
isMember={isMember}
|
|
members={members}
|
|
prime={prime}
|
|
proposalHashes={proposalHashes}
|
|
type={type}
|
|
/>
|
|
}
|
|
path='proposals'
|
|
/>
|
|
<Route
|
|
element={
|
|
<Overview
|
|
isMember={isMember}
|
|
members={members}
|
|
prime={prime}
|
|
proposalHashes={proposalHashes}
|
|
type={type}
|
|
/>
|
|
}
|
|
index
|
|
/>
|
|
</Route>
|
|
</Routes>
|
|
</main>
|
|
);
|
|
}
|
|
|
|
export default React.memo(TechCommApp);
|