Skip to content

Commit

Permalink
Merge pull request #1 from finiam/dl/remove-polka
Browse files Browse the repository at this point in the history
Remove default chains and add madara logo and colors
  • Loading branch information
AbdelStark authored Mar 30, 2023
2 parents ba21cfe + 87c828a commit cd0581b
Show file tree
Hide file tree
Showing 313 changed files with 37 additions and 7,161 deletions.
7 changes: 6 additions & 1 deletion packages/apps-config/src/endpoints/development.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import type { TFunction } from '../types.js';
import type { LinkOption } from './types.js';

import { nodesMadaraPNG } from '../ui/logos/nodes/generated/madaraPNG.js';

export const CUSTOM_ENDPOINT_KEY = 'polkadot-app-custom-endpoints';

interface EnvWindow {
Expand Down Expand Up @@ -71,7 +73,10 @@ export function createDev (t: TFunction): LinkOption[] {
info: 'local',
text: t('rpc.dev.local', 'Local Node', { ns: 'apps-config' }),
textBy: '127.0.0.1:9944',
ui: {},
ui: {
color: '#000000',
logo: nodesMadaraPNG
},
value: 'ws://127.0.0.1:9944'
}
];
Expand Down
2 changes: 1 addition & 1 deletion packages/apps-config/src/endpoints/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface Endpoint {
value: string;
}

const allEndpoints = createWsEndpoints(undefined, false, false);
const allEndpoints = createWsEndpoints(undefined);

const INVALID_CHARS = ['%'];

Expand Down
62 changes: 8 additions & 54 deletions packages/apps-config/src/endpoints/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import type { TFunction, TOptions } from '../types.js';
import type { LinkOption } from './types.js';

import { createCustom, createDev, createOwn } from './development.js';
import { prodChains, prodRelayKusama, prodRelayPolkadot } from './production.js';
import { testChains, testRelayRococo, testRelayWestend } from './testing.js';
import { expandEndpoints } from './util.js';
// import { testChains } from './testing.js';
// import { expandEndpoints } from './util.js';

export { CUSTOM_ENDPOINT_KEY } from './development.js';
export * from './production.js';
Expand All @@ -25,66 +24,21 @@ function defaultT (keyOrText: string, text?: string, options?: TOptions): string
);
}

export function createWsEndpoints (t: TFunction = defaultT, firstOnly = false, withSort = true): LinkOption[] {
export function createWsEndpoints (t: TFunction = defaultT): LinkOption[] {
return [
...createCustom(t),
{
isDisabled: false,
isHeader: true,
isSpaced: true,
text: t('rpc.header.polkadot.relay', 'Polkadot & parachains', { ns: 'apps-config' }),
textBy: '',
ui: {},
value: ''
},
...expandEndpoints(t, [prodRelayPolkadot], firstOnly, withSort),
{
isDisabled: false,
isHeader: true,
text: t('rpc.header.kusama.relay', 'Kusama & parachains', { ns: 'apps-config' }),
textBy: '',
ui: {},
value: ''
},
...expandEndpoints(t, [prodRelayKusama], firstOnly, withSort),
{
isDisabled: false,
isHeader: true,
isSpaced: true,
text: t('rpc.header.westend.relay', 'Test Westend & parachains', { ns: 'apps-config' }),
textBy: '',
ui: {},
value: ''
},
...expandEndpoints(t, [testRelayWestend], firstOnly, withSort),
{
isDisabled: false,
isHeader: true,
text: t('rpc.header.rococo.relay', 'Test Rococo & parachains', { ns: 'apps-config' }),
textBy: '',
ui: {},
value: ''
},
...expandEndpoints(t, [testRelayRococo], firstOnly, withSort),
{
isDisabled: false,
isHeader: true,
isSpaced: true,
text: t('rpc.header.live', 'Live networks', { ns: 'apps-config' }),
textBy: '',
ui: {},
value: ''
},
...expandEndpoints(t, prodChains, firstOnly, withSort),
{

// TODO: Add test networks here
/* {
isDisabled: false,
isHeader: true,
text: t('rpc.header.test', 'Test networks', { ns: 'apps-config' }),
textBy: '',
ui: {},
value: ''
},
...expandEndpoints(t, testChains, firstOnly, withSort),
...expandEndpoints(t, testChains, firstOnly, withSort), */

{
isDevelopment: true,
isDisabled: false,
Expand Down
Loading

0 comments on commit cd0581b

Please sign in to comment.