From 7543a256fce6b823f5173c9abbbb1dcba8b245ca Mon Sep 17 00:00:00 2001 From: Kailas Date: Mon, 17 Jul 2023 16:53:50 +0530 Subject: [PATCH 1/5] minor fixes --- .../apps-config/src/endpoints/development.ts | 7 +- packages/apps-config/src/endpoints/testing.ts | 2 - .../src/Accounts/BannerExtension.tsx | 12 +-- .../page-accounts/src/Accounts/Summary.tsx | 81 +++++++++---------- packages/page-accounts/src/Accounts/index.tsx | 24 +++--- packages/react-components/src/styles/index.ts | 2 +- 6 files changed, 62 insertions(+), 66 deletions(-) diff --git a/packages/apps-config/src/endpoints/development.ts b/packages/apps-config/src/endpoints/development.ts index d7a5fbc34383..90f1fb86de03 100644 --- a/packages/apps-config/src/endpoints/development.ts +++ b/packages/apps-config/src/endpoints/development.ts @@ -4,6 +4,8 @@ import type { TFunction } from '../types.js'; import type { LinkOption } from './types.js'; +import { nodesAvailPNG } from '../ui/logos/nodes/index.js'; + export const CUSTOM_ENDPOINT_KEY = 'polkadot-app-custom-endpoints'; interface EnvWindow { @@ -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: '#1B1E26', + logo: nodesAvailPNG + }, value: 'ws://127.0.0.1:9944' } ]; diff --git a/packages/apps-config/src/endpoints/testing.ts b/packages/apps-config/src/endpoints/testing.ts index c39a13ba0452..7235e69c689d 100644 --- a/packages/apps-config/src/endpoints/testing.ts +++ b/packages/apps-config/src/endpoints/testing.ts @@ -5,10 +5,8 @@ import type { EndpointOption } from './types.js'; // import { chains3dpassSVG, chainsAcalaSVG, chainsAlephSVG, chainsBrainstormPNG, chainsCreditcoinTestPNG, chainsDebioSVG, chainsEquilibriumSVG, chainsFerrumPNG, chainsFragnovaPNG, chainsJurPNG, chainsKintsugiPNG, chainsLogionPNG, chainsMyriadPNG, chainsShidenPNG, chainsSkyekiwiPNG, chainsTanglePNG } from '../ui/logos/chains/index.js'; // import { nodesAjunaPNG, nodesArcticPNG, nodesAresGladiosSVG, nodesAutomataPNG, nodesBifrostSVG, nodesBitcountryPNG, nodesCereSVG, nodesCessPNG, nodesCloverSVG, nodesCrustMaxwellSVG, nodesCurioSVG, nodesDatahighwayPNG, nodesDockPNG, nodesDolphinSVG, nodesDotmogSVG, nodesEdgewareWhitePNG, nodesEncointerBlueSVG, nodesFantourPNG, nodesGalitalLogoPNG, nodesGamepowerSVG, nodesGeekSVG, nodesInterlaySVG, nodesIpsePNG, nodesJazPNG, nodesJupiterSVG, nodesKarmachainSVG, nodesKhalaSVG, nodesKiltPNG, nodesKlugPNG, nodesKylinPNG, nodesLaminarCircleSVG, nodesLitentryPNG, nodesMantaPNG, nodesMathSVG, nodesMinixPNG, nodesMoonbaseAlphaSVG, nodesMybankPNG, nodesNftmartPNG, nodesNodleSVG, nodesOpalLogoPNG, nodesOpportunityPNG, nodesPangoroSVG, nodesPhalaSVG, nodesPhoenixPNG, nodesPichiuPNG, nodesPolkadexSVG, nodesPolkafoundrySVG, nodesPolymeshSVG, nodesPontemSVG, nodesPrismPNG, nodesRealisPNG, nodesRiochainSVG, nodesSherpaxPNG, nodesSoonsocialPNG, nodesSoraSubstrateSVG, nodesSubdaoPNG, nodesSubgameSVG, nodesSubspacePNG, nodesSubstrateHexagonSVG, nodesTernoaSVG, nodesThebifrostPNG, nodesUniartsPNG, nodesUniqueSVG, nodesUnitnetworkPNG, nodesWeb3gamesSVG, nodesZCloakSVG } from '../ui/logos/nodes/index.js'; - // export * from './testingRelayRococo.js'; // export * from './testingRelayWestend.js'; - import { nodesAvailPNG } from '../ui/logos/nodes/index.js'; import config from '../variables/config.js'; diff --git a/packages/page-accounts/src/Accounts/BannerExtension.tsx b/packages/page-accounts/src/Accounts/BannerExtension.tsx index 9e17e031dc0a..f07cbda9835c 100644 --- a/packages/page-accounts/src/Accounts/BannerExtension.tsx +++ b/packages/page-accounts/src/Accounts/BannerExtension.tsx @@ -26,7 +26,7 @@ function BannerExtension (): React.ReactElement | null { const { t } = useTranslation(); const { hasInjectedAccounts } = useApi(); const upgradableCount = useExtensionCounter(); - const phishing = useRef(t('Since some extensions, such as the polkadot-js extension, protects you against all community reported phishing sites, there are valid reasons to use them for additional protection, even if you are not storing accounts in it.')); + const phishing = useRef(t('')); if (!isSupported || !browserName) { return null; @@ -63,12 +63,12 @@ function BannerExtension (): React.ReactElement | null { return ( -

{t('It is recommended that you create/store your accounts securely and externally from the app. On {{yourBrowser}} the following browser extensions are available for use -', { +

{t('We have disabled the use of polkadot-js extension for now!', { replace: { yourBrowser: stringUpperFirst(browserName) } })}

- */} + {/*

{t('')}  {t('Learn more...')} -

+

*/}

{phishing.current}

); diff --git a/packages/page-accounts/src/Accounts/Summary.tsx b/packages/page-accounts/src/Accounts/Summary.tsx index 4bb3e0d198a0..33035e2aa5d7 100644 --- a/packages/page-accounts/src/Accounts/Summary.tsx +++ b/packages/page-accounts/src/Accounts/Summary.tsx @@ -20,48 +20,45 @@ function Summary ({ balance, className }: Props) { return ( - ('total balance')}> - - - ('total transferrable')} - > - - - ('total locked')}> - - - {balance?.bonded.gtn(0) && - ('bonded')} - > - - } - {balance?.redeemable.gtn(0) && - ('redeemable')} - > - - } - {balance?.unbonding.gtn(0) && - ('unbonding')} - > - - } + {balance && ( + <> + {balance.total.gtn(0) && + ('total balance')}> + + } + {balance.transferrable.gtn(0) && + ('total transferrable')} + > + + } + {balance.locked.gtn(0) && + ('total locked')}> + + } + {balance.bonded.gtn(0) && + ('bonded')} + > + + } + {balance.redeemable.gtn(0) && + ('redeemable')} + > + + } + {balance.unbonding.gtn(0) && + ('unbonding')} + > + + } + )} ); } diff --git a/packages/page-accounts/src/Accounts/index.tsx b/packages/page-accounts/src/Accounts/index.tsx index 90733cf0e820..2bbc09864cef 100644 --- a/packages/page-accounts/src/Accounts/index.tsx +++ b/packages/page-accounts/src/Accounts/index.tsx @@ -333,20 +333,16 @@ function Overview ({ className = '', onStatusChange }: Props): React.ReactElemen /> - {canStoreAccounts && ( - <> -