* Bumps w/ eslint * Additional * Additional * Additional * Additional * Remove style props * Additional * Additional * Additional * Additional (< 100) * eslint passes, tsc next * tsc fixes * Update deps * Update i18n
52 lines
1.3 KiB
TypeScript
52 lines
1.3 KiB
TypeScript
// Copyright 2017-2020 @polkadot/app-democracy authors & contributors
|
|
// This software may be modified and distributed under the terms
|
|
// of the Apache-2.0 license. See the LICENSE file for details.
|
|
|
|
import { AppProps, BareProps } from '@polkadot/react-components/types';
|
|
|
|
import React, { useMemo } from 'react';
|
|
import { Route, Switch } from 'react-router';
|
|
import { HelpOverlay, Tabs } from '@polkadot/react-components';
|
|
import uiSettings from '@polkadot/ui-settings';
|
|
|
|
import basicMd from './md/basic.md';
|
|
import Overview from './Overview';
|
|
import { useTranslation } from './translate';
|
|
|
|
export { default as useCounter } from './useCounter';
|
|
|
|
interface Props extends AppProps, BareProps {}
|
|
|
|
const hidden = uiSettings.uiMode === 'full'
|
|
? []
|
|
: ['propose'];
|
|
|
|
function DemocracyApp ({ basePath }: Props): React.ReactElement<Props> {
|
|
const { t } = useTranslation();
|
|
const items = useMemo(() => [
|
|
{
|
|
isRoot: true,
|
|
name: 'overview',
|
|
text: t<string>('Democracy overview')
|
|
}
|
|
], [t]);
|
|
|
|
return (
|
|
<main className='democracy--App'>
|
|
<HelpOverlay md={basicMd as string} />
|
|
<header>
|
|
<Tabs
|
|
basePath={basePath}
|
|
hidden={hidden}
|
|
items={items}
|
|
/>
|
|
</header>
|
|
<Switch>
|
|
<Route component={Overview} />
|
|
</Switch>
|
|
</main>
|
|
);
|
|
}
|
|
|
|
export default React.memo(DemocracyApp);
|