ghost-portal/packages/apps-config/src/ui/index.ts
Jaco b47f6cbacf
Check endpoints sort order (#5564)
* Check endpoints sort order

* colors adjust

* Adjust

* Sorting via objects

* linting

* shared santize
2021-06-11 17:41:03 +02:00

25 lines
789 B
TypeScript

// Copyright 2017-2021 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { chainColors, nodeColors, specColors } from './colors';
import { identityNodes, identitySpec } from './identityIcons';
import { sanitize } from './util';
export * from './logos';
export function getSystemIcon (systemName: string, specName: string): 'beachball' | 'polkadot' | 'substrate' {
return (
identityNodes[sanitize(systemName)] ||
identitySpec[sanitize(specName)] ||
'substrate'
) as 'substrate';
}
export function getSystemColor (systemChain: string, systemName: string, specName: string): string | undefined {
return (
chainColors[sanitize(systemChain)] ||
nodeColors[sanitize(systemName)] ||
specColors[sanitize(specName)]
);
}