diff --git a/packages/apps/src/Content/NotFound.tsx b/packages/apps/src/Content/NotFound.tsx index f3addbaa45..369c2c7e7f 100644 --- a/packages/apps/src/Content/NotFound.tsx +++ b/packages/apps/src/Content/NotFound.tsx @@ -2,10 +2,18 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +import { RouteProps } from '@polkadot/apps-routing/types'; + import React from 'react'; import { Redirect } from 'react-router'; -function NotFound (): React.ReactElement { +interface Props extends RouteProps { + missingApis?: (string | string[])[]; +} + +function NotFound ({ basePath, missingApis = [] }: Props): React.ReactElement { + console.log(`Redirecting from route "${basePath}" to "explorer", missing the following APIs: ${JSON.stringify(missingApis)}`); + return ( ); diff --git a/packages/apps/src/Content/index.tsx b/packages/apps/src/Content/index.tsx index 42cc03610b..7a7fe32a76 100644 --- a/packages/apps/src/Content/index.tsx +++ b/packages/apps/src/Content/index.tsx @@ -47,10 +47,7 @@ function Content ({ className }: Props): React.ReactElement { [location, t] ); - const missingApis = useMemo( - () => findMissingApis(api, needsApi), - [api, needsApi] - ); + const missingApis = findMissingApis(api, needsApi); return (
@@ -63,18 +60,25 @@ function Content ({ className }: Props): React.ReactElement { : ( <> - {missingApis.length - ? - : ( - + + {missingApis.length + ? ( + + ) + : ( - - ) - } + ) + } + diff --git a/packages/page-staking/src/Overview/Address/index.tsx b/packages/page-staking/src/Overview/Address/index.tsx index 300b8d78e3..acc9896e09 100644 --- a/packages/page-staking/src/Overview/Address/index.tsx +++ b/packages/page-staking/src/Overview/Address/index.tsx @@ -142,7 +142,7 @@ function Address ({ address, className = '', filterName, hasQueries, isElected, /> ) } - + {stakeOwn?.gtn(0) && ( )} @@ -168,7 +168,7 @@ function Address ({ address, className = '', filterName, hasQueries, isElected, /> )} - + )} {!!next?.length && ( - ('waiting')}> + ('waiting')} + > {next.length} )} {!!nominators?.length && ( - ('nominators')}> + ('nominators')} + > {nominators.length} )} diff --git a/packages/page-staking/src/Targets/Summary.tsx b/packages/page-staking/src/Targets/Summary.tsx index 88ca7d78f6..14f10c17bc 100644 --- a/packages/page-staking/src/Targets/Summary.tsx +++ b/packages/page-staking/src/Targets/Summary.tsx @@ -77,7 +77,7 @@ function Summary ({ avgStaked, lastReward, lowStaked, numNominators, numValidato {avgStaked && lowStaked && ( ('lowest / avg staked')}`} progress={progressAvg} >