Adjust Route exports (#2506)

This commit is contained in:
Jaco Greeff 2020-04-02 11:22:00 +02:00 committed by GitHub
parent efe4740b8b
commit 23dde12942
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 386 additions and 388 deletions

View File

@ -2,24 +2,24 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Routes } from './types';
import { Route } from './types';
import Template from '@polkadot/app-123code';
export default ([
{
Component: Template,
display: {
isHidden: true,
needsAccounts: true,
needsApi: [
'tx.balances.transfer'
]
},
i18n: {
defaultValue: 'Template'
},
icon: 'th',
name: '123code'
}
] as Routes);
const route: Route = {
Component: Template,
display: {
isHidden: true,
needsAccounts: true,
needsApi: [
'tx.balances.transfer'
]
},
i18n: {
defaultValue: 'Template'
},
icon: 'th',
name: '123code'
};
export default route;

View File

@ -2,20 +2,20 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Routes } from './types';
import { Route } from './types';
import Accounts from '@polkadot/app-accounts';
export default ([
{
Component: Accounts,
display: {
needsApi: []
},
i18n: {
defaultValue: 'Accounts'
},
icon: 'users',
name: 'accounts'
}
] as Routes);
const route: Route = {
Component: Accounts,
display: {
needsApi: []
},
i18n: {
defaultValue: 'Accounts'
},
icon: 'users',
name: 'accounts'
};
export default route;

View File

@ -2,22 +2,22 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Routes } from './types';
import { Route } from './types';
import Claims from '@polkadot/app-claims';
export default ([
{
Component: Claims,
display: {
needsApi: [
'query.claims.claims'
]
},
i18n: {
defaultValue: 'Claim Tokens'
},
icon: 'star',
name: 'claims'
}
] as Routes);
const route: Route = {
Component: Claims,
display: {
needsApi: [
'query.claims.claims'
]
},
i18n: {
defaultValue: 'Claim Tokens'
},
icon: 'star',
name: 'claims'
};
export default route;

View File

@ -2,26 +2,26 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Routes } from './types';
import { Route } from './types';
import Contracts from '@polkadot/app-contracts';
export default ([
{
Component: Contracts,
display: {
needsAccounts: true,
needsApi: [
[
'tx.contracts.call', // substrate 2.x
'tx.contract.call' // substrate 1.x
]
const route: Route = {
Component: Contracts,
display: {
needsAccounts: true,
needsApi: [
[
'tx.contracts.call', // substrate 2.x
'tx.contract.call' // substrate 1.x
]
},
i18n: {
defaultValue: 'Contracts'
},
icon: 'compress',
name: 'contracts'
}
] as Routes);
]
},
i18n: {
defaultValue: 'Contracts'
},
icon: 'compress',
name: 'contracts'
};
export default route;

View File

@ -2,26 +2,26 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Routes } from './types';
import { Route } from './types';
import Council, { useCounter } from '@polkadot/app-council';
export default ([
{
Component: Council,
display: {
needsApi: [
[
'query.electionsPhragmen.candidates',
'query.elections.candidates'
]
const route: Route = {
Component: Council,
display: {
needsApi: [
[
'query.electionsPhragmen.candidates',
'query.elections.candidates'
]
},
i18n: {
defaultValue: 'Council'
},
icon: 'building',
name: 'council',
useCounter
}
] as Routes);
]
},
i18n: {
defaultValue: 'Council'
},
icon: 'building',
name: 'council',
useCounter
};
export default route;

View File

@ -2,20 +2,20 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Routes } from './types';
import { Route } from './types';
import Dashboard from '@polkadot/app-dashboard';
export default ([
{
Component: Dashboard,
display: {
isHidden: true
},
i18n: {
defaultValue: 'Dashboard'
},
icon: 'th',
name: 'dashboard'
}
] as Routes);
const route: Route = {
Component: Dashboard,
display: {
isHidden: true
},
i18n: {
defaultValue: 'Dashboard'
},
icon: 'th',
name: 'dashboard'
};
export default route;

View File

@ -2,23 +2,23 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Routes } from './types';
import { Route } from './types';
import Democracy, { useCounter } from '@polkadot/app-democracy';
export default ([
{
Component: Democracy,
display: {
needsApi: [
'tx.democracy.notePreimage'
]
},
i18n: {
defaultValue: 'Democracy'
},
icon: 'calendar check',
name: 'democracy',
useCounter
}
] as Routes);
const route: Route = {
Component: Democracy,
display: {
needsApi: [
'tx.democracy.notePreimage'
]
},
i18n: {
defaultValue: 'Democracy'
},
icon: 'calendar check',
name: 'democracy',
useCounter
};
export default route;

View File

@ -2,20 +2,20 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Routes } from './types';
import { Route } from './types';
import Explorer from '@polkadot/app-explorer';
export default ([
{
Component: Explorer,
display: {
needsApi: []
},
i18n: {
defaultValue: 'Explorer'
},
icon: 'braille',
name: 'explorer'
}
] as Routes);
const route: Route = {
Component: Explorer,
display: {
needsApi: []
},
i18n: {
defaultValue: 'Explorer'
},
icon: 'braille',
name: 'explorer'
};
export default route;

View File

@ -2,21 +2,21 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Routes } from './types';
import { Route } from './types';
import Extrinsics from '@polkadot/app-extrinsics';
export default ([
{
Component: Extrinsics,
display: {
needsAccounts: true,
needsApi: []
},
i18n: {
defaultValue: 'Extrinsics'
},
icon: 'sync',
name: 'extrinsics'
}
] as Routes);
const route: Route = {
Component: Extrinsics,
display: {
needsAccounts: true,
needsApi: []
},
i18n: {
defaultValue: 'Extrinsics'
},
icon: 'sync',
name: 'extrinsics'
};
export default route;

View File

@ -2,24 +2,24 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Routes } from './types';
import { Route } from './types';
import GenericAsset from '@polkadot/app-generic-asset';
export default ([
{
Component: GenericAsset,
display: {
isHidden: false,
needsAccounts: true,
needsApi: [
'tx.genericAsset.transfer'
]
},
i18n: {
defaultValue: 'Generic Asset'
},
icon: 'cubes',
name: 'generic-asset'
}
] as Routes);
const route: Route = {
Component: GenericAsset,
display: {
isHidden: false,
needsAccounts: true,
needsApi: [
'tx.genericAsset.transfer'
]
},
i18n: {
defaultValue: 'Generic Asset'
},
icon: 'cubes',
name: 'generic-asset'
};
export default route;

View File

@ -2,7 +2,7 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Routing, Routes } from './types';
import { Routing } from './types';
import appSettings from '@polkadot/ui-settings';
@ -28,52 +28,50 @@ import toolbox from './toolbox';
import transfer from './transfer';
import treasury from './treasury';
const routes: Routes = appSettings.uiMode === 'light'
? ([] as Routes).concat(
// dashboard,
explorer,
accounts,
claims,
transfer,
genericAsset,
null,
staking,
democracy,
council,
// TODO Not sure about the inclusion of treasury, parachains & society here
null,
settings
)
: ([] as Routes).concat(
// dashboard,
explorer,
accounts,
claims,
transfer,
genericAsset,
null,
staking,
democracy,
council,
treasury,
techcomm,
parachains,
society,
null,
contracts,
storage,
extrinsics,
sudo,
null,
settings,
toolbox,
js,
template
);
const setup: Routing = {
default: 'explorer',
routes
routes: appSettings.uiMode === 'light'
? [
// dashboard,
explorer,
accounts,
claims,
transfer,
genericAsset,
null,
staking,
democracy,
council,
// TODO Not sure about the inclusion of treasury, parachains & society here
null,
settings
]
: [
// dashboard,
explorer,
accounts,
claims,
transfer,
genericAsset,
null,
staking,
democracy,
council,
treasury,
techcomm,
parachains,
society,
null,
contracts,
storage,
extrinsics,
sudo,
null,
settings,
toolbox,
js,
template
]
};
export default setup;

View File

@ -2,20 +2,20 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Routes } from './types';
import { Route } from './types';
import Js from '@polkadot/app-js';
export default ([
{
Component: Js,
display: {
needsApi: []
},
i18n: {
defaultValue: 'Javascript'
},
icon: 'code',
name: 'js'
}
] as Routes);
const route: Route = {
Component: Js,
display: {
needsApi: []
},
i18n: {
defaultValue: 'Javascript'
},
icon: 'code',
name: 'js'
};
export default route;

View File

@ -2,22 +2,22 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Routes } from './types';
import { Route } from './types';
import Parachains from '@polkadot/app-parachains';
export default ([
{
Component: Parachains,
display: {
needsApi: [
'query.parachains.code'
]
},
i18n: {
defaultValue: 'Parachains'
},
icon: 'chain',
name: 'parachains'
}
] as Routes);
const route: Route = {
Component: Parachains,
display: {
needsApi: [
'query.parachains.code'
]
},
i18n: {
defaultValue: 'Parachains'
},
icon: 'chain',
name: 'parachains'
};
export default route;

View File

@ -2,19 +2,19 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Routes } from './types';
import { Route } from './types';
import Settings, { useCounter } from '@polkadot/app-settings';
export default ([
{
Component: Settings,
display: {},
i18n: {
defaultValue: 'Settings'
},
icon: 'settings',
name: 'settings',
useCounter
}
] as Routes);
const route: Route = {
Component: Settings,
display: {},
i18n: {
defaultValue: 'Settings'
},
icon: 'settings',
name: 'settings',
useCounter
};
export default route;

View File

@ -2,22 +2,22 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Routes } from './types';
import { Route } from './types';
import Society from '@polkadot/app-society';
export default ([
{
Component: Society,
display: {
needsApi: [
'query.society.pot'
]
},
i18n: {
defaultValue: 'Society'
},
icon: 'grab',
name: 'society'
}
] as Routes);
const route: Route = {
Component: Society,
display: {
needsApi: [
'query.society.pot'
]
},
i18n: {
defaultValue: 'Society'
},
icon: 'grab',
name: 'society'
};
export default route;

View File

@ -2,24 +2,24 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Routes } from './types';
import { Route } from './types';
// import Staking from '@polkadot/app-staking';
import Staking, { useCounter } from '@polkadot/app-staking';
export default ([
{
Component: Staking,
display: {
needsApi: [
['tx.staking.bond']
]
},
i18n: {
defaultValue: 'Staking'
},
icon: 'certificate',
name: 'staking',
useCounter
}
] as Routes);
const route: Route = {
Component: Staking,
display: {
needsApi: [
['tx.staking.bond']
]
},
i18n: {
defaultValue: 'Staking'
},
icon: 'certificate',
name: 'staking',
useCounter
};
export default route;

View File

@ -2,20 +2,20 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Routes } from './types';
import { Route } from './types';
import Storage from '@polkadot/app-storage';
export default ([
{
Component: Storage,
display: {
needsApi: []
},
i18n: {
defaultValue: 'Chain state'
},
icon: 'database',
name: 'chainstate'
}
] as Routes);
const route: Route = {
Component: Storage,
display: {
needsApi: []
},
i18n: {
defaultValue: 'Chain state'
},
icon: 'database',
name: 'chainstate'
};
export default route;

View File

@ -2,24 +2,24 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Routes } from './types';
import { Route } from './types';
import Sudo from '@polkadot/app-sudo';
export default ([
{
Component: Sudo,
display: {
needsAccounts: true,
needsApi: [
'tx.sudo.setKey'
],
needsSudo: true
},
i18n: {
defaultValue: 'Sudo'
},
icon: 'unlock',
name: 'sudo'
}
] as Routes);
const route: Route = {
Component: Sudo,
display: {
needsAccounts: true,
needsApi: [
'tx.sudo.setKey'
],
needsSudo: true
},
i18n: {
defaultValue: 'Sudo'
},
icon: 'unlock',
name: 'sudo'
};
export default route;

View File

@ -2,23 +2,23 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Routes } from './types';
import { Route } from './types';
import TechComm, { useCounter } from '@polkadot/app-tech-comm';
export default ([
{
Component: TechComm,
display: {
needsApi: [
'query.technicalCommittee.members'
]
},
i18n: {
defaultValue: 'Tech. comm.'
},
icon: 'microchip',
name: 'techcomm',
useCounter
}
] as Routes);
const route: Route = {
Component: TechComm,
display: {
needsApi: [
'query.technicalCommittee.members'
]
},
i18n: {
defaultValue: 'Tech. comm.'
},
icon: 'microchip',
name: 'techcomm',
useCounter
};
export default route;

View File

@ -2,20 +2,20 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Routes } from './types';
import { Route } from './types';
import Toolbox from '@polkadot/app-toolbox';
export default ([
{
Component: Toolbox,
display: {
needsApi: []
},
i18n: {
defaultValue: 'Toolbox'
},
icon: 'configure',
name: 'toolbox'
}
] as Routes);
const route: Route = {
Component: Toolbox,
display: {
needsApi: []
},
i18n: {
defaultValue: 'Toolbox'
},
icon: 'configure',
name: 'toolbox'
};
export default route;

View File

@ -2,25 +2,25 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Routes } from './types';
import { Route } from './types';
import TransferModal from '@polkadot/app-accounts/Accounts/modals/Transfer';
export default ([
{
Component: TransferModal,
Modal: TransferModal,
display: {
isHidden: false,
needsAccounts: true,
needsApi: [
'tx.balances.transfer'
]
},
i18n: {
defaultValue: 'Transfer'
},
icon: 'send',
name: 'transfer'
}
] as Routes);
const route: Route = {
Component: TransferModal,
Modal: TransferModal,
display: {
isHidden: false,
needsAccounts: true,
needsApi: [
'tx.balances.transfer'
]
},
i18n: {
defaultValue: 'Transfer'
},
icon: 'send',
name: 'transfer'
};
export default route;

View File

@ -2,24 +2,24 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Routes } from './types';
import { Route } from './types';
import Treasury, { useCounter } from '@polkadot/app-treasury';
export default ([
{
Component: Treasury,
display: {
needsAccounts: true,
needsApi: [
'tx.treasury.proposeSpend'
]
},
i18n: {
defaultValue: 'Treasury'
},
icon: 'gem',
name: 'treasury',
useCounter
}
] as Routes);
const route: Route = {
Component: Treasury,
display: {
needsAccounts: true,
needsApi: [
'tx.treasury.proposeSpend'
]
},
i18n: {
defaultValue: 'Treasury'
},
icon: 'gem',
name: 'treasury',
useCounter
};
export default route;

View File

@ -12,9 +12,6 @@ export interface RouteProps extends AppProps, BareProps {
export interface Route {
Component: React.ComponentType<RouteProps>;
Modal?: React.ComponentType<any>;
isIgnored?: boolean;
useCheck?: () => boolean;
useCounter?: () => number;
display: {
isHidden?: boolean;
isModal?: boolean;
@ -26,7 +23,10 @@ export interface Route {
defaultValue: string;
};
icon: SemanticICONS;
isIgnored?: boolean;
name: string;
useCheck?: () => boolean;
useCounter?: () => number;
}
export type Routes = (Route | null)[];