diff --git a/packages/apps/src/Content/index.tsx b/packages/apps/src/Content/index.tsx index 920b56f7fe..42cc03610b 100644 --- a/packages/apps/src/Content/index.tsx +++ b/packages/apps/src/Content/index.tsx @@ -37,6 +37,7 @@ function Content ({ className }: Props): React.ReactElement { const { t } = useTranslation(); const { api, isApiConnected, isApiReady } = useApi(); const { queueAction } = useContext(StatusContext); + const { Component, display: { needsApi }, name } = useMemo( (): Route => { const app = location.pathname.slice(1) || ''; @@ -46,9 +47,14 @@ function Content ({ className }: Props): React.ReactElement { [location, t] ); + const missingApis = useMemo( + () => findMissingApis(api, needsApi), + [api, needsApi] + ); + return (
- {(!isApiReady || !isApiConnected) + {needsApi && (!isApiReady || !isApiConnected) ? (
('Initializing connection')} /> @@ -57,7 +63,7 @@ function Content ({ className }: Props): React.ReactElement { : ( <> - {findMissingApis(api, needsApi).length + {missingApis.length ? : ( @@ -82,7 +88,7 @@ export default React.memo(styled(Content)` flex-grow: 1; overflow-x: hidden; overflow-y: auto; - padding: 0 2.5rem 1rem; + padding: 0 2rem 1rem; position: relative; width: 100%; diff --git a/packages/apps/src/Menu/index.tsx b/packages/apps/src/Menu/index.tsx index 65a48e44f6..c40e1e7166 100644 --- a/packages/apps/src/Menu/index.tsx +++ b/packages/apps/src/Menu/index.tsx @@ -48,6 +48,8 @@ function checkVisible (name: string, { api, isApiConnected, isApiReady }: ApiPro return false; } else if (needsAccounts && !hasAccounts) { return false; + } else if (!needsApi) { + return true; } else if (!isApiReady || !isApiConnected) { return false; } else if (needsSudo && !hasSudo) { diff --git a/packages/page-settings/src/index.tsx b/packages/page-settings/src/index.tsx index c81a98cefd..309f130e94 100644 --- a/packages/page-settings/src/index.tsx +++ b/packages/page-settings/src/index.tsx @@ -7,6 +7,7 @@ import { AppProps as Props } from '@polkadot/react-components/types'; import React, { useMemo } from 'react'; import { Route, Switch } from 'react-router'; import { HelpOverlay, Tabs } from '@polkadot/react-components'; +import { useApi } from '@polkadot/react-hooks'; import md from './md/basics.md'; import { useTranslation } from './translate'; @@ -20,7 +21,9 @@ export { useCounter }; function SettingsApp ({ basePath, onStatusChange }: Props): React.ReactElement { const { t } = useTranslation(); + const { isApiConnected, isApiReady } = useApi(); const numExtensions = useCounter(); + const items = useMemo(() => [ { isRoot: true, @@ -42,12 +45,18 @@ function SettingsApp ({ basePath, onStatusChange }: Props): React.ReactElement
diff --git a/packages/react-components/src/AddressInfo.tsx b/packages/react-components/src/AddressInfo.tsx index be1150fe85..fb5c9a83de 100644 --- a/packages/react-components/src/AddressInfo.tsx +++ b/packages/react-components/src/AddressInfo.tsx @@ -438,7 +438,7 @@ export default withMulti( justify-content: start; &.column--expander { - width: 16.5rem; + width: 17.5rem; .ui--Expander { width: 100%; diff --git a/packages/react-components/src/Expander.tsx b/packages/react-components/src/Expander.tsx index c822e11341..eb616938a2 100644 --- a/packages/react-components/src/Expander.tsx +++ b/packages/react-components/src/Expander.tsx @@ -107,11 +107,11 @@ export default React.memo(styled(Expander)` .ui--Expander-summary { margin: 0; - min-width: 12.5rem; + min-width: 13.5rem; overflow: hidden; .ui--Expander-summary-header > .ui--FormatBalance { - min-width: 10rem; + min-width: 11rem; } > div { @@ -126,7 +126,6 @@ export default React.memo(styled(Expander)` .ui--Expander-summary-sub { font-size: 1rem; opacity: 0.6; - padding-left: 1.75rem; } } `);