From ca7f96bd6e2d5576aca6a84a1372378233f4412b Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Mon, 23 Nov 2020 12:26:21 +0100 Subject: [PATCH] Helper NOTE RPCs for colors and logos (#4060) --- packages/apps-config/src/ui/colors.ts | 8 ++++---- packages/apps-config/src/ui/logos/index.ts | 17 ++++++++--------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/packages/apps-config/src/ui/colors.ts b/packages/apps-config/src/ui/colors.ts index 2f75c9ff63..0d9060c3b7 100644 --- a/packages/apps-config/src/ui/colors.ts +++ b/packages/apps-config/src/ui/colors.ts @@ -42,8 +42,8 @@ const nodeSubsocial = '#b9018c'; export { emptyColor }; -// overrides based on the actual matched chain name -// alphabetical +// Alphabetical overrides based on the actual matched chain name +// NOTE: This is as retrieved via the system.chain RPC export const chainColors: Record = [ ['acala mandala pc1', chainRoccoAcala], ['Darwinia Crab', chainCrab], @@ -72,8 +72,8 @@ export const chainColors: Record = [ [chain.toLowerCase()]: color }), {}); -// overrides based on the actual software node type (all '-' converted to ' ') -// alphabetical +// Alphabetical overrides based on the actual software node type +// NOTE: This is as retrieved via the system.name RPC export const nodeColors: Record = [ ['Bifrost Node', nodeBifrost], ['Canvas Node', nodeCanvas], diff --git a/packages/apps-config/src/ui/logos/index.ts b/packages/apps-config/src/ui/logos/index.ts index b38cb12b12..f4b8abad38 100644 --- a/packages/apps-config/src/ui/logos/index.ts +++ b/packages/apps-config/src/ui/logos/index.ts @@ -58,9 +58,8 @@ import externalSubscan from './external/subscan.svg'; // last-resort fallback, just something empty import emptyLogo from './empty.svg'; -// overrides based on the actual matched chain name -// NOTE: this matches up with RPC system.chain -// alphabetical +// Alphabetical overrides based on the actual matched chain name +// NOTE: This is as retrieved via system.chain RPC export const chainLogos: Record = [ ['darwinia crab', nodeCrab], ['Dusty', chainDusty], @@ -78,9 +77,8 @@ export const chainLogos: Record = [ [(chain as string).toLowerCase()]: logo }), {}); -// overrides based on the actual software node type (all '-' converted to ' ') -// NOTE: this matches up with what the RPC via system.name -// alphabetical +// Alphabetical overrides based on the actual software node type +// NOTE: This is as retrieved via system.name RPC export const nodeLogos: Record = [ ['airalab-robonomics', nodeRobonomics], ['Bifrost Node', nodeBifrost], @@ -118,9 +116,10 @@ export const nodeLogos: Record = [ [(node as string).toLowerCase().replace(/-/g, ' ')]: logo }), {}); -// overrides when we pass an explicit logo name -// NOTE: this matches up with what is defined as "info" in settings/endpoints.ts -// alphabetical +// Alphabetical overrides when we pass an explicit logo name +// NOTE: Matches with what is defined as "info" in settings/endpoints.ts +// (Generally would be the 'network' key in the known ss58 as per +// https://github.com/polkadot-js/common/blob/master/packages/networks/src/index.ts) export const namedLogos: Record = { acala: nodeAcala, alexander: nodePolkadot,