Fix chain ordering (alphabetical) (#5248)
* Fix chain ordering (alpahbetical) * Split relays * Split live relays * Ordering * Adjust first with spacer
This commit is contained in:
parent
ac163cbff4
commit
1bd8637762
@ -22,3 +22,5 @@ export const POLKADOT_GENESIS = getGenesis('polkadot');
|
||||
export const POLKADOT_DENOM_BLOCK = new BN(1248328);
|
||||
|
||||
export const ROCOCO_GENESIS = '0x1611e1dbf0405379b861e2e27daa90f480b2e6d3682414a80835a52e8cb8a215';
|
||||
|
||||
export const WESTEND_GENESIS = '0xe143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e';
|
||||
|
||||
@ -6,8 +6,9 @@ import type { LinkOption } from '../settings/types';
|
||||
|
||||
import { createCustom, createDev, createOwn } from './development';
|
||||
import { createProduction } from './production';
|
||||
import { createProductionRelays } from './productionRelays';
|
||||
import { createTesting } from './testing';
|
||||
import { createRococo } from './testingRococo';
|
||||
import { createTestingRelays } from './testingRelays';
|
||||
|
||||
export { CUSTOM_ENDPOINT_KEY } from './development';
|
||||
|
||||
@ -17,11 +18,12 @@ export function createWsEndpoints (t: TFunction): LinkOption[] {
|
||||
{
|
||||
isDisabled: false,
|
||||
isHeader: true,
|
||||
text: t('rpc.header.live', 'Live networks', { ns: 'apps-config' }),
|
||||
isSpaced: true,
|
||||
text: t('rpc.header.live.relay', 'Live relays & parachains', { ns: 'apps-config' }),
|
||||
textBy: '',
|
||||
value: ''
|
||||
},
|
||||
...createProduction(t),
|
||||
...createProductionRelays(t),
|
||||
{
|
||||
isDisabled: false,
|
||||
isHeader: true,
|
||||
@ -29,7 +31,16 @@ export function createWsEndpoints (t: TFunction): LinkOption[] {
|
||||
textBy: '',
|
||||
value: ''
|
||||
},
|
||||
...createRococo(t),
|
||||
...createTestingRelays(t),
|
||||
{
|
||||
isDisabled: false,
|
||||
isHeader: true,
|
||||
isSpaced: true,
|
||||
text: t('rpc.header.live', 'Live networks', { ns: 'apps-config' }),
|
||||
textBy: '',
|
||||
value: ''
|
||||
},
|
||||
...createProduction(t),
|
||||
{
|
||||
isDisabled: false,
|
||||
isHeader: true,
|
||||
@ -42,6 +53,7 @@ export function createWsEndpoints (t: TFunction): LinkOption[] {
|
||||
isDevelopment: true,
|
||||
isDisabled: false,
|
||||
isHeader: true,
|
||||
isSpaced: true,
|
||||
text: t('rpc.header.dev', 'Development', { ns: 'apps-config' }),
|
||||
textBy: '',
|
||||
value: ''
|
||||
|
||||
@ -14,30 +14,9 @@ import { expandEndpoints } from './util';
|
||||
// text: The text to display on the dropdown
|
||||
// value: The actual hosted secure websocket endpoint
|
||||
|
||||
// alphabetical based on chain name
|
||||
export function createProduction (t: TFunction): LinkOption[] {
|
||||
return expandEndpoints(t, [
|
||||
// fixed, polkadot
|
||||
{
|
||||
dnslink: 'polkadot',
|
||||
info: 'polkadot',
|
||||
text: t('rpc.polkadot.parity', 'Polkadot', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
Parity: 'wss://rpc.polkadot.io',
|
||||
OnFinality: 'wss://polkadot.api.onfinality.io/public-ws',
|
||||
'Patract Elara': 'wss://polkadot.elara.patract.io'
|
||||
}
|
||||
},
|
||||
{
|
||||
dnslink: 'kusama',
|
||||
info: 'kusama',
|
||||
text: t('rpc.kusama.parity', 'Kusama', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
Parity: 'wss://kusama-rpc.polkadot.io',
|
||||
OnFinality: 'wss://kusama.api.onfinality.io/public-ws',
|
||||
'Patract Elara': 'wss://kusama.elara.patract.io'
|
||||
}
|
||||
},
|
||||
// alphabetical based on chain name
|
||||
{
|
||||
dnslink: 'centrifuge',
|
||||
info: 'centrifuge',
|
||||
|
||||
32
packages/apps-config/src/endpoints/productionRelayKusama.ts
Normal file
32
packages/apps-config/src/endpoints/productionRelayKusama.ts
Normal file
@ -0,0 +1,32 @@
|
||||
// Copyright 2017-2021 @polkadot/apps-config authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { TFunction } from 'i18next';
|
||||
import type { EndpointOption } from './types';
|
||||
|
||||
import { KUSAMA_GENESIS } from '../api/constants';
|
||||
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
// The available endpoints that will show in the dropdown. For the most part (with the exception of
|
||||
// Polkadot) we try to keep this to live chains only, with RPCs hosted by the community/chain vendor
|
||||
// info: The chain logo name as defined in ../ui/logos/index.ts in namedLogos (this also needs to align with @polkadot/networks)
|
||||
// text: The text to display on the dropdown
|
||||
// value: The actual hosted secure websocket endpoint
|
||||
export function createKusama (t: TFunction): EndpointOption {
|
||||
return {
|
||||
dnslink: 'kusama',
|
||||
genesisHash: KUSAMA_GENESIS,
|
||||
info: 'kusama',
|
||||
text: t('rpc.kusama.parity', 'Kusama', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
Parity: 'wss://kusama-rpc.polkadot.io',
|
||||
OnFinality: 'wss://kusama.api.onfinality.io/public-ws',
|
||||
'Patract Elara': 'wss://kusama.elara.patract.io'
|
||||
},
|
||||
linked: [
|
||||
// parachains with id, see Rococo
|
||||
// alphabetical based on chain name
|
||||
]
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
// Copyright 2017-2021 @polkadot/apps-config authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { TFunction } from 'i18next';
|
||||
import type { EndpointOption } from './types';
|
||||
|
||||
import { POLKADOT_GENESIS } from '../api/constants';
|
||||
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
// The available endpoints that will show in the dropdown. For the most part (with the exception of
|
||||
// Polkadot) we try to keep this to live chains only, with RPCs hosted by the community/chain vendor
|
||||
// info: The chain logo name as defined in ../ui/logos/index.ts in namedLogos (this also needs to align with @polkadot/networks)
|
||||
// text: The text to display on the dropdown
|
||||
// value: The actual hosted secure websocket endpoint
|
||||
export function createPolkadot (t: TFunction): EndpointOption {
|
||||
return {
|
||||
dnslink: 'polkadot',
|
||||
genesisHash: POLKADOT_GENESIS,
|
||||
info: 'polkadot',
|
||||
text: t('rpc.polkadot.parity', 'Polkadot', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
Parity: 'wss://rpc.polkadot.io',
|
||||
OnFinality: 'wss://polkadot.api.onfinality.io/public-ws',
|
||||
'Patract Elara': 'wss://polkadot.elara.patract.io'
|
||||
},
|
||||
linked: [
|
||||
// parachains with id, see Rococo
|
||||
// alphabetical based on chain name
|
||||
]
|
||||
};
|
||||
}
|
||||
16
packages/apps-config/src/endpoints/productionRelays.ts
Normal file
16
packages/apps-config/src/endpoints/productionRelays.ts
Normal file
@ -0,0 +1,16 @@
|
||||
// Copyright 2017-2021 @polkadot/apps-config authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { TFunction } from 'i18next';
|
||||
import type { LinkOption } from '../settings/types';
|
||||
|
||||
import { createKusama } from './productionRelayKusama';
|
||||
import { createPolkadot } from './productionRelayPolkadot';
|
||||
import { expandEndpoints } from './util';
|
||||
|
||||
export function createProductionRelays (t: TFunction): LinkOption[] {
|
||||
return expandEndpoints(t, [
|
||||
createPolkadot(t),
|
||||
createKusama(t)
|
||||
]);
|
||||
}
|
||||
@ -160,6 +160,13 @@ export function createTesting (t: TFunction): LinkOption[] {
|
||||
GamePower: 'wss://gamepower.io'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'halongbay',
|
||||
text: 'Halongbay Testnet',
|
||||
providers: {
|
||||
Halongbay: 'wss://halongbay.polkafoundry.com'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'ipse',
|
||||
text: t('rpc.ipse', 'IPSE', { ns: 'apps-config' }),
|
||||
@ -177,14 +184,6 @@ export function createTesting (t: TFunction): LinkOption[] {
|
||||
Patract: 'wss://ws.jupiter-poa.patract.cn'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'acala',
|
||||
text: t('rpc.mandala', 'Mandala', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
Acala: 'wss://acala-mandala.api.onfinality.io/public-ws',
|
||||
'Patract Elara': 'wss://mandala.elara.patract.io'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'kilt',
|
||||
text: t('rpc.kilt', 'KILT Mashnet', { ns: 'apps-config' }),
|
||||
@ -199,6 +198,14 @@ export function createTesting (t: TFunction): LinkOption[] {
|
||||
Litentry: 'wss://testnet.litentry.io'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'acala',
|
||||
text: t('rpc.mandala', 'Mandala', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
Acala: 'wss://acala-mandala.api.onfinality.io/public-ws',
|
||||
'Patract Elara': 'wss://mandala.elara.patract.io'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'moonbaseAlpha',
|
||||
text: t('rpc.moonbeam', 'Moonbase Alpha', { ns: 'apps-config' }),
|
||||
@ -208,6 +215,21 @@ export function createTesting (t: TFunction): LinkOption[] {
|
||||
'Patract Elara': 'wss://moonbase.moonbeam.elara.patract.io'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'mybank',
|
||||
text: t('rpc.mybank', 'mybank.network', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
MYBANK: 'wss://mybank.network/substrate'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'nftmart',
|
||||
text: t('rpc.nftmart', 'NFTMart', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
NFTMartDev: 'wss://dev-ws.nftmart.io',
|
||||
NFTMartStaging: 'wss://staging-ws.nftmart.io'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'phala',
|
||||
text: t('rpc.phala', 'Phala PoC-4', { ns: 'apps-config' }),
|
||||
@ -292,6 +314,13 @@ export function createTesting (t: TFunction): LinkOption[] {
|
||||
Unique: 'wss://testnet2.uniquenetwork.io'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'unitv',
|
||||
text: t('rpc.unitv', 'Unit Network', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
'Unit Network': 'wss://unitventures.io/'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'vln',
|
||||
text: t('rpc.vln', 'Valiu Liquidity Network', { ns: 'apps-config' }),
|
||||
@ -313,17 +342,6 @@ export function createTesting (t: TFunction): LinkOption[] {
|
||||
Web3Games: 'wss://substrate.org.cn:4443'
|
||||
}
|
||||
},
|
||||
{
|
||||
dnslink: 'westend',
|
||||
info: 'westend',
|
||||
text: t('rpc.westend', 'Westend', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
Parity: 'wss://westend-rpc.polkadot.io',
|
||||
'NodeFactory(Vedran)': 'wss://westend.vedran.nodefactory.io/ws',
|
||||
'Patract Elara': 'wss://westend.elara.patract.io',
|
||||
OnFinality: 'wss://westend.api.onfinality.io/public-ws'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'zeitgeist',
|
||||
text: t('rpc.zeitgeist', 'Zeitgeist Battery Park', { ns: 'apps-config' }),
|
||||
@ -337,35 +355,6 @@ export function createTesting (t: TFunction): LinkOption[] {
|
||||
providers: {
|
||||
ZERO: 'wss://alphaville.zero.io'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'mybank',
|
||||
text: t('rpc.mybank', 'mybank.network', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
MYBANK: 'wss://mybank.network/substrate'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'unitv',
|
||||
text: t('rpc.unitv', 'Unit Network', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
'Unit Network': 'wss://unitventures.io/'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'nftmart',
|
||||
text: t('rpc.nftmart', 'NFTMart', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
NFTMartDev: 'wss://dev-ws.nftmart.io',
|
||||
NFTMartStaging: 'wss://staging-ws.nftmart.io'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'halongbay',
|
||||
text: 'Halongbay Testnet',
|
||||
providers: {
|
||||
Halongbay: 'wss://halongbay.polkafoundry.com'
|
||||
}
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
||||
@ -2,10 +2,9 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { TFunction } from 'i18next';
|
||||
import type { LinkOption } from '../settings/types';
|
||||
import type { EndpointOption } from './types';
|
||||
|
||||
import { ROCOCO_GENESIS } from '../api/constants';
|
||||
import { expandEndpoints } from './util';
|
||||
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
@ -16,8 +15,8 @@ import { expandEndpoints } from './util';
|
||||
// value: The actual hosted secure websocket endpoint
|
||||
|
||||
// Based on history, this will expand so keep it as a singular chunk
|
||||
export function createRococo (t: TFunction): LinkOption[] {
|
||||
return expandEndpoints(t, [{
|
||||
export function createRococo (t: TFunction): EndpointOption {
|
||||
return {
|
||||
dnslink: 'rococo',
|
||||
genesisHash: ROCOCO_GENESIS,
|
||||
info: 'rococo',
|
||||
@ -65,7 +64,6 @@ export function createRococo (t: TFunction): LinkOption[] {
|
||||
// add any additional parachains here, alphabetical
|
||||
{
|
||||
info: 'rococoApron',
|
||||
// paraId >= 1000, below that is reserved for system parachains
|
||||
paraId: 2048,
|
||||
text: t('rpc.rococo.apron', 'Apron PC1', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
@ -90,8 +88,6 @@ export function createRococo (t: TFunction): LinkOption[] {
|
||||
},
|
||||
{
|
||||
info: 'rococoBitCountry',
|
||||
// Needs paraId >= 1000, below that is reserved for system parachains
|
||||
// Update paraId to new selection, remove this flag to enable
|
||||
paraId: 1008,
|
||||
text: t('rpc.rococo.bitcountry', 'Bit.Country PC1', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
@ -166,6 +162,17 @@ export function createRococo (t: TFunction): LinkOption[] {
|
||||
DataHighway: 'wss://spreehafen.datahighway.com'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'rococoEave',
|
||||
// Needs paraId >= 1000, below that is reserved for system parachains
|
||||
// Update paraId to new selection, remove this flag to enable
|
||||
isDisabled: true,
|
||||
paraId: 77,
|
||||
text: t('rpc.rococo.eave', 'Steam PC', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
EAVE: 'wss://steamcollator.eave.network'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'rococoEncointer',
|
||||
paraId: 1862,
|
||||
@ -217,14 +224,6 @@ export function createRococo (t: TFunction): LinkOption[] {
|
||||
SCS: 'wss://rococo.integritee.network'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'rococoJupiter',
|
||||
paraId: 1010,
|
||||
text: t('rpc.rococo.jupiter', 'Patract Jupiter PC1', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
jupiter: 'wss://ws.rococo.jupiter.patract.cn'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'rococoKilt',
|
||||
paraId: 12623,
|
||||
@ -270,9 +269,6 @@ export function createRococo (t: TFunction): LinkOption[] {
|
||||
},
|
||||
{
|
||||
info: 'rococoManta',
|
||||
// Needs paraId >= 1000, below that is reserved for system parachains
|
||||
// Update paraId to new selection, remove this flag to enable
|
||||
// isDisabled: true,
|
||||
paraId: 2021,
|
||||
text: t('rpc.rococo.manta', 'Manta PC1', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
@ -295,6 +291,14 @@ export function createRococo (t: TFunction): LinkOption[] {
|
||||
Parami: 'wss://rococo.parami.io'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'rococoJupiter',
|
||||
paraId: 1010,
|
||||
text: t('rpc.rococo.jupiter', 'Patract Jupiter PC1', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
jupiter: 'wss://ws.rococo.jupiter.patract.cn'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'rococoPhala',
|
||||
paraId: 1030,
|
||||
@ -303,6 +307,14 @@ export function createRococo (t: TFunction): LinkOption[] {
|
||||
Phala: 'wss://rococov1.phala.network/ws'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'rococoPhoenix',
|
||||
paraId: 6806,
|
||||
text: t('rpc.rococo.phoenix', 'PHOENIX PC1', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
'PHOENIX Protocol': 'wss://phoenix-ws.coinid.pro'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'rococoPlasm',
|
||||
paraId: 5000,
|
||||
@ -338,17 +350,6 @@ export function createRococo (t: TFunction): LinkOption[] {
|
||||
Airalab: 'wss://rococo.parachain.robonomics.network'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'rococoEave',
|
||||
// Needs paraId >= 1000, below that is reserved for system parachains
|
||||
// Update paraId to new selection, remove this flag to enable
|
||||
isDisabled: true,
|
||||
paraId: 77,
|
||||
text: t('rpc.rococo.eave', 'Steam PC', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
EAVE: 'wss://steamcollator.eave.network'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'rococoSubDAO',
|
||||
// Needs paraId >= 1000, below that is reserved for system parachains
|
||||
@ -379,22 +380,6 @@ export function createRococo (t: TFunction): LinkOption[] {
|
||||
TrustBase: 'wss://rococo.trustednodes.net'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'rococoZenlink',
|
||||
paraId: 1188,
|
||||
text: t('rpc.rococo.zenlink', 'Zenlink PC1', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
Zenlink: 'wss://rococo-parachain.zenlink.pro'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'rococoPhoenix',
|
||||
paraId: 6806,
|
||||
text: t('rpc.rococo.phoenix', 'PHOENIX PC1', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
'PHOENIX Protocol': 'wss://phoenix-ws.coinid.pro'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'rococoUnitv',
|
||||
// Needs paraId >= 1000, below that is reserved for system parachains
|
||||
@ -421,7 +406,15 @@ export function createRococo (t: TFunction): LinkOption[] {
|
||||
providers: {
|
||||
Zeitgeist: 'wss://roc.zeitgeist.pm'
|
||||
}
|
||||
},
|
||||
{
|
||||
info: 'rococoZenlink',
|
||||
paraId: 1188,
|
||||
text: t('rpc.rococo.zenlink', 'Zenlink PC1', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
Zenlink: 'wss://rococo-parachain.zenlink.pro'
|
||||
}
|
||||
}
|
||||
]
|
||||
}]);
|
||||
};
|
||||
}
|
||||
34
packages/apps-config/src/endpoints/testingRelayWestend.ts
Normal file
34
packages/apps-config/src/endpoints/testingRelayWestend.ts
Normal file
@ -0,0 +1,34 @@
|
||||
// Copyright 2017-2021 @polkadot/apps-config authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { TFunction } from 'i18next';
|
||||
import type { EndpointOption } from './types';
|
||||
|
||||
import { WESTEND_GENESIS } from '../api/constants';
|
||||
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
// The available endpoints that will show in the dropdown. For the most part (with the exception of
|
||||
// Polkadot) we try to keep this to live chains only, with RPCs hosted by the community/chain vendor
|
||||
// info: The chain logo name as defined in ../ui/logos/index.ts in namedLogos (this also needs to align with @polkadot/networks)
|
||||
// text: The text to display on the dropdown
|
||||
// value: The actual hosted secure websocket endpoint
|
||||
|
||||
// Based on history, this will expand so keep it as a singular chunk
|
||||
export function createWestend (t: TFunction): EndpointOption {
|
||||
return {
|
||||
dnslink: 'westend',
|
||||
genesisHash: WESTEND_GENESIS,
|
||||
info: 'westend',
|
||||
text: t('rpc.westend', 'Westend', { ns: 'apps-config' }),
|
||||
providers: {
|
||||
Parity: 'wss://westend-rpc.polkadot.io',
|
||||
'NodeFactory(Vedran)': 'wss://westend.vedran.nodefactory.io/ws',
|
||||
'Patract Elara': 'wss://westend.elara.patract.io',
|
||||
OnFinality: 'wss://westend.api.onfinality.io/public-ws'
|
||||
},
|
||||
linked: [
|
||||
// all parachains here (with paraId, see Rococo)
|
||||
]
|
||||
};
|
||||
}
|
||||
16
packages/apps-config/src/endpoints/testingRelays.ts
Normal file
16
packages/apps-config/src/endpoints/testingRelays.ts
Normal file
@ -0,0 +1,16 @@
|
||||
// Copyright 2017-2021 @polkadot/apps-config authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { TFunction } from 'i18next';
|
||||
import type { LinkOption } from '../settings/types';
|
||||
|
||||
import { createRococo } from './testingRelayRococo';
|
||||
import { createWestend } from './testingRelayWestend';
|
||||
import { expandEndpoints } from './util';
|
||||
|
||||
export function createTestingRelays (t: TFunction): LinkOption[] {
|
||||
return expandEndpoints(t, [
|
||||
createRococo(t),
|
||||
createWestend(t)
|
||||
]);
|
||||
}
|
||||
@ -15,6 +15,7 @@ export interface LinkOption extends Option {
|
||||
genesisHashRelay?: string;
|
||||
isChild?: boolean;
|
||||
isDevelopment?: boolean;
|
||||
isSpaced?: boolean;
|
||||
linked?: LinkOption[];
|
||||
paraId?: number;
|
||||
textBy: string;
|
||||
|
||||
@ -22,7 +22,7 @@ interface Props {
|
||||
value: Group;
|
||||
}
|
||||
|
||||
function GroupDisplay ({ affinities, apiUrl, children, className = '', index, isSelected, setApiUrl, setGroup, value: { header, networks } }: Props): React.ReactElement<Props> {
|
||||
function GroupDisplay ({ affinities, apiUrl, children, className = '', index, isSelected, setApiUrl, setGroup, value: { header, isSpaced, networks } }: Props): React.ReactElement<Props> {
|
||||
const _setGroup = useCallback(
|
||||
() => setGroup(isSelected ? -1 : index),
|
||||
[index, isSelected, setGroup]
|
||||
@ -31,7 +31,7 @@ function GroupDisplay ({ affinities, apiUrl, children, className = '', index, is
|
||||
return (
|
||||
<div className={`${className}${isSelected ? ' isSelected' : ''}`}>
|
||||
<div
|
||||
className='groupHeader'
|
||||
className={`groupHeader${isSpaced ? ' isSpaced' : ''}`}
|
||||
onClick={_setGroup}
|
||||
>
|
||||
<Icon icon={isSelected ? 'caret-up' : 'caret-down'} />
|
||||
@ -70,6 +70,10 @@ export default React.memo(styled(GroupDisplay)`
|
||||
background: var(--bg-table);
|
||||
}
|
||||
|
||||
&.isSpaced {
|
||||
margin-top: 0.75rem;
|
||||
}
|
||||
|
||||
.ui--Icon {
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ function isValidUrl (url: string): boolean {
|
||||
function combineEndpoints (endpoints: LinkOption[]): Group[] {
|
||||
return endpoints.reduce((result: Group[], e): Group[] => {
|
||||
if (e.isHeader) {
|
||||
result.push({ header: e.text, isDevelopment: e.isDevelopment, networks: [] });
|
||||
result.push({ header: e.text, isDevelopment: e.isDevelopment, isSpaced: e.isSpaced, networks: [] });
|
||||
} else {
|
||||
const prev = result[result.length - 1];
|
||||
const prov = { name: e.textBy, url: e.value as string };
|
||||
|
||||
@ -16,5 +16,6 @@ export interface Network {
|
||||
export interface Group {
|
||||
header: React.ReactNode;
|
||||
isDevelopment?: boolean;
|
||||
isSpaced?: boolean;
|
||||
networks: Network[];
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user