ghost-portal/packages/apps-config/src/endpoints/index.ts
Jaco Greeff af44988d9e
Split endpoints into own area (#4204)
* Split endpoints into own area

* Export endpoint key
2020-12-14 12:40:07 +01:00

44 lines
1.2 KiB
TypeScript

// Copyright 2017-2020 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { TFunction } from 'i18next';
import type { LinkOption } from '../settings/types';
import { createCustom, createDev, createOwn } from './development';
import { createProduction } from './production';
import { createTesting } from './testing';
export { CUSTOM_ENDPOINT_KEY } from './development';
export function createWsEndpoints (t: TFunction): LinkOption[] {
return [
...createCustom(t),
{
isDisabled: false,
isHeader: true,
text: t('rpc.header.live', 'Live networks', { ns: 'apps-config' }),
textBy: '',
value: ''
},
...createProduction(t),
{
isDisabled: false,
isHeader: true,
text: t('rpc.header.test', 'Test networks', { ns: 'apps-config' }),
textBy: '',
value: ''
},
...createTesting(t),
{
isDevelopment: true,
isDisabled: false,
isHeader: true,
text: t('rpc.header.dev', 'Development', { ns: 'apps-config' }),
textBy: '',
value: ''
},
...createDev(t),
...createOwn(t)
].filter(({ isDisabled }) => !isDisabled);
}