diff --git a/.eslintrc.js b/.eslintrc.js index 291486a1e3..6a8df6c681 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -32,7 +32,9 @@ module.exports = { 'error', { groups: [ - ['^[^\/\\.]'], + ['^\u0000'], + ['^[^/\\.].*\u0000$', '^@polkadot.*\u0000$', '^\\..*\u0000$'], + ['^[^/\\.]'], ['^@polkadot'], ['^\\.'] ], diff --git a/package.json b/package.json index 7e185c61b1..f55531a8f7 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,6 @@ "lint:css": "stylelint './packages/**/src/**/*.tsx'", "postinstall": "polkadot-dev-yarn-only", "postinstall:electron": "electron-builder install-app-deps", - "prepare": "patch-package", "test": "polkadot-dev-run-test --selectProjects=fast-tests --silent --testPathIgnorePatterns slow --testNamePattern='^((?!--SLOW--).)*$'", "test:all": "polkadot-dev-run-test --selectProjects=all-tests --silent", "test:one": "polkadot-dev-run-test", @@ -85,10 +84,8 @@ "electron": "^10.1.6", "electron-builder": "^22.9.1", "electron-builder-notarize": "^1.2.0", - "eslint-plugin-simple-import-sort": "^6.0.1", + "eslint-plugin-simple-import-sort": "7.0.0-beta.1", "i18next-scanner": "^2.11.0", - "patch-package": "^6.2.2", - "postinstall-prepare": "^1.0.1", "react": "^17.0.1", "react-dom": "^17.0.1", "react-is": "^17.0.1", diff --git a/packages/apps-config/src/api/bundle/spec/acala.ts b/packages/apps-config/src/api/bundle/spec/acala.ts index dcb2fe9b29..8145d31c10 100644 --- a/packages/apps-config/src/api/bundle/spec/acala.ts +++ b/packages/apps-config/src/api/bundle/spec/acala.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/apps-config authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { typesBundleForPolkadot } from '@acala-network/type-definitions'; - import type { OverrideBundleDefinition } from '@polkadot/types/types'; +import { typesBundleForPolkadot } from '@acala-network/type-definitions'; + export default typesBundleForPolkadot.spec.acala as OverrideBundleDefinition; diff --git a/packages/apps-config/src/api/bundle/spec/laminar.ts b/packages/apps-config/src/api/bundle/spec/laminar.ts index bce5619f80..33e4722f32 100644 --- a/packages/apps-config/src/api/bundle/spec/laminar.ts +++ b/packages/apps-config/src/api/bundle/spec/laminar.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/apps-config authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { typesBundleForPolkadot } from '@laminar/type-definitions'; - import type { OverrideBundleDefinition } from '@polkadot/types/types'; +import { typesBundleForPolkadot } from '@laminar/type-definitions'; + export default typesBundleForPolkadot.spec.acala as OverrideBundleDefinition; diff --git a/packages/apps-config/src/links/index.ts b/packages/apps-config/src/links/index.ts index 1a9064d6f4..94e1ca6f5d 100644 --- a/packages/apps-config/src/links/index.ts +++ b/packages/apps-config/src/links/index.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { ExternalDef } from './types'; + import Commonwealth from './commonwealth'; import Polkascan from './polkascan'; import Polkassembly from './polkassembly'; diff --git a/packages/apps-config/src/settings/endpoints.ts b/packages/apps-config/src/settings/endpoints.ts index 4f4ccacd1b..d24ebe4244 100644 --- a/packages/apps-config/src/settings/endpoints.ts +++ b/packages/apps-config/src/settings/endpoints.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; - import type { LinkOption } from './types'; + import { CUSTOM_ENDPOINT_KEY } from './constants'; interface EnvWindow { diff --git a/packages/apps-config/src/settings/languages.ts b/packages/apps-config/src/settings/languages.ts index 409e720e52..66b93be6d7 100644 --- a/packages/apps-config/src/settings/languages.ts +++ b/packages/apps-config/src/settings/languages.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; - import type { Option } from './types'; export function createLanguages (t: TFunction): Option[] { diff --git a/packages/apps-config/src/settings/ss58.ts b/packages/apps-config/src/settings/ss58.ts index 2a4b57d8db..73b8215bff 100644 --- a/packages/apps-config/src/settings/ss58.ts +++ b/packages/apps-config/src/settings/ss58.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Option } from './types'; import known from '@polkadot/networks'; -import type { Option } from './types'; - // Definitions here are with the following values - // info: the name of a logo as defined in ../logos, specifically in namedLogos // text: The text you wish to display in the dropdown diff --git a/packages/apps-config/src/ui/logos/index.ts b/packages/apps-config/src/ui/logos/index.ts index fb51a4a966..d347d39a2a 100644 --- a/packages/apps-config/src/ui/logos/index.ts +++ b/packages/apps-config/src/ui/logos/index.ts @@ -8,10 +8,10 @@ // alphabetical import chainDusty from './chains/dusty.png'; import chainKusama from './chains/kusama-128.gif'; +import chainRococo from './chains/rococo.svg'; import chainRococoTick from './chains/rococo-tick.svg'; import chainRococoTrack from './chains/rococo-track.svg'; import chainRococoTrick from './chains/rococo-trick.svg'; -import chainRococo from './chains/rococo.svg'; // last-resort fallback, just something empty import emptyLogo from './empty.svg'; // extensions diff --git a/packages/apps-electron/src/index.tsx b/packages/apps-electron/src/index.tsx index 9c0d7dcf01..86a1c45b82 100644 --- a/packages/apps-electron/src/index.tsx +++ b/packages/apps-electron/src/index.tsx @@ -5,6 +5,7 @@ import '@polkadot/apps/initSettings'; import 'semantic-ui-css/semantic.min.css'; import '@polkadot/react-components/i18n'; + import React from 'react'; import ReactDOM from 'react-dom'; diff --git a/packages/apps-electron/src/main/account-store.spec.ts b/packages/apps-electron/src/main/account-store.spec.ts index 8144f88f74..7d5900523c 100644 --- a/packages/apps-electron/src/main/account-store.spec.ts +++ b/packages/apps-electron/src/main/account-store.spec.ts @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { KeyringJson } from '@polkadot/ui-keyring/types'; + import * as tmp from 'tmp'; -import type { KeyringJson } from '@polkadot/ui-keyring/types'; import { FileStore } from '@polkadot/ui-keyring/stores'; import { accountStoreIpcHandler } from './account-store'; diff --git a/packages/apps-electron/src/main/account-store.ts b/packages/apps-electron/src/main/account-store.ts index 4c5e16f649..118c28c609 100644 --- a/packages/apps-electron/src/main/account-store.ts +++ b/packages/apps-electron/src/main/account-store.ts @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { KeyringJson } from '@polkadot/ui-keyring/types'; + import { app } from 'electron'; import path from 'path'; -import type { KeyringJson } from '@polkadot/ui-keyring/types'; import { FileStore } from '@polkadot/ui-keyring/stores'; import { IpcMainHandler } from './ipc-main-handler'; diff --git a/packages/apps-electron/src/preload.ts b/packages/apps-electron/src/preload.ts index 06da03cea4..df48975c91 100644 --- a/packages/apps-electron/src/preload.ts +++ b/packages/apps-electron/src/preload.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { contextBridge, ipcRenderer } from 'electron'; - import type { KeyringJson } from '@polkadot/ui-keyring/types'; +import { contextBridge, ipcRenderer } from 'electron'; + contextBridge.exposeInMainWorld('ElectronMain', { accountStore: { all: () => ipcRenderer.invoke('account-store-all'), diff --git a/packages/apps-routing/src/accounts.ts b/packages/apps-routing/src/accounts.ts index ee9ddf6c0c..ca5c2b6cb2 100644 --- a/packages/apps-routing/src/accounts.ts +++ b/packages/apps-routing/src/accounts.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Route } from './types'; import Component, { useCounter } from '@polkadot/app-accounts'; -import type { Route } from './types'; - export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/addresses.ts b/packages/apps-routing/src/addresses.ts index 1105ea120d..2170db3253 100644 --- a/packages/apps-routing/src/addresses.ts +++ b/packages/apps-routing/src/addresses.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Route } from './types'; import Component from '@polkadot/app-addresses'; -import type { Route } from './types'; - export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/bounties.ts b/packages/apps-routing/src/bounties.ts index b88a968908..e3486a9695 100644 --- a/packages/apps-routing/src/bounties.ts +++ b/packages/apps-routing/src/bounties.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Route } from './types'; import Component from '@polkadot/app-bounties'; -import type { Route } from './types'; - export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/calendar.ts b/packages/apps-routing/src/calendar.ts index 0ffaefc237..f374f6e1ef 100644 --- a/packages/apps-routing/src/calendar.ts +++ b/packages/apps-routing/src/calendar.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Route } from './types'; import Component from '@polkadot/app-calendar'; -import type { Route } from './types'; - export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/claims.ts b/packages/apps-routing/src/claims.ts index 9d86c2b412..2b69bf6e40 100644 --- a/packages/apps-routing/src/claims.ts +++ b/packages/apps-routing/src/claims.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Route } from './types'; import Component, { useCounter } from '@polkadot/app-claims'; -import type { Route } from './types'; - export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/contracts.ts b/packages/apps-routing/src/contracts.ts index f542634e96..09b8d23652 100644 --- a/packages/apps-routing/src/contracts.ts +++ b/packages/apps-routing/src/contracts.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Route } from './types'; import Component from '@polkadot/app-contracts'; -import type { Route } from './types'; - export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/council.ts b/packages/apps-routing/src/council.ts index 0e7a5e9038..ac70cf9d7c 100644 --- a/packages/apps-routing/src/council.ts +++ b/packages/apps-routing/src/council.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Route } from './types'; import Component, { useCounter } from '@polkadot/app-council'; -import type { Route } from './types'; - export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/democracy.ts b/packages/apps-routing/src/democracy.ts index 01c16ab640..8e1c35936e 100644 --- a/packages/apps-routing/src/democracy.ts +++ b/packages/apps-routing/src/democracy.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Route } from './types'; import Component, { useCounter } from '@polkadot/app-democracy'; -import type { Route } from './types'; - export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/explorer.ts b/packages/apps-routing/src/explorer.ts index ad1c8ebcd3..656364ef22 100644 --- a/packages/apps-routing/src/explorer.ts +++ b/packages/apps-routing/src/explorer.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Route } from './types'; import Component from '@polkadot/app-explorer'; -import type { Route } from './types'; - export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/extrinsics.ts b/packages/apps-routing/src/extrinsics.ts index d8e05933bf..e740f17962 100644 --- a/packages/apps-routing/src/extrinsics.ts +++ b/packages/apps-routing/src/extrinsics.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Route } from './types'; import Component from '@polkadot/app-extrinsics'; -import type { Route } from './types'; - export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/generic-asset.ts b/packages/apps-routing/src/generic-asset.ts index 37624d023e..f32fc21670 100644 --- a/packages/apps-routing/src/generic-asset.ts +++ b/packages/apps-routing/src/generic-asset.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Route } from './types'; import Component from '@polkadot/app-generic-asset'; -import type { Route } from './types'; - export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/index.ts b/packages/apps-routing/src/index.ts index 98f349dd00..a42a6e105e 100644 --- a/packages/apps-routing/src/index.ts +++ b/packages/apps-routing/src/index.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; - import type { Routes } from './types'; + import accounts from './accounts'; import addresses from './addresses'; import bounties from './bounties'; diff --git a/packages/apps-routing/src/js.ts b/packages/apps-routing/src/js.ts index 15707bb0f1..bc9447a674 100644 --- a/packages/apps-routing/src/js.ts +++ b/packages/apps-routing/src/js.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Route } from './types'; import Component from '@polkadot/app-js'; -import type { Route } from './types'; - export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/parachains.ts b/packages/apps-routing/src/parachains.ts index 642d54e7af..6811dd22d0 100644 --- a/packages/apps-routing/src/parachains.ts +++ b/packages/apps-routing/src/parachains.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Route } from './types'; import Component from '@polkadot/app-parachains'; -import type { Route } from './types'; - export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/poll.ts b/packages/apps-routing/src/poll.ts index 001a5bd77d..cdce254f32 100644 --- a/packages/apps-routing/src/poll.ts +++ b/packages/apps-routing/src/poll.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Route } from './types'; import Component from '@polkadot/app-poll'; -import type { Route } from './types'; - export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/rpc.ts b/packages/apps-routing/src/rpc.ts index b27568efa8..89d4f9721e 100644 --- a/packages/apps-routing/src/rpc.ts +++ b/packages/apps-routing/src/rpc.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Route } from './types'; import Component from '@polkadot/app-rpc'; -import type { Route } from './types'; - export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/settings.ts b/packages/apps-routing/src/settings.ts index f4a1be4937..44b0a7874d 100644 --- a/packages/apps-routing/src/settings.ts +++ b/packages/apps-routing/src/settings.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Route } from './types'; import Component, { useCounter } from '@polkadot/app-settings'; -import type { Route } from './types'; - export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/signing.ts b/packages/apps-routing/src/signing.ts index a99a8a3b01..9fe1162605 100644 --- a/packages/apps-routing/src/signing.ts +++ b/packages/apps-routing/src/signing.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Route } from './types'; import Component from '@polkadot/app-signing'; -import type { Route } from './types'; - export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/society.ts b/packages/apps-routing/src/society.ts index 0a2b1a95a7..53e2420ad8 100644 --- a/packages/apps-routing/src/society.ts +++ b/packages/apps-routing/src/society.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Route } from './types'; import Component, { useCounter } from '@polkadot/app-society'; -import type { Route } from './types'; - export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/staking.ts b/packages/apps-routing/src/staking.ts index 8de6546824..5c945f42f1 100644 --- a/packages/apps-routing/src/staking.ts +++ b/packages/apps-routing/src/staking.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Route } from './types'; import Component from '@polkadot/app-staking'; -import type { Route } from './types'; - export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/storage.ts b/packages/apps-routing/src/storage.ts index f1e3d7e565..dfac0cd6e9 100644 --- a/packages/apps-routing/src/storage.ts +++ b/packages/apps-routing/src/storage.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Route } from './types'; import Component from '@polkadot/app-storage'; -import type { Route } from './types'; - export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/sudo.ts b/packages/apps-routing/src/sudo.ts index fe135b4897..10f795269f 100644 --- a/packages/apps-routing/src/sudo.ts +++ b/packages/apps-routing/src/sudo.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Route } from './types'; import Component from '@polkadot/app-sudo'; -import type { Route } from './types'; - export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/techcomm.ts b/packages/apps-routing/src/techcomm.ts index 883e81a6f5..03ff3fee2f 100644 --- a/packages/apps-routing/src/techcomm.ts +++ b/packages/apps-routing/src/techcomm.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Route } from './types'; import Component, { useCounter } from '@polkadot/app-tech-comm'; -import type { Route } from './types'; - export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/transfer.ts b/packages/apps-routing/src/transfer.ts index fc9a0888f6..947c93386f 100644 --- a/packages/apps-routing/src/transfer.ts +++ b/packages/apps-routing/src/transfer.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Route } from './types'; import Modal from '@polkadot/app-accounts/modals/Transfer'; -import type { Route } from './types'; - export default function create (t: TFunction): Route { return { Component: Modal, diff --git a/packages/apps-routing/src/treasury.ts b/packages/apps-routing/src/treasury.ts index ada5bb242c..454031dadf 100644 --- a/packages/apps-routing/src/treasury.ts +++ b/packages/apps-routing/src/treasury.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; +import type { Route } from './types'; import Component, { useCounter } from '@polkadot/app-treasury'; -import type { Route } from './types'; - export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/types.ts b/packages/apps-routing/src/types.ts index 02326a5ad9..cb56434a54 100644 --- a/packages/apps-routing/src/types.ts +++ b/packages/apps-routing/src/types.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import type { IconName } from '@fortawesome/fontawesome-svg-core'; - import type { AppProps, BareProps } from '@polkadot/react-components/types'; export type RouteGroup = 'accounts' | 'developer' | 'governance' | 'network' | 'settings'; diff --git a/packages/apps/src/Apps.tsx b/packages/apps/src/Apps.tsx index e689bb4b4b..ac7025397f 100644 --- a/packages/apps/src/Apps.tsx +++ b/packages/apps/src/Apps.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { BareProps as Props, ThemeDef, ThemeProps } from '@polkadot/react-components/types'; + import React, { useContext, useMemo } from 'react'; import styled, { ThemeContext } from 'styled-components'; -import type { BareProps as Props, ThemeDef, ThemeProps } from '@polkadot/react-components/types'; import AccountSidebar from '@polkadot/app-accounts/Sidebar'; import { getSystemChainColor } from '@polkadot/apps-config'; import GlobalStyle from '@polkadot/react-components/styles'; diff --git a/packages/apps/src/Content/NotFound.tsx b/packages/apps/src/Content/NotFound.tsx index 2dd2010bcf..d71c19fa77 100644 --- a/packages/apps/src/Content/NotFound.tsx +++ b/packages/apps/src/Content/NotFound.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { RouteProps } from '@polkadot/apps-routing/types'; + import React from 'react'; import { Redirect } from 'react-router'; -import type { RouteProps } from '@polkadot/apps-routing/types'; - interface Props extends RouteProps { missingApis?: (string | string[])[]; } diff --git a/packages/apps/src/Content/Status.tsx b/packages/apps/src/Content/Status.tsx index 72485b2d0b..6a8ddb6850 100644 --- a/packages/apps/src/Content/Status.tsx +++ b/packages/apps/src/Content/Status.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useContext, useEffect } from 'react'; - import type { ActionStatus } from '@polkadot/react-components/Status/types'; import type { EventRecord } from '@polkadot/types/interfaces'; import type { KeyringOptions } from '@polkadot/ui-keyring/options/types'; + +import React, { useContext, useEffect } from 'react'; + import { Status as StatusDisplay, StatusContext } from '@polkadot/react-components'; import { useAccounts, useApi, useCall } from '@polkadot/react-hooks'; import { stringToU8a } from '@polkadot/util'; diff --git a/packages/apps/src/Content/index.tsx b/packages/apps/src/Content/index.tsx index 0e6568db60..f05d6772f8 100644 --- a/packages/apps/src/Content/index.tsx +++ b/packages/apps/src/Content/index.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Route } from '@polkadot/apps-routing/types'; + import React, { Suspense, useContext, useMemo } from 'react'; import { useLocation } from 'react-router-dom'; import styled from 'styled-components'; -import type { Route } from '@polkadot/apps-routing/types'; import createRoutes from '@polkadot/apps-routing'; import { ErrorBoundary, Spinner, StatusContext } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; diff --git a/packages/apps/src/Endpoints/Group.tsx b/packages/apps/src/Endpoints/Group.tsx index 283c6073c0..808be7f335 100644 --- a/packages/apps/src/Endpoints/Group.tsx +++ b/packages/apps/src/Endpoints/Group.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeProps } from '@polkadot/react-components/types'; +import type { Group } from './types'; + import React, { useCallback } from 'react'; import styled from 'styled-components'; -import type { ThemeProps } from '@polkadot/react-components/types'; import { Icon } from '@polkadot/react-components'; -import type { Group } from './types'; import Network from './Network'; interface Props { diff --git a/packages/apps/src/Endpoints/Network.tsx b/packages/apps/src/Endpoints/Network.tsx index 6fe8712f8c..26825e9460 100644 --- a/packages/apps/src/Endpoints/Network.tsx +++ b/packages/apps/src/Endpoints/Network.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeProps } from '@polkadot/react-components/types'; +import type { Network } from './types'; + import React, { useCallback, useMemo } from 'react'; import styled from 'styled-components'; -import type { ThemeProps } from '@polkadot/react-components/types'; import { ChainImg } from '@polkadot/react-components'; -import type { Network } from './types'; import Url from './Url'; interface Props { diff --git a/packages/apps/src/Endpoints/index.tsx b/packages/apps/src/Endpoints/index.tsx index a606e5bb5a..7783de0cb0 100644 --- a/packages/apps/src/Endpoints/index.tsx +++ b/packages/apps/src/Endpoints/index.tsx @@ -1,6 +1,10 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { LinkOption } from '@polkadot/apps-config/settings/types'; +import type { ThemeProps } from '@polkadot/react-components/types'; +import type { Group } from './types'; + // ok, this seems to be an eslint bug, this _is_ a package import /* eslint-disable-next-line node/no-deprecated-api */ import punycode from 'punycode'; @@ -8,14 +12,11 @@ import React, { useCallback, useMemo, useState } from 'react'; import store from 'store'; import styled from 'styled-components'; -import type { LinkOption } from '@polkadot/apps-config/settings/types'; -import type { ThemeProps } from '@polkadot/react-components/types'; import { createWsEndpoints, CUSTOM_ENDPOINT_KEY } from '@polkadot/apps-config'; import { Button, Input, Sidebar } from '@polkadot/react-components'; import uiSettings from '@polkadot/ui-settings'; import { isAscii } from '@polkadot/util'; -import type { Group } from './types'; import { useTranslation } from '../translate'; import GroupDisplay from './Group'; diff --git a/packages/apps/src/Menu/ChainInfo.tsx b/packages/apps/src/Menu/ChainInfo.tsx index 726404561d..e4d688737b 100644 --- a/packages/apps/src/Menu/ChainInfo.tsx +++ b/packages/apps/src/Menu/ChainInfo.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { RuntimeVersion } from '@polkadot/types/interfaces'; + import React from 'react'; import styled from 'styled-components'; -import type { RuntimeVersion } from '@polkadot/types/interfaces'; import { ChainImg, Icon } from '@polkadot/react-components'; import { useApi, useCall, useIpfs, useToggle } from '@polkadot/react-hooks'; import { BestNumber, Chain } from '@polkadot/react-query'; diff --git a/packages/apps/src/Menu/Grouping.tsx b/packages/apps/src/Menu/Grouping.tsx index 7d885890c7..720fc9353d 100644 --- a/packages/apps/src/Menu/Grouping.tsx +++ b/packages/apps/src/Menu/Grouping.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeProps } from '@polkadot/react-components/types'; +import type { Group } from './types'; + import React from 'react'; import styled from 'styled-components'; -import type { ThemeProps } from '@polkadot/react-components/types'; import { Icon } from '@polkadot/react-components'; -import type { Group } from './types'; import Item from './Item'; interface Props extends Group { diff --git a/packages/apps/src/Menu/Item.tsx b/packages/apps/src/Menu/Item.tsx index f83470231d..22792b6217 100644 --- a/packages/apps/src/Menu/Item.tsx +++ b/packages/apps/src/Menu/Item.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ItemRoute } from './types'; + import React from 'react'; import styled from 'styled-components'; import { Badge, Icon } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; -import type { ItemRoute } from './types'; - interface Props { className?: string; isToplevel?: boolean; diff --git a/packages/apps/src/Menu/NodeInfo.tsx b/packages/apps/src/Menu/NodeInfo.tsx index bfc8ca4277..ae572d0c5f 100644 --- a/packages/apps/src/Menu/NodeInfo.tsx +++ b/packages/apps/src/Menu/NodeInfo.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { BareProps as Props } from '@polkadot/react-components/types'; + import React from 'react'; import styled from 'styled-components'; -import type { BareProps as Props } from '@polkadot/react-components/types'; import { useApi } from '@polkadot/react-hooks'; import { NodeName, NodeVersion } from '@polkadot/react-query'; diff --git a/packages/apps/src/Menu/index.tsx b/packages/apps/src/Menu/index.tsx index e68124d8be..514447628f 100644 --- a/packages/apps/src/Menu/index.tsx +++ b/packages/apps/src/Menu/index.tsx @@ -1,20 +1,21 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { TFunction } from 'i18next'; -import React, { useMemo, useRef } from 'react'; -import { useLocation } from 'react-router-dom'; -import styled from 'styled-components'; - import type { Route, Routes } from '@polkadot/apps-routing/types'; import type { ApiProps } from '@polkadot/react-api/types'; import type { ThemeProps } from '@polkadot/react-components/types'; import type { AccountId } from '@polkadot/types/interfaces'; +import type { TFunction } from 'i18next'; +import type { Group, Groups, ItemRoute } from './types'; + +import React, { useMemo, useRef } from 'react'; +import { useLocation } from 'react-router-dom'; +import styled from 'styled-components'; + import createRoutes from '@polkadot/apps-routing'; import { Icon } from '@polkadot/react-components'; import { useAccounts, useApi, useCall } from '@polkadot/react-hooks'; -import type { Group, Groups, ItemRoute } from './types'; import { findMissingApis } from '../endpoint'; import { useTranslation } from '../translate'; import ChainInfo from './ChainInfo'; diff --git a/packages/apps/src/Menu/types.tsx b/packages/apps/src/Menu/types.tsx index 022e104b3a..7bed75e1db 100644 --- a/packages/apps/src/Menu/types.tsx +++ b/packages/apps/src/Menu/types.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { IconName } from '@fortawesome/fontawesome-svg-core'; -import React from 'react'; - import type { Routes } from '@polkadot/apps-routing/types'; +import React from 'react'; + export interface ItemRoute { Modal?: React.ComponentType; href?: string; diff --git a/packages/apps/src/Root.tsx b/packages/apps/src/Root.tsx index 67e1945d7f..bbe9fb5075 100644 --- a/packages/apps/src/Root.tsx +++ b/packages/apps/src/Root.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeDef } from '@polkadot/react-components/types'; +import type { KeyringStore } from '@polkadot/ui-keyring/types'; + import React, { Suspense, useEffect, useState } from 'react'; import { HashRouter } from 'react-router-dom'; import { ThemeProvider } from 'styled-components'; -import type { ThemeDef } from '@polkadot/react-components/types'; -import type { KeyringStore } from '@polkadot/ui-keyring/types'; import { Api } from '@polkadot/react-api'; import Queue from '@polkadot/react-components/Status/Queue'; import { BlockAuthors, Events } from '@polkadot/react-query'; diff --git a/packages/apps/src/index.tsx b/packages/apps/src/index.tsx index 13ca569d48..42fb6fb393 100644 --- a/packages/apps/src/index.tsx +++ b/packages/apps/src/index.tsx @@ -5,6 +5,7 @@ import './initSettings'; import 'semantic-ui-css/semantic.min.css'; import '@polkadot/react-components/i18n'; + import React from 'react'; import ReactDOM from 'react-dom'; diff --git a/packages/apps/src/overlays/Base.tsx b/packages/apps/src/overlays/Base.tsx index 71e153cfef..ef146a3d02 100644 --- a/packages/apps/src/overlays/Base.tsx +++ b/packages/apps/src/overlays/Base.tsx @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { IconName } from '@fortawesome/fontawesome-svg-core'; +import type { ThemeProps } from '@polkadot/react-components/types'; + import React from 'react'; import styled from 'styled-components'; -import type { ThemeProps } from '@polkadot/react-components/types'; import { Button, Icon } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; diff --git a/packages/apps/src/translate.ts b/packages/apps/src/translate.ts index 097cba46e5..2f4f875650 100644 --- a/packages/apps/src/translate.ts +++ b/packages/apps/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/page-accounts/src/Accounts/Account.tsx b/packages/page-accounts/src/Accounts/Account.tsx index cf560a2f68..c294770fb4 100644 --- a/packages/page-accounts/src/Accounts/Account.tsx +++ b/packages/page-accounts/src/Accounts/Account.tsx @@ -1,17 +1,19 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import BN from 'bn.js'; -import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react'; -import styled, { ThemeContext } from 'styled-components'; - -import type { DeriveBalancesAll, DeriveDemocracyLock } from '@polkadot/api-derive/types'; import type { SubmittableExtrinsic } from '@polkadot/api/types'; +import type { DeriveBalancesAll, DeriveDemocracyLock } from '@polkadot/api-derive/types'; import type { ActionStatus } from '@polkadot/react-components/Status/types'; import type { ThemeDef } from '@polkadot/react-components/types'; import type { Option } from '@polkadot/types'; import type { ProxyDefinition, RecoveryConfig } from '@polkadot/types/interfaces'; import type { KeyringAddress } from '@polkadot/ui-keyring/types'; +import type { Delegation } from '../types'; + +import BN from 'bn.js'; +import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react'; +import styled, { ThemeContext } from 'styled-components'; + import { ApiPromise } from '@polkadot/api'; import { getLedger } from '@polkadot/react-api'; import { AddressInfo, AddressMini, AddressSmall, Badge, Button, ChainLock, CryptoType, Forget, Icon, IdentityIcon, LinkExternal, Menu, Popup, StatusContext, Tags } from '@polkadot/react-components'; @@ -19,7 +21,6 @@ import { useAccountInfo, useApi, useCall, useToggle } from '@polkadot/react-hook import keyring from '@polkadot/ui-keyring'; import { BN_ZERO, formatBalance, formatNumber } from '@polkadot/util'; -import type { Delegation } from '../types'; import Backup from '../modals/Backup'; import ChangePass from '../modals/ChangePass'; import DelegateModal from '../modals/Delegate'; diff --git a/packages/page-accounts/src/Accounts/index.tsx b/packages/page-accounts/src/Accounts/index.tsx index ffeb3a1e2f..b6a4fb699a 100644 --- a/packages/page-accounts/src/Accounts/index.tsx +++ b/packages/page-accounts/src/Accounts/index.tsx @@ -1,19 +1,20 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ActionStatus } from '@polkadot/react-components/Status/types'; +import type { AccountId, ProxyDefinition, ProxyType, Voting } from '@polkadot/types/interfaces'; +import type { Delegation, SortedAccount } from '../types'; + import BN from 'bn.js'; import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import styled from 'styled-components'; -import type { ActionStatus } from '@polkadot/react-components/Status/types'; -import type { AccountId, ProxyDefinition, ProxyType, Voting } from '@polkadot/types/interfaces'; import { isLedger } from '@polkadot/react-api'; import { Button, Input, Table } from '@polkadot/react-components'; import { useAccounts, useApi, useCall, useFavorites, useIpfs, useLoadingDelay, useToggle } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; import { BN_ZERO } from '@polkadot/util'; -import type { Delegation, SortedAccount } from '../types'; import CreateModal from '../modals/Create'; import ImportModal from '../modals/Import'; import Ledger from '../modals/Ledger'; diff --git a/packages/page-accounts/src/Accounts/types.ts b/packages/page-accounts/src/Accounts/types.ts index 16f116ab1f..93b8071033 100644 --- a/packages/page-accounts/src/Accounts/types.ts +++ b/packages/page-accounts/src/Accounts/types.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { WithTranslation } from 'react-i18next'; - import type { ActionStatus } from '@polkadot/react-components/Status/types'; import type { KeyringAddress } from '@polkadot/ui-keyring/types'; +import { WithTranslation } from 'react-i18next'; + export { AppProps as ComponentProps } from '@polkadot/react-components/types'; export interface BareProps { diff --git a/packages/page-accounts/src/Accounts/useMultisigApprovals.ts b/packages/page-accounts/src/Accounts/useMultisigApprovals.ts index 5b21962fcf..a7e201627a 100644 --- a/packages/page-accounts/src/Accounts/useMultisigApprovals.ts +++ b/packages/page-accounts/src/Accounts/useMultisigApprovals.ts @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { useContext, useEffect, useState } from 'react'; - import type { Option, StorageKey } from '@polkadot/types'; import type { H256, Multisig } from '@polkadot/types/interfaces'; + +import { useContext, useEffect, useState } from 'react'; + import { useApi, useIncrement, useIsMountedRef } from '@polkadot/react-hooks'; import { EventsContext } from '@polkadot/react-query'; diff --git a/packages/page-accounts/src/Accounts/useProxies.ts b/packages/page-accounts/src/Accounts/useProxies.ts index a500101e6b..d5847806d2 100644 --- a/packages/page-accounts/src/Accounts/useProxies.ts +++ b/packages/page-accounts/src/Accounts/useProxies.ts @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import BN from 'bn.js'; -import { useEffect, useState } from 'react'; - import type { Vec } from '@polkadot/types'; import type { AccountId, BalanceOf, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces'; import type { ITuple } from '@polkadot/types/types'; + +import BN from 'bn.js'; +import { useEffect, useState } from 'react'; + import { useAccounts, useApi, useIsMountedRef } from '@polkadot/react-hooks'; import { BN_ZERO } from '@polkadot/util'; diff --git a/packages/page-accounts/src/CreateAccount.slow.spec.tsx b/packages/page-accounts/src/CreateAccount.slow.spec.tsx index 8b8ca832f6..ed631ed795 100644 --- a/packages/page-accounts/src/CreateAccount.slow.spec.tsx +++ b/packages/page-accounts/src/CreateAccount.slow.spec.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import '@polkadot/react-components/i18n'; + import { fireEvent, render, waitForElementToBeRemoved } from '@testing-library/react'; import React, { PropsWithChildren } from 'react'; import { MemoryRouter } from 'react-router-dom'; diff --git a/packages/page-accounts/src/Sidebar/Flags.tsx b/packages/page-accounts/src/Sidebar/Flags.tsx index c44c63f739..43d842c530 100644 --- a/packages/page-accounts/src/Sidebar/Flags.tsx +++ b/packages/page-accounts/src/Sidebar/Flags.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AddressFlags } from '@polkadot/react-hooks/types'; + import React from 'react'; -import type { AddressFlags } from '@polkadot/react-hooks/types'; import { Tag } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-accounts/src/Sidebar/Identity.tsx b/packages/page-accounts/src/Sidebar/Identity.tsx index 80e8152640..5045ec9cd2 100644 --- a/packages/page-accounts/src/Sidebar/Identity.tsx +++ b/packages/page-accounts/src/Sidebar/Identity.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { AddressIdentity } from '@polkadot/react-hooks/types'; import type { AccountId, BalanceOf } from '@polkadot/types/interfaces'; + +import React from 'react'; + import { AddressMini, AvatarItem, Expander, Icon, IconLink, Tag } from '@polkadot/react-components'; import { useApi, useCall, useRegistrars, useToggle } from '@polkadot/react-hooks'; import { isHex } from '@polkadot/util'; diff --git a/packages/page-accounts/src/Sidebar/Multisig.tsx b/packages/page-accounts/src/Sidebar/Multisig.tsx index ef50d1ef70..1401226842 100644 --- a/packages/page-accounts/src/Sidebar/Multisig.tsx +++ b/packages/page-accounts/src/Sidebar/Multisig.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { KeyringJson$Meta } from '@polkadot/ui-keyring/types'; + import React from 'react'; -import type { KeyringJson$Meta } from '@polkadot/ui-keyring/types'; import { AddressMini, Icon, Static } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-accounts/src/Sidebar/Sidebar.tsx b/packages/page-accounts/src/Sidebar/Sidebar.tsx index abebeca8ef..ed315a32a8 100644 --- a/packages/page-accounts/src/Sidebar/Sidebar.tsx +++ b/packages/page-accounts/src/Sidebar/Sidebar.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeProps } from '@polkadot/react-components/types'; + import React, { useCallback } from 'react'; import styled from 'styled-components'; -import type { ThemeProps } from '@polkadot/react-components/types'; import { AccountName, Button, Icon, IdentityIcon, Input, LinkExternal, Sidebar, Tags } from '@polkadot/react-components'; import { colorLink } from '@polkadot/react-components/styles/theme'; import { useAccountInfo, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-accounts/src/Sidebar/index.tsx b/packages/page-accounts/src/Sidebar/index.tsx index d9ff073308..7e89a0c574 100644 --- a/packages/page-accounts/src/Sidebar/index.tsx +++ b/packages/page-accounts/src/Sidebar/index.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useState } from 'react'; - import type { StringOrNull, VoidFn } from '@polkadot/react-components/types'; +import React, { useCallback, useState } from 'react'; + import Sidebar from './Sidebar'; type ToggleContext = undefined | (([address, onUpdateName]: [StringOrNull, VoidFn | null]) => void); diff --git a/packages/page-accounts/src/Vanity/Match.tsx b/packages/page-accounts/src/Vanity/Match.tsx index 55e4f0552e..1c3b44587b 100644 --- a/packages/page-accounts/src/Vanity/Match.tsx +++ b/packages/page-accounts/src/Vanity/Match.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeProps } from '@polkadot/react-components/types'; + import React, { useCallback, useMemo } from 'react'; import styled from 'styled-components'; -import type { ThemeProps } from '@polkadot/react-components/types'; import { Button, IdentityIcon } from '@polkadot/react-components'; import { u8aToHex } from '@polkadot/util'; diff --git a/packages/page-accounts/src/Vanity/index.tsx b/packages/page-accounts/src/Vanity/index.tsx index b522059854..192fcd7d34 100644 --- a/packages/page-accounts/src/Vanity/index.tsx +++ b/packages/page-accounts/src/Vanity/index.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; -import styled from 'styled-components'; - import type { ActionStatus } from '@polkadot/react-components/Status/types'; import type { KeypairType } from '@polkadot/util-crypto/types'; import type { GeneratorMatch, GeneratorMatches, GeneratorResult } from '@polkadot/vanitygen/types'; + +import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import styled from 'styled-components'; + import { Button, Dropdown, Input, Table } from '@polkadot/react-components'; import { useApi, useIsMountedRef } from '@polkadot/react-hooks'; import uiSettings from '@polkadot/ui-settings'; diff --git a/packages/page-accounts/src/index.tsx b/packages/page-accounts/src/index.tsx index 4d1476ffbf..c2b190a976 100644 --- a/packages/page-accounts/src/index.tsx +++ b/packages/page-accounts/src/index.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AppProps as Props } from '@polkadot/react-components/types'; + import React, { useRef } from 'react'; import { Route, Switch } from 'react-router'; -import type { AppProps as Props } from '@polkadot/react-components/types'; import { HelpOverlay, Tabs } from '@polkadot/react-components'; import { useAccounts, useIpfs } from '@polkadot/react-hooks'; diff --git a/packages/page-accounts/src/modals/Create.tsx b/packages/page-accounts/src/modals/Create.tsx index 76ca4860d2..de0cbc69c8 100644 --- a/packages/page-accounts/src/modals/Create.tsx +++ b/packages/page-accounts/src/modals/Create.tsx @@ -1,13 +1,15 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ActionStatus } from '@polkadot/react-components/Status/types'; +import type { CreateResult } from '@polkadot/ui-keyring/types'; +import type { KeypairType } from '@polkadot/util-crypto/types'; +import type { ModalProps } from '../types'; + import FileSaver from 'file-saver'; import React, { useCallback, useMemo, useState } from 'react'; import styled from 'styled-components'; -import type { ActionStatus } from '@polkadot/react-components/Status/types'; -import type { CreateResult } from '@polkadot/ui-keyring/types'; -import type { KeypairType } from '@polkadot/util-crypto/types'; import { DEV_PHRASE } from '@polkadot/keyring/defaults'; import { getEnvironment } from '@polkadot/react-api/util'; import { AddressRow, Button, Checkbox, CopyButton, Dropdown, Expander, Input, InputAddress, Modal, TextArea } from '@polkadot/react-components'; @@ -17,7 +19,6 @@ import uiSettings from '@polkadot/ui-settings'; import { isHex, u8aToHex } from '@polkadot/util'; import { keyExtractSuri, mnemonicGenerate, mnemonicValidate, randomAsU8a } from '@polkadot/util-crypto'; -import type { ModalProps } from '../types'; import { useTranslation } from '../translate'; import CreateConfirmation from './CreateConfirmation'; import ExternalWarning from './ExternalWarning'; diff --git a/packages/page-accounts/src/modals/CreateConfirmation.tsx b/packages/page-accounts/src/modals/CreateConfirmation.tsx index 4cfebd1f07..cdea253dcb 100644 --- a/packages/page-accounts/src/modals/CreateConfirmation.tsx +++ b/packages/page-accounts/src/modals/CreateConfirmation.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { KeypairType } from '@polkadot/util-crypto/types'; + import React from 'react'; -import type { KeypairType } from '@polkadot/util-crypto/types'; import { AddressRow, Modal, Static } from '@polkadot/react-components'; import { isHex } from '@polkadot/util'; diff --git a/packages/page-accounts/src/modals/Delegate.tsx b/packages/page-accounts/src/modals/Delegate.tsx index c9eb78d1fb..40b2836ba6 100644 --- a/packages/page-accounts/src/modals/Delegate.tsx +++ b/packages/page-accounts/src/modals/Delegate.tsx @@ -1,15 +1,16 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Conviction } from '@polkadot/types/interfaces'; +import type { AmountValidateState } from '../Accounts/types'; + import BN from 'bn.js'; import React, { useState } from 'react'; -import type { Conviction } from '@polkadot/types/interfaces'; import { ConvictionDropdown, InputAddress, InputBalance, Modal, TxButton } from '@polkadot/react-components'; import { BalanceFree } from '@polkadot/react-query'; import { BN_ZERO } from '@polkadot/util'; -import type { AmountValidateState } from '../Accounts/types'; import { useTranslation } from '../translate'; import ValidateAmount from './InputValidateAmount'; diff --git a/packages/page-accounts/src/modals/Derive.tsx b/packages/page-accounts/src/modals/Derive.tsx index 4d90b95239..6056cf99f2 100644 --- a/packages/page-accounts/src/modals/Derive.tsx +++ b/packages/page-accounts/src/modals/Derive.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useContext, useEffect, useState } from 'react'; - import type { KeyringPair } from '@polkadot/keyring/types'; import type { ActionStatus } from '@polkadot/react-components/Status/types'; import type { KeypairType } from '@polkadot/util-crypto/types'; + +import React, { useCallback, useContext, useEffect, useState } from 'react'; + import { AddressRow, Button, Input, InputAddress, Modal, Password, StatusContext } from '@polkadot/react-components'; import { useApi, useDebounce, useToggle } from '@polkadot/react-hooks'; import keyring from '@polkadot/ui-keyring'; diff --git a/packages/page-accounts/src/modals/IdentityMain.tsx b/packages/page-accounts/src/modals/IdentityMain.tsx index 46b315d29d..8344c75e8d 100644 --- a/packages/page-accounts/src/modals/IdentityMain.tsx +++ b/packages/page-accounts/src/modals/IdentityMain.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Data, Option } from '@polkadot/types'; +import type { Registration } from '@polkadot/types/interfaces'; + import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; -import type { Data, Option } from '@polkadot/types'; -import type { Registration } from '@polkadot/types/interfaces'; import { Input, InputBalance, Modal, Toggle, TxButton } from '@polkadot/react-components'; import { getAddressMeta } from '@polkadot/react-components/util'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-accounts/src/modals/IdentitySub.tsx b/packages/page-accounts/src/modals/IdentitySub.tsx index 98e5d4b9d5..1e1933ce26 100644 --- a/packages/page-accounts/src/modals/IdentitySub.tsx +++ b/packages/page-accounts/src/modals/IdentitySub.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useEffect, useState } from 'react'; - import type { Data, Option, Vec } from '@polkadot/types'; import type { AccountId, Balance } from '@polkadot/types/interfaces'; import type { ITuple } from '@polkadot/types/types'; + +import React, { useCallback, useEffect, useState } from 'react'; + import { Button, Columar, Input, InputAddress, Modal, Spinner, TxButton } from '@polkadot/react-components'; import { useAccounts, useApi, useCall } from '@polkadot/react-hooks'; import { u8aToString } from '@polkadot/util'; diff --git a/packages/page-accounts/src/modals/Import.tsx b/packages/page-accounts/src/modals/Import.tsx index b2fcd6743e..bff2a800df 100644 --- a/packages/page-accounts/src/modals/Import.tsx +++ b/packages/page-accounts/src/modals/Import.tsx @@ -1,16 +1,17 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useMemo, useState } from 'react'; - import type { KeyringPair, KeyringPair$Json } from '@polkadot/keyring/types'; import type { ActionStatus } from '@polkadot/react-components/Status/types'; +import type { ModalProps } from '../types'; + +import React, { useCallback, useMemo, useState } from 'react'; + import { AddressRow, Button, InputAddress, InputFile, Modal, Password } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import keyring from '@polkadot/ui-keyring'; import { u8aToString } from '@polkadot/util'; -import type { ModalProps } from '../types'; import { useTranslation } from '../translate'; import ExternalWarning from './ExternalWarning'; diff --git a/packages/page-accounts/src/modals/InputValidateAmount.tsx b/packages/page-accounts/src/modals/InputValidateAmount.tsx index 613d2c5f8c..d61e1fbefb 100644 --- a/packages/page-accounts/src/modals/InputValidateAmount.tsx +++ b/packages/page-accounts/src/modals/InputValidateAmount.tsx @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; +import type { AmountValidateState } from '../Accounts/types'; + import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; -import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BN_ZERO } from '@polkadot/util'; -import type { AmountValidateState } from '../Accounts/types'; import { useTranslation } from '../translate'; interface Props { diff --git a/packages/page-accounts/src/modals/MultisigApprove.tsx b/packages/page-accounts/src/modals/MultisigApprove.tsx index 5b1d168b94..07e2a2f57c 100644 --- a/packages/page-accounts/src/modals/MultisigApprove.tsx +++ b/packages/page-accounts/src/modals/MultisigApprove.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsic } from '@polkadot/api/types'; +import type { AccountId, Call, H256, Multisig } from '@polkadot/types/interfaces'; + import React, { useCallback, useEffect, useMemo, useState } from 'react'; import styled from 'styled-components'; -import type { SubmittableExtrinsic } from '@polkadot/api/types'; -import type { AccountId, Call, H256, Multisig } from '@polkadot/types/interfaces'; import { registry } from '@polkadot/react-api'; import { Dropdown, Input, InputAddress, Modal, Toggle, TxButton } from '@polkadot/react-components'; import { useAccounts, useApi, useWeight } from '@polkadot/react-hooks'; diff --git a/packages/page-accounts/src/modals/MultisigCreate.tsx b/packages/page-accounts/src/modals/MultisigCreate.tsx index 3619786f85..c83690ea1c 100644 --- a/packages/page-accounts/src/modals/MultisigCreate.tsx +++ b/packages/page-accounts/src/modals/MultisigCreate.tsx @@ -1,15 +1,16 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ActionStatus } from '@polkadot/react-components/Status/types'; +import type { ModalProps } from '../types'; + import BN from 'bn.js'; import React, { useCallback, useState } from 'react'; -import type { ActionStatus } from '@polkadot/react-components/Status/types'; import { Button, Input, InputAddressMulti, InputNumber, Modal } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import keyring from '@polkadot/ui-keyring'; -import type { ModalProps } from '../types'; import useKnownAddresses from '../Accounts/useKnownAddresses'; import { useTranslation } from '../translate'; diff --git a/packages/page-accounts/src/modals/ProxiedAdd.tsx b/packages/page-accounts/src/modals/ProxiedAdd.tsx index 4113e53df3..daf61256a8 100644 --- a/packages/page-accounts/src/modals/ProxiedAdd.tsx +++ b/packages/page-accounts/src/modals/ProxiedAdd.tsx @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ActionStatus } from '@polkadot/react-components/Status/types'; +import type { ModalProps } from '../types'; + import React, { useCallback, useState } from 'react'; -import type { ActionStatus } from '@polkadot/react-components/Status/types'; import { Button, Input, InputAddressSimple, Modal } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import keyring from '@polkadot/ui-keyring'; -import type { ModalProps } from '../types'; import useProxies from '../Accounts/useProxies'; import { useTranslation } from '../translate'; diff --git a/packages/page-accounts/src/modals/ProxyOverview.tsx b/packages/page-accounts/src/modals/ProxyOverview.tsx index 2571b9d2ae..011776a62f 100644 --- a/packages/page-accounts/src/modals/ProxyOverview.tsx +++ b/packages/page-accounts/src/modals/ProxyOverview.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ApiPromise } from '@polkadot/api'; +import type { SubmittableExtrinsic } from '@polkadot/api/types'; +import type { AccountId, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces'; + import BN from 'bn.js'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; import styled from 'styled-components'; -import type { ApiPromise } from '@polkadot/api'; -import type { SubmittableExtrinsic } from '@polkadot/api/types'; -import type { AccountId, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces'; import { registry } from '@polkadot/react-api'; import { Button, Dropdown, InputAddress, Modal, TxButton } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; diff --git a/packages/page-accounts/src/modals/Qr.tsx b/packages/page-accounts/src/modals/Qr.tsx index d693e168c3..b0afd754cc 100644 --- a/packages/page-accounts/src/modals/Qr.tsx +++ b/packages/page-accounts/src/modals/Qr.tsx @@ -1,15 +1,16 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ActionStatus } from '@polkadot/react-components/Status/types'; +import type { ModalProps } from '../types'; + import React, { useCallback, useState } from 'react'; import styled from 'styled-components'; -import type { ActionStatus } from '@polkadot/react-components/Status/types'; import { AddressRow, Button, Input, InputAddress, Modal, QrScanAddress } from '@polkadot/react-components'; import { useApi, useIpfs } from '@polkadot/react-hooks'; import keyring from '@polkadot/ui-keyring'; -import type { ModalProps } from '../types'; import { useTranslation } from '../translate'; import PasswordInput from './PasswordInput'; diff --git a/packages/page-accounts/src/modals/Transfer.tsx b/packages/page-accounts/src/modals/Transfer.tsx index 06e5fd22c4..a238e93c75 100644 --- a/packages/page-accounts/src/modals/Transfer.tsx +++ b/packages/page-accounts/src/modals/Transfer.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; +import type { AccountInfo } from '@polkadot/types/interfaces'; + import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; -import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; -import type { AccountInfo } from '@polkadot/types/interfaces'; import { InputAddress, InputBalance, Modal, Toggle, TxButton } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { Available } from '@polkadot/react-query'; diff --git a/packages/page-accounts/src/translate.ts b/packages/page-accounts/src/translate.ts index a46eb855af..11ab505d6b 100644 --- a/packages/page-accounts/src/translate.ts +++ b/packages/page-accounts/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/page-accounts/src/types.ts b/packages/page-accounts/src/types.ts index 399c965e1c..8548f38ab4 100644 --- a/packages/page-accounts/src/types.ts +++ b/packages/page-accounts/src/types.ts @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { WithTranslation } from 'react-i18next'; - import type { ActionStatus } from '@polkadot/react-components/Status/types'; import type { Balance, Conviction } from '@polkadot/types/interfaces'; import type { KeyringAddress } from '@polkadot/ui-keyring/types'; +import { WithTranslation } from 'react-i18next'; + export { AppProps as ComponentProps } from '@polkadot/react-components/types'; export interface BareProps { diff --git a/packages/page-accounts/src/util.tsx b/packages/page-accounts/src/util.tsx index c0befe0fce..e33f9cb597 100644 --- a/packages/page-accounts/src/util.tsx +++ b/packages/page-accounts/src/util.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { KeyringAddress } from '@polkadot/ui-keyring/types'; +import type { SortedAccount } from './types'; + import React from 'react'; -import type { KeyringAddress } from '@polkadot/ui-keyring/types'; import { Menu } from '@polkadot/react-components'; import keyring from '@polkadot/ui-keyring'; -import type { SortedAccount } from './types'; - export function createMenuGroup (items: (React.ReactNode | false | undefined | null)[]): React.ReactNode | null { const filtered = items.filter((item): item is React.ReactNode => !!item); diff --git a/packages/page-addresses/src/Contacts/Address.tsx b/packages/page-addresses/src/Contacts/Address.tsx index 311934d08f..c07aada0b9 100644 --- a/packages/page-addresses/src/Contacts/Address.tsx +++ b/packages/page-addresses/src/Contacts/Address.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/app-addresses authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useContext, useEffect, useState } from 'react'; -import styled, { ThemeContext } from 'styled-components'; - import type { DeriveAccountInfo, DeriveBalancesAll } from '@polkadot/api-derive/types'; import type { ActionStatus } from '@polkadot/react-components/Status/types'; import type { ThemeDef } from '@polkadot/react-components/types'; import type { KeyringAddress } from '@polkadot/ui-keyring/types'; + +import React, { useCallback, useContext, useEffect, useState } from 'react'; +import styled, { ThemeContext } from 'styled-components'; + import Transfer from '@polkadot/app-accounts/modals/Transfer'; import { AddressInfo, AddressSmall, Button, ChainLock, Forget, Icon, LinkExternal, Menu, Popup, Tags } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-addresses/src/Contacts/index.tsx b/packages/page-addresses/src/Contacts/index.tsx index 369ee7838b..49053addf3 100644 --- a/packages/page-addresses/src/Contacts/index.tsx +++ b/packages/page-addresses/src/Contacts/index.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/app-addresses authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ComponentProps as Props } from '../types'; + import React, { useEffect, useMemo, useRef, useState } from 'react'; import styled from 'styled-components'; import { Button, Input, Table } from '@polkadot/react-components'; import { useAddresses, useFavorites, useLoadingDelay, useToggle } from '@polkadot/react-hooks'; -import type { ComponentProps as Props } from '../types'; import CreateModal from '../modals/Create'; import { useTranslation } from '../translate'; import Address from './Address'; diff --git a/packages/page-addresses/src/index.tsx b/packages/page-addresses/src/index.tsx index e88bcb811a..f6dda52679 100644 --- a/packages/page-addresses/src/index.tsx +++ b/packages/page-addresses/src/index.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-addresses authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AppProps as Props } from '@polkadot/react-components/types'; + import React, { useRef } from 'react'; import { Route, Switch } from 'react-router'; -import type { AppProps as Props } from '@polkadot/react-components/types'; import { Tabs } from '@polkadot/react-components'; import Contacts from './Contacts'; diff --git a/packages/page-addresses/src/modals/Create.tsx b/packages/page-addresses/src/modals/Create.tsx index 9eea5dba68..3a9bbf32d6 100644 --- a/packages/page-addresses/src/modals/Create.tsx +++ b/packages/page-addresses/src/modals/Create.tsx @@ -1,17 +1,18 @@ // Copyright 2017-2020 @polkadot/app-addresses authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useState } from 'react'; - import type { DeriveAccountInfo } from '@polkadot/api-derive/types'; import type { ActionStatus } from '@polkadot/react-components/Status/types'; +import type { ModalProps as Props } from '../types'; + +import React, { useCallback, useState } from 'react'; + import { AddressRow, Button, Input, InputAddress, Modal } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import keyring from '@polkadot/ui-keyring'; import { hexToU8a } from '@polkadot/util'; import { ethereumEncode } from '@polkadot/util-crypto'; -import type { ModalProps as Props } from '../types'; import { useTranslation } from '../translate'; interface AddrState { diff --git a/packages/page-addresses/src/translate.ts b/packages/page-addresses/src/translate.ts index 0be7a69ddf..7f5bdd59b2 100644 --- a/packages/page-addresses/src/translate.ts +++ b/packages/page-addresses/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/page-addresses/src/types.ts b/packages/page-addresses/src/types.ts index 0f96c595fb..55daa4d13d 100644 --- a/packages/page-addresses/src/types.ts +++ b/packages/page-addresses/src/types.ts @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-addresses authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { WithTranslation } from 'react-i18next'; - import type { ActionStatus } from '@polkadot/react-components/Status/types'; import type { Balance, Conviction } from '@polkadot/types/interfaces'; import type { KeyringAddress } from '@polkadot/ui-keyring/types'; +import { WithTranslation } from 'react-i18next'; + export { AppProps as ComponentProps } from '@polkadot/react-components/types'; export interface BareProps { diff --git a/packages/page-addresses/src/util.tsx b/packages/page-addresses/src/util.tsx index 6236863f84..784625f914 100644 --- a/packages/page-addresses/src/util.tsx +++ b/packages/page-addresses/src/util.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-addresses authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { KeyringAddress } from '@polkadot/ui-keyring/types'; +import type { SortedAccount } from './types'; + import React from 'react'; -import type { KeyringAddress } from '@polkadot/ui-keyring/types'; import { Menu } from '@polkadot/react-components'; import keyring from '@polkadot/ui-keyring'; -import type { SortedAccount } from './types'; - export function createMenuGroup (items: (React.ReactNode | false | undefined | null)[]): React.ReactNode | null { const filtered = items.filter((item): item is React.ReactNode => !!item); diff --git a/packages/page-bounties/src/Bounties.tsx b/packages/page-bounties/src/Bounties.tsx index 206e8263c9..7a31f9123d 100644 --- a/packages/page-bounties/src/Bounties.tsx +++ b/packages/page-bounties/src/Bounties.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-bounties authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useRef } from 'react'; - import type { Bytes, Option } from '@polkadot/types'; import type { BlockNumber, Bounty as BountyType, BountyIndex } from '@polkadot/types/interfaces'; + +import React, { useRef } from 'react'; + import { BountyDescription } from '@polkadot/app-bounties/types'; import { Table } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-bounties/src/Bounty.tsx b/packages/page-bounties/src/Bounty.tsx index 392ea76648..cc7be4124a 100644 --- a/packages/page-bounties/src/Bounty.tsx +++ b/packages/page-bounties/src/Bounty.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-bounties authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { BlockNumber, Bounty as BountyType } from '@polkadot/types/interfaces'; + import React, { useCallback, useMemo, useState } from 'react'; import styled from 'styled-components'; -import type { BlockNumber, Bounty as BountyType } from '@polkadot/types/interfaces'; import { BountyDescription } from '@polkadot/app-bounties/types'; import { AddressSmall, Icon, LinkExternal } from '@polkadot/react-components'; import { BlockToTime, FormatBalance } from '@polkadot/react-query'; diff --git a/packages/page-bounties/src/translate.ts b/packages/page-bounties/src/translate.ts index 6c692a8d1b..d2eb2f033a 100644 --- a/packages/page-bounties/src/translate.ts +++ b/packages/page-bounties/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/page-calendar/src/Day.tsx b/packages/page-calendar/src/Day.tsx index 5a4fce9368..55dff58051 100644 --- a/packages/page-calendar/src/Day.tsx +++ b/packages/page-calendar/src/Day.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-calendar authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { EntryInfo } from './types'; + import React, { useMemo, useRef } from 'react'; import styled from 'styled-components'; import { Button } from '@polkadot/react-components'; -import type { EntryInfo } from './types'; import { MONTHS } from './constants'; import DayHour from './DayHour'; import DayTime from './DayTime'; diff --git a/packages/page-calendar/src/DayHour.tsx b/packages/page-calendar/src/DayHour.tsx index 69db896800..6869c1f214 100644 --- a/packages/page-calendar/src/DayHour.tsx +++ b/packages/page-calendar/src/DayHour.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-calendar authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { EntryInfoTyped } from './types'; + import React, { useMemo } from 'react'; import styled from 'styled-components'; -import type { EntryInfoTyped } from './types'; import DayItem from './DayItem'; interface Props { diff --git a/packages/page-calendar/src/DayItem.tsx b/packages/page-calendar/src/DayItem.tsx index 0647ea20dc..14f0d8778b 100644 --- a/packages/page-calendar/src/DayItem.tsx +++ b/packages/page-calendar/src/DayItem.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/app-calendar authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { EntryInfoTyped } from './types'; + import React, { useCallback, useMemo, useState } from 'react'; import styled from 'styled-components'; import { Button } from '@polkadot/react-components'; import { formatNumber, isString } from '@polkadot/util'; -import type { EntryInfoTyped } from './types'; import { useTranslation } from './translate'; import { dateCalendarFormat } from './util'; diff --git a/packages/page-calendar/src/Month.tsx b/packages/page-calendar/src/Month.tsx index 08ca487c90..f9d373eb53 100644 --- a/packages/page-calendar/src/Month.tsx +++ b/packages/page-calendar/src/Month.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-calendar authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DateState, EntryInfo } from './types'; + import React, { useMemo, useRef } from 'react'; import styled from 'styled-components'; import { Button } from '@polkadot/react-components'; -import type { DateState, EntryInfo } from './types'; import { DAYS, MONTHS } from './constants'; import MonthDay from './MonthDay'; import { useTranslation } from './translate'; diff --git a/packages/page-calendar/src/MonthDay.tsx b/packages/page-calendar/src/MonthDay.tsx index 7de9817be5..e15488596d 100644 --- a/packages/page-calendar/src/MonthDay.tsx +++ b/packages/page-calendar/src/MonthDay.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-calendar authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { EntryInfo } from './types'; + import React, { useCallback, useMemo } from 'react'; import styled from 'styled-components'; -import type { EntryInfo } from './types'; - interface Props { className?: string; dateMonth: Date; diff --git a/packages/page-calendar/src/index.tsx b/packages/page-calendar/src/index.tsx index 6e8f3b3897..802a0b6cd4 100644 --- a/packages/page-calendar/src/index.tsx +++ b/packages/page-calendar/src/index.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/app-calendar authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeProps } from '@polkadot/react-components/types'; +import type { DateState } from './types'; + import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import styled from 'styled-components'; -import type { ThemeProps } from '@polkadot/react-components/types'; import { Tabs } from '@polkadot/react-components'; -import type { DateState } from './types'; import Day from './Day'; import Month from './Month'; import { useTranslation } from './translate'; diff --git a/packages/page-calendar/src/translate.ts b/packages/page-calendar/src/translate.ts index c252baf00c..434edb8cb5 100644 --- a/packages/page-calendar/src/translate.ts +++ b/packages/page-calendar/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/page-calendar/src/useScheduled.ts b/packages/page-calendar/src/useScheduled.ts index b204d7bfad..09c7f107c1 100644 --- a/packages/page-calendar/src/useScheduled.ts +++ b/packages/page-calendar/src/useScheduled.ts @@ -1,17 +1,17 @@ // Copyright 2017-2020 @polkadot/app-calendar authors & contributors // SPDX-License-Identifier: Apache-2.0 -import BN from 'bn.js'; -import { useEffect, useState } from 'react'; - import type { DeriveCollectiveProposal, DeriveDispatch, DeriveReferendumExt, DeriveSessionProgress } from '@polkadot/api-derive/types'; import type { Option } from '@polkadot/types'; import type { BlockNumber, EraIndex, Scheduled, UnappliedSlash } from '@polkadot/types/interfaces'; +import type { EntryInfo, EntryInfoTyped, EntryType } from './types'; + +import BN from 'bn.js'; +import { useEffect, useState } from 'react'; + import { useApi, useBlockTime, useCall } from '@polkadot/react-hooks'; import { BN_ONE } from '@polkadot/util'; -import type { EntryInfo, EntryInfoTyped, EntryType } from './types'; - interface DateExt { date: Date; dateTime: number; diff --git a/packages/page-calendar/src/util.ts b/packages/page-calendar/src/util.ts index e72fd52e08..1a941d1c96 100644 --- a/packages/page-calendar/src/util.ts +++ b/packages/page-calendar/src/util.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { DateState } from './types'; + import { DAYS } from './constants'; export function newZeroDate (input: Date): Date { diff --git a/packages/page-claims/src/Attest.tsx b/packages/page-claims/src/Attest.tsx index 33b6fb7a11..46e224a8c3 100644 --- a/packages/page-claims/src/Attest.tsx +++ b/packages/page-claims/src/Attest.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-claims authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useEffect, useState } from 'react'; -import styled from 'styled-components'; - import type { TxCallback } from '@polkadot/react-components/Status/types'; import type { Option } from '@polkadot/types'; import type { BalanceOf, EthereumAddress, StatementKind } from '@polkadot/types/interfaces'; + +import React, { useEffect, useState } from 'react'; +import styled from 'styled-components'; + import { Button, Card, TxButton } from '@polkadot/react-components'; import { useAccounts, useApi } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; diff --git a/packages/page-claims/src/Claim.tsx b/packages/page-claims/src/Claim.tsx index 9e5dd144b6..9263c992c3 100644 --- a/packages/page-claims/src/Claim.tsx +++ b/packages/page-claims/src/Claim.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-claims authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useEffect, useState } from 'react'; -import styled from 'styled-components'; - import type { TxCallback } from '@polkadot/react-components/Status/types'; import type { Option } from '@polkadot/types'; import type { BalanceOf, EthereumAddress, StatementKind } from '@polkadot/types/interfaces'; + +import React, { useEffect, useState } from 'react'; +import styled from 'styled-components'; + import { Button, Card, TxButton } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; diff --git a/packages/page-claims/src/Statement.tsx b/packages/page-claims/src/Statement.tsx index 8df0b620fc..67a3b5c780 100644 --- a/packages/page-claims/src/Statement.tsx +++ b/packages/page-claims/src/Statement.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-claims authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; -import styled from 'styled-components'; - import type { ThemeProps } from '@polkadot/react-components/types'; import type { StatementKind } from '@polkadot/types/interfaces'; +import React from 'react'; +import styled from 'styled-components'; + import { useTranslation } from './translate'; import { getStatement } from './util'; diff --git a/packages/page-claims/src/index.tsx b/packages/page-claims/src/index.tsx index b17d9e6e22..0662b16165 100644 --- a/packages/page-claims/src/index.tsx +++ b/packages/page-claims/src/index.tsx @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/app-claims authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AppProps as Props, ThemeProps } from '@polkadot/react-components/types'; +import type { Option } from '@polkadot/types'; +import type { EcdsaSignature, EthereumAddress, StatementKind } from '@polkadot/types/interfaces'; + import React, { useCallback, useEffect, useRef, useState } from 'react'; import CopyToClipboard from 'react-copy-to-clipboard'; import { Trans } from 'react-i18next'; import styled from 'styled-components'; -import type { AppProps as Props, ThemeProps } from '@polkadot/react-components/types'; -import type { Option } from '@polkadot/types'; -import type { EcdsaSignature, EthereumAddress, StatementKind } from '@polkadot/types/interfaces'; import { Button, Card, Columar, Column, Input, InputAddress, Tabs, Tooltip } from '@polkadot/react-components'; import { TokenUnit } from '@polkadot/react-components/InputNumber'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-claims/src/translate.ts b/packages/page-claims/src/translate.ts index 5ff3b12b2d..d9b13a8481 100644 --- a/packages/page-claims/src/translate.ts +++ b/packages/page-claims/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase, withTranslation } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/page-claims/src/usePolkadotPreclaims.ts b/packages/page-claims/src/usePolkadotPreclaims.ts index e20c9d575f..2805b3560b 100644 --- a/packages/page-claims/src/usePolkadotPreclaims.ts +++ b/packages/page-claims/src/usePolkadotPreclaims.ts @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-settings authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { useEffect, useState } from 'react'; - import type { QueryableStorageEntry } from '@polkadot/api/types'; import type { Option } from '@polkadot/types'; import type { EthereumAddress } from '@polkadot/types/interfaces'; import type { Codec } from '@polkadot/types/types'; + +import { useEffect, useState } from 'react'; + import { useAccounts, useApi, useCall, useIsMountedRef } from '@polkadot/react-hooks'; export default function usePolkadotPreclaims (): string[] { diff --git a/packages/page-claims/src/util.ts b/packages/page-claims/src/util.ts index 5eace5bf67..1ecc4fcebb 100644 --- a/packages/page-claims/src/util.ts +++ b/packages/page-claims/src/util.ts @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-claims authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { EcdsaSignature, EthereumAddress, StatementKind } from '@polkadot/types/interfaces'; + import secp256k1 from 'secp256k1/elliptic'; -import type { EcdsaSignature, EthereumAddress, StatementKind } from '@polkadot/types/interfaces'; import registry from '@polkadot/react-api/typeRegistry'; import { assert, hexToU8a, stringToU8a, u8aConcat, u8aToBuffer } from '@polkadot/util'; import { keccakAsHex, keccakAsU8a } from '@polkadot/util-crypto'; diff --git a/packages/page-contracts/src/Codes/Add.tsx b/packages/page-contracts/src/Codes/Add.tsx index 2d69fa2e37..3830559a0d 100644 --- a/packages/page-contracts/src/Codes/Add.tsx +++ b/packages/page-contracts/src/Codes/Add.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { StringOrNull } from '@polkadot/react-components/types'; + import React, { useCallback, useState } from 'react'; -import type { StringOrNull } from '@polkadot/react-components/types'; import { Button, Input, Modal } from '@polkadot/react-components'; import { isNull } from '@polkadot/util'; diff --git a/packages/page-contracts/src/Codes/Code.tsx b/packages/page-contracts/src/Codes/Code.tsx index d79a8ab1ea..de31217ec1 100644 --- a/packages/page-contracts/src/Codes/Code.tsx +++ b/packages/page-contracts/src/Codes/Code.tsx @@ -1,15 +1,16 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Option } from '@polkadot/types'; +import type { Codec } from '@polkadot/types/types'; +import type { CodeStored } from '../types'; + import React, { useCallback } from 'react'; import styled from 'styled-components'; -import type { Option } from '@polkadot/types'; -import type { Codec } from '@polkadot/types/types'; import { Button, Card, CopyButton, Forget } from '@polkadot/react-components'; import { useApi, useCall, useToggle } from '@polkadot/react-hooks'; -import type { CodeStored } from '../types'; import { CodeRow, Messages } from '../shared'; import store from '../store'; import { useTranslation } from '../translate'; diff --git a/packages/page-contracts/src/Codes/Upload.tsx b/packages/page-contracts/src/Codes/Upload.tsx index ee9dc41c06..206b45d8b3 100644 --- a/packages/page-contracts/src/Codes/Upload.tsx +++ b/packages/page-contracts/src/Codes/Upload.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsic } from '@polkadot/api/types'; +import type { CodeSubmittableResult } from '@polkadot/api-contract/promise/types'; + import React, { useCallback, useEffect, useMemo, useState } from 'react'; -import type { CodeSubmittableResult } from '@polkadot/api-contract/promise/types'; -import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { CodePromise } from '@polkadot/api-contract'; import { InputAddress, InputFile, Modal, TxButton } from '@polkadot/react-components'; import { useAccountId, useApi, useNonEmptyString } from '@polkadot/react-hooks'; diff --git a/packages/page-contracts/src/Codes/ValidateCode.tsx b/packages/page-contracts/src/Codes/ValidateCode.tsx index 2d755b0240..1e15f23291 100644 --- a/packages/page-contracts/src/Codes/ValidateCode.tsx +++ b/packages/page-contracts/src/Codes/ValidateCode.tsx @@ -3,10 +3,11 @@ /* eslint-disable camelcase */ -import React, { useMemo } from 'react'; - import type { Option } from '@polkadot/types'; import type { PrefabWasmModule } from '@polkadot/types/interfaces'; + +import React, { useMemo } from 'react'; + import { InfoForInput } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { isHex } from '@polkadot/util'; diff --git a/packages/page-contracts/src/Contracts/Add.tsx b/packages/page-contracts/src/Contracts/Add.tsx index 42e06fce65..364ec0a7e1 100644 --- a/packages/page-contracts/src/Contracts/Add.tsx +++ b/packages/page-contracts/src/Contracts/Add.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useState } from 'react'; - import type { ActionStatus } from '@polkadot/react-components/Status/types'; import type { StringOrNull } from '@polkadot/react-components/types'; + +import React, { useCallback, useState } from 'react'; + import { AddressRow, Button, Input, Modal } from '@polkadot/react-components'; import { useApi, useNonEmptyString } from '@polkadot/react-hooks'; import keyring from '@polkadot/ui-keyring'; diff --git a/packages/page-contracts/src/Contracts/Call.tsx b/packages/page-contracts/src/Contracts/Call.tsx index 52c8b138fa..abb67b4cd1 100644 --- a/packages/page-contracts/src/Contracts/Call.tsx +++ b/packages/page-contracts/src/Contracts/Call.tsx @@ -1,19 +1,20 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsic } from '@polkadot/api/types'; +import type { ContractCallOutcome } from '@polkadot/api-contract/types'; +import type { CallResult } from './types'; + import BN from 'bn.js'; import React, { useCallback, useEffect, useState } from 'react'; import styled from 'styled-components'; -import type { ContractCallOutcome } from '@polkadot/api-contract/types'; -import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { ContractPromise } from '@polkadot/api-contract'; import { Button, Dropdown, Expander, InputAddress, InputBalance, Modal, Toggle, TxButton } from '@polkadot/react-components'; import { useAccountId, useDebounce, useFormField, useToggle } from '@polkadot/react-hooks'; import { Available } from '@polkadot/react-query'; import { BN_ZERO } from '@polkadot/util'; -import type { CallResult } from './types'; import { InputMegaGas, Params } from '../shared'; import { useTranslation } from '../translate'; import useWeight from '../useWeight'; diff --git a/packages/page-contracts/src/Contracts/Contract.tsx b/packages/page-contracts/src/Contracts/Contract.tsx index dd7c052868..79586a4453 100644 --- a/packages/page-contracts/src/Contracts/Contract.tsx +++ b/packages/page-contracts/src/Contracts/Contract.tsx @@ -1,12 +1,14 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useEffect, useState } from 'react'; - import type { ContractCallOutcome } from '@polkadot/api-contract/types'; import type { ActionStatus } from '@polkadot/react-components/Status/types'; import type { Option } from '@polkadot/types'; import type { BlockNumber, ContractInfo } from '@polkadot/types/interfaces'; +import type { ContractLink } from './types'; + +import React, { useCallback, useEffect, useState } from 'react'; + import { ContractPromise } from '@polkadot/api-contract'; import { AddressInfo, AddressMini, Button, Forget } from '@polkadot/react-components'; import { useApi, useCall, useToggle } from '@polkadot/react-hooks'; @@ -14,7 +16,6 @@ import { BlockToTime } from '@polkadot/react-query'; import keyring from '@polkadot/ui-keyring'; import { formatNumber, isFunction, isUndefined } from '@polkadot/util'; -import type { ContractLink } from './types'; import Messages from '../shared/Messages'; import { useTranslation } from '../translate'; diff --git a/packages/page-contracts/src/Contracts/Outcome.tsx b/packages/page-contracts/src/Contracts/Outcome.tsx index c70816bf33..166b76ab67 100644 --- a/packages/page-contracts/src/Contracts/Outcome.tsx +++ b/packages/page-contracts/src/Contracts/Outcome.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { CallResult } from './types'; + import React from 'react'; import styled from 'styled-components'; import { Button, IdentityIcon, Output } from '@polkadot/react-components'; import valueToText from '@polkadot/react-params/valueToText'; -import type { CallResult } from './types'; import MessageSignature from '../shared/MessageSignature'; interface Props { diff --git a/packages/page-contracts/src/Contracts/ValidateAddr.tsx b/packages/page-contracts/src/Contracts/ValidateAddr.tsx index 2a6ec2cd9b..697fc9da9d 100644 --- a/packages/page-contracts/src/Contracts/ValidateAddr.tsx +++ b/packages/page-contracts/src/Contracts/ValidateAddr.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useEffect, useState } from 'react'; - import type { Option } from '@polkadot/types'; import type { ContractInfo } from '@polkadot/types/interfaces'; + +import React, { useEffect, useState } from 'react'; + import { InfoForInput } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import keyring from '@polkadot/ui-keyring'; diff --git a/packages/page-contracts/src/Contracts/index.tsx b/packages/page-contracts/src/Contracts/index.tsx index 0703b62860..8312e0342a 100644 --- a/packages/page-contracts/src/Contracts/index.tsx +++ b/packages/page-contracts/src/Contracts/index.tsx @@ -1,17 +1,18 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; - import type { ContractCallOutcome } from '@polkadot/api-contract/types'; import type { FullNewBlock } from '@polkadot/api-derive/types'; +import type { ContractLink } from './types'; + +import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; + import { ApiPromise } from '@polkadot/api'; import { ContractPromise } from '@polkadot/api-contract'; import { Table } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; -import type { ContractLink } from './types'; import { useTranslation } from '../translate'; import Call from './Call'; import Contract from './Contract'; diff --git a/packages/page-contracts/src/Contracts/util.tsx b/packages/page-contracts/src/Contracts/util.tsx index 4a1aaeba13..7c8f66c4ee 100644 --- a/packages/page-contracts/src/Contracts/util.tsx +++ b/packages/page-contracts/src/Contracts/util.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { AbiMessage } from '@polkadot/api-contract/types'; import type { StringOrNull } from '@polkadot/react-components/types'; + +import React from 'react'; + import { ApiPromise } from '@polkadot/api'; import { ContractPromise as Contract } from '@polkadot/api-contract'; import { getContractAbi } from '@polkadot/react-components/util'; diff --git a/packages/page-contracts/src/Deploy.tsx b/packages/page-contracts/src/Deploy.tsx index fd68b949c4..51f486e652 100644 --- a/packages/page-contracts/src/Deploy.tsx +++ b/packages/page-contracts/src/Deploy.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsic } from '@polkadot/api/types'; +import type { BlueprintSubmittableResult } from '@polkadot/api-contract/promise/types'; +import type { StringOrNull } from '@polkadot/react-components/types'; + import BN from 'bn.js'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; -import type { BlueprintSubmittableResult } from '@polkadot/api-contract/promise/types'; -import type { SubmittableExtrinsic } from '@polkadot/api/types'; -import type { StringOrNull } from '@polkadot/react-components/types'; import { BlueprintPromise } from '@polkadot/api-contract'; import { Dropdown, Input, InputAddress, InputBalance, Modal, Toggle, TxButton } from '@polkadot/react-components'; import { useApi, useFormField, useNonEmptyString, useNonZeroBn } from '@polkadot/react-hooks'; diff --git a/packages/page-contracts/src/RemoveABI.tsx b/packages/page-contracts/src/RemoveABI.tsx index c9a0faf535..55e0f7bed8 100644 --- a/packages/page-contracts/src/RemoveABI.tsx +++ b/packages/page-contracts/src/RemoveABI.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { CodeStored } from './types'; + import React, { useCallback } from 'react'; import { Button, Modal } from '@polkadot/react-components'; -import type { CodeStored } from './types'; import CodeRow from './shared/CodeRow'; import { useTranslation } from './translate'; diff --git a/packages/page-contracts/src/index.tsx b/packages/page-contracts/src/index.tsx index 45caf862d5..29d78b087e 100644 --- a/packages/page-contracts/src/index.tsx +++ b/packages/page-contracts/src/index.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AppProps as Props } from '@polkadot/react-components/types'; + import React, { useCallback, useEffect, useRef, useState } from 'react'; import styled from 'styled-components'; -import type { AppProps as Props } from '@polkadot/react-components/types'; import { Button, HelpOverlay, Tabs } from '@polkadot/react-components'; import { useContracts, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-contracts/src/shared/CodeRow.tsx b/packages/page-contracts/src/shared/CodeRow.tsx index 474737d452..8ff615ce8f 100644 --- a/packages/page-contracts/src/shared/CodeRow.tsx +++ b/packages/page-contracts/src/shared/CodeRow.tsx @@ -1,6 +1,8 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { CodeStored } from '../types'; + import React, { useCallback, useEffect, useState } from 'react'; import styled from 'styled-components'; @@ -8,7 +10,6 @@ import { registry } from '@polkadot/react-api'; import { Icon } from '@polkadot/react-components'; import Row from '@polkadot/react-components/Row'; -import type { CodeStored } from '../types'; import contracts from '../store'; interface Props { diff --git a/packages/page-contracts/src/shared/InputMegaGas.tsx b/packages/page-contracts/src/shared/InputMegaGas.tsx index db7ffb0bb7..146300d62b 100644 --- a/packages/page-contracts/src/shared/InputMegaGas.tsx +++ b/packages/page-contracts/src/shared/InputMegaGas.tsx @@ -1,6 +1,8 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { UseWeight } from '../types'; + import BN from 'bn.js'; import React, { useEffect, useMemo, useState } from 'react'; import styled from 'styled-components'; @@ -8,7 +10,6 @@ import styled from 'styled-components'; import { InputNumber, Toggle } from '@polkadot/react-components'; import { BN_ZERO } from '@polkadot/util'; -import type { UseWeight } from '../types'; import { useTranslation } from '../translate'; interface Props { diff --git a/packages/page-contracts/src/shared/InputName.tsx b/packages/page-contracts/src/shared/InputName.tsx index 82fe2c1342..663576046b 100644 --- a/packages/page-contracts/src/shared/InputName.tsx +++ b/packages/page-contracts/src/shared/InputName.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { VoidFn } from '@polkadot/react-components/types'; + import React from 'react'; -import type { VoidFn } from '@polkadot/react-components/types'; import { Input } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-contracts/src/shared/Message.tsx b/packages/page-contracts/src/shared/Message.tsx index d564a71a1b..d22d7312bd 100644 --- a/packages/page-contracts/src/shared/Message.tsx +++ b/packages/page-contracts/src/shared/Message.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AbiConstructor, AbiMessage, ContractCallOutcome } from '@polkadot/api-contract/types'; + import React, { useCallback } from 'react'; import styled from 'styled-components'; -import type { AbiConstructor, AbiMessage, ContractCallOutcome } from '@polkadot/api-contract/types'; import { Button, Output } from '@polkadot/react-components'; import valueToText from '@polkadot/react-params/valueToText'; diff --git a/packages/page-contracts/src/shared/MessageSignature.tsx b/packages/page-contracts/src/shared/MessageSignature.tsx index 59c27c15b6..000872c6ae 100644 --- a/packages/page-contracts/src/shared/MessageSignature.tsx +++ b/packages/page-contracts/src/shared/MessageSignature.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AbiMessage } from '@polkadot/api-contract/types'; +import type { ThemeProps } from '@polkadot/react-components/types'; + import React from 'react'; import styled from 'styled-components'; -import type { AbiMessage } from '@polkadot/api-contract/types'; -import type { ThemeProps } from '@polkadot/react-components/types'; import { Icon, Tooltip } from '@polkadot/react-components'; import { encodeTypeDef } from '@polkadot/types/create'; import { stringCamelCase } from '@polkadot/util'; diff --git a/packages/page-contracts/src/shared/Messages.tsx b/packages/page-contracts/src/shared/Messages.tsx index 0eeec92457..d3e864d04f 100644 --- a/packages/page-contracts/src/shared/Messages.tsx +++ b/packages/page-contracts/src/shared/Messages.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useEffect, useState } from 'react'; -import styled from 'styled-components'; - import type { AbiMessage, ContractCallOutcome } from '@polkadot/api-contract/types'; import type { ThemeProps } from '@polkadot/react-components/types'; import type { Option } from '@polkadot/types'; import type { ContractInfo } from '@polkadot/types/interfaces'; + +import React, { useCallback, useEffect, useState } from 'react'; +import styled from 'styled-components'; + import { Abi, ContractPromise } from '@polkadot/api-contract'; import { Expander } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-contracts/src/shared/Params.tsx b/packages/page-contracts/src/shared/Params.tsx index 6d256e8db3..cf4fd7eff3 100644 --- a/packages/page-contracts/src/shared/Params.tsx +++ b/packages/page-contracts/src/shared/Params.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useEffect, useState } from 'react'; - import type { RawParams } from '@polkadot/react-params/types'; import type { Registry, TypeDef } from '@polkadot/types/types'; + +import React, { useCallback, useEffect, useState } from 'react'; + import UIParams from '@polkadot/react-params'; interface Props { diff --git a/packages/page-contracts/src/store.ts b/packages/page-contracts/src/store.ts index cdd84827fe..a0c00d627c 100644 --- a/packages/page-contracts/src/store.ts +++ b/packages/page-contracts/src/store.ts @@ -1,15 +1,15 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Hash } from '@polkadot/types/interfaces'; +import type { CodeJson, CodeStored } from './types'; + import EventEmitter from 'eventemitter3'; import store from 'store'; -import type { Hash } from '@polkadot/types/interfaces'; import { Abi } from '@polkadot/api-contract'; import { api, registry } from '@polkadot/react-api'; -import type { CodeJson, CodeStored } from './types'; - const KEY_CODE = 'code:'; class Store extends EventEmitter { diff --git a/packages/page-contracts/src/translate.ts b/packages/page-contracts/src/translate.ts index 11976ac53f..7087bc65a7 100644 --- a/packages/page-contracts/src/translate.ts +++ b/packages/page-contracts/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase, withTranslation } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/page-contracts/src/useAbi.ts b/packages/page-contracts/src/useAbi.ts index af8c4de1c8..d2eb4f60d6 100644 --- a/packages/page-contracts/src/useAbi.ts +++ b/packages/page-contracts/src/useAbi.ts @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { StringOrNull } from '@polkadot/react-components/types'; + import { useCallback, useEffect, useState } from 'react'; -import type { StringOrNull } from '@polkadot/react-components/types'; import { Abi } from '@polkadot/api-contract'; import { api } from '@polkadot/react-api'; import { u8aToString } from '@polkadot/util'; diff --git a/packages/page-contracts/src/useWeight.ts b/packages/page-contracts/src/useWeight.ts index 8742567195..006630fcb2 100644 --- a/packages/page-contracts/src/useWeight.ts +++ b/packages/page-contracts/src/useWeight.ts @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { UseWeight } from './types'; + import BN from 'bn.js'; import { useCallback, useMemo, useState } from 'react'; import { useApi, useBlockTime } from '@polkadot/react-hooks'; import { BN_TEN, BN_ZERO } from '@polkadot/util'; -import type { UseWeight } from './types'; - const BN_MILLION = new BN(1_000_000); export default function useWeight (): UseWeight { diff --git a/packages/page-council/src/Motions/Close.tsx b/packages/page-council/src/Motions/Close.tsx index 23240bd359..f1bf24baad 100644 --- a/packages/page-council/src/Motions/Close.tsx +++ b/packages/page-council/src/Motions/Close.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-council authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Hash, Proposal, ProposalIndex } from '@polkadot/types/interfaces'; + import React, { useState } from 'react'; -import type { Hash, Proposal, ProposalIndex } from '@polkadot/types/interfaces'; import { Button, InputAddress, Modal, ProposedAction, TxButton } from '@polkadot/react-components'; import { useApi, useToggle, useWeight } from '@polkadot/react-hooks'; diff --git a/packages/page-council/src/Motions/Motion.tsx b/packages/page-council/src/Motions/Motion.tsx index 0efa370c86..24827bc23a 100644 --- a/packages/page-council/src/Motions/Motion.tsx +++ b/packages/page-council/src/Motions/Motion.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-council authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useMemo } from 'react'; - import type { DeriveCollectiveProposal } from '@polkadot/api-derive/types'; import type { AccountId } from '@polkadot/types/interfaces'; + +import React, { useMemo } from 'react'; + import ProposalCell from '@polkadot/app-democracy/Overview/ProposalCell'; import { Icon, LinkExternal, TxButton } from '@polkadot/react-components'; import { useAccounts, useApi, useVotingStatus, useWeight } from '@polkadot/react-hooks'; diff --git a/packages/page-council/src/Motions/ProposeExternal.tsx b/packages/page-council/src/Motions/ProposeExternal.tsx index 666e5d42f9..5911fb6d39 100644 --- a/packages/page-council/src/Motions/ProposeExternal.tsx +++ b/packages/page-council/src/Motions/ProposeExternal.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-council authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsic } from '@polkadot/api/types'; + import React, { useCallback, useEffect, useState } from 'react'; -import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { getProposalThreshold } from '@polkadot/apps-config'; import { Button, Input, InputAddress, Modal, TxButton } from '@polkadot/react-components'; import { useApi, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-council/src/Motions/ProposeMotion.tsx b/packages/page-council/src/Motions/ProposeMotion.tsx index fd4129ac97..8a84f6c65f 100644 --- a/packages/page-council/src/Motions/ProposeMotion.tsx +++ b/packages/page-council/src/Motions/ProposeMotion.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-council authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsic } from '@polkadot/api/types'; + import BN from 'bn.js'; import React, { useCallback, useEffect, useState } from 'react'; -import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { getProposalThreshold } from '@polkadot/apps-config'; import { Button, Extrinsic, InputAddress, InputNumber, Modal, TxButton } from '@polkadot/react-components'; import { useApi, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-council/src/Motions/Slashing.tsx b/packages/page-council/src/Motions/Slashing.tsx index f2783fc06e..1c95223830 100644 --- a/packages/page-council/src/Motions/Slashing.tsx +++ b/packages/page-council/src/Motions/Slashing.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-council authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsic } from '@polkadot/api/types'; + import React, { useEffect, useMemo, useState } from 'react'; -import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { getSlashProposalThreshold } from '@polkadot/apps-config'; import { Button, Dropdown, Input, InputAddress, Modal, TxButton } from '@polkadot/react-components'; import { useApi, useAvailableSlashes, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-council/src/Motions/Voters.tsx b/packages/page-council/src/Motions/Voters.tsx index 897614b86a..49001ae570 100644 --- a/packages/page-council/src/Motions/Voters.tsx +++ b/packages/page-council/src/Motions/Voters.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AccountId, MemberCount } from '@polkadot/types/interfaces'; + import React, { useMemo } from 'react'; -import type { AccountId, MemberCount } from '@polkadot/types/interfaces'; import { AddressMini, Expander } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-council/src/Motions/Voting.tsx b/packages/page-council/src/Motions/Voting.tsx index 611492da08..4f9d501a0f 100644 --- a/packages/page-council/src/Motions/Voting.tsx +++ b/packages/page-council/src/Motions/Voting.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-council authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AccountId, Hash, Proposal, ProposalIndex } from '@polkadot/types/interfaces'; + import React, { useState } from 'react'; -import type { AccountId, Hash, Proposal, ProposalIndex } from '@polkadot/types/interfaces'; import { Button, Modal, ProposedAction, TxButton, VoteAccount } from '@polkadot/react-components'; import { useAccounts, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-council/src/Motions/index.tsx b/packages/page-council/src/Motions/index.tsx index c28d0d24ed..59e7925ac4 100644 --- a/packages/page-council/src/Motions/index.tsx +++ b/packages/page-council/src/Motions/index.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-council authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useRef } from 'react'; - import type { DeriveCollectiveProposal } from '@polkadot/api-derive/types'; import type { AccountId } from '@polkadot/types/interfaces'; + +import React, { useRef } from 'react'; + import { Button, Table } from '@polkadot/react-components'; import { useMembers } from '@polkadot/react-hooks'; diff --git a/packages/page-council/src/Overview/Candidate.tsx b/packages/page-council/src/Overview/Candidate.tsx index 39a3414946..5a14027c58 100644 --- a/packages/page-council/src/Overview/Candidate.tsx +++ b/packages/page-council/src/Overview/Candidate.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AccountId, Balance } from '@polkadot/types/interfaces'; + import React from 'react'; -import type { AccountId, Balance } from '@polkadot/types/interfaces'; import { AddressSmall, Tag } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-council/src/Overview/Candidates.tsx b/packages/page-council/src/Overview/Candidates.tsx index 95c2de158e..cec52f2aa1 100644 --- a/packages/page-council/src/Overview/Candidates.tsx +++ b/packages/page-council/src/Overview/Candidates.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useRef } from 'react'; - import type { DeriveElectionsInfo } from '@polkadot/api-derive/types'; import type { AccountId } from '@polkadot/types/interfaces'; + +import React, { useRef } from 'react'; + import { Table } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-council/src/Overview/Members.tsx b/packages/page-council/src/Overview/Members.tsx index 0662e99c0c..2404b5525a 100644 --- a/packages/page-council/src/Overview/Members.tsx +++ b/packages/page-council/src/Overview/Members.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useRef } from 'react'; - import type { DeriveElectionsInfo } from '@polkadot/api-derive/types'; import type { AccountId } from '@polkadot/types/interfaces'; + +import React, { useRef } from 'react'; + import { Table } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-council/src/Overview/SubmitCandidacy.tsx b/packages/page-council/src/Overview/SubmitCandidacy.tsx index ea428d66c8..6917545d0f 100644 --- a/packages/page-council/src/Overview/SubmitCandidacy.tsx +++ b/packages/page-council/src/Overview/SubmitCandidacy.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-council authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ComponentProps as Props } from './types'; + import React, { useState } from 'react'; import { Button, InputAddress, InputBalance, Modal, TxButton } from '@polkadot/react-components'; import { useApi, useModal } from '@polkadot/react-hooks'; -import type { ComponentProps as Props } from './types'; import { useTranslation } from '../translate'; function SubmitCandidacy ({ electionsInfo }: Props): React.ReactElement { diff --git a/packages/page-council/src/Overview/Summary.tsx b/packages/page-council/src/Overview/Summary.tsx index 7d1d3b2072..0c7945955b 100644 --- a/packages/page-council/src/Overview/Summary.tsx +++ b/packages/page-council/src/Overview/Summary.tsx @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { DeriveElectionsInfo } from '@polkadot/api-derive/types'; import type { BlockNumber } from '@polkadot/types/interfaces'; +import type { ComponentProps } from './types'; + +import React from 'react'; + import { CardSummary, SummaryBox } from '@polkadot/react-components'; import { formatNumber } from '@polkadot/util'; -import type { ComponentProps } from './types'; import { useTranslation } from '../translate'; interface Props extends ComponentProps { diff --git a/packages/page-council/src/Overview/Vote.tsx b/packages/page-council/src/Overview/Vote.tsx index df83dadef2..f4c9e76ebd 100644 --- a/packages/page-council/src/Overview/Vote.tsx +++ b/packages/page-council/src/Overview/Vote.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-council authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveElectionsInfo } from '@polkadot/api-derive/types'; + import React, { useEffect, useState } from 'react'; -import type { DeriveElectionsInfo } from '@polkadot/api-derive/types'; import { Button, InputAddress, InputAddressMulti, Modal, TxButton, VoteValue } from '@polkadot/react-components'; import { useApi, useToggle } from '@polkadot/react-hooks'; import { BN_ZERO } from '@polkadot/util'; diff --git a/packages/page-council/src/Overview/Voters.tsx b/packages/page-council/src/Overview/Voters.tsx index 4cab21aea3..cb2bc271f1 100644 --- a/packages/page-council/src/Overview/Voters.tsx +++ b/packages/page-council/src/Overview/Voters.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AccountId, Balance } from '@polkadot/types/interfaces'; + import React from 'react'; -import type { AccountId, Balance } from '@polkadot/types/interfaces'; import { AddressMini, Expander } from '@polkadot/react-components'; import { FormatBalance } from '@polkadot/react-query'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/page-council/src/Overview/index.tsx b/packages/page-council/src/Overview/index.tsx index 3b5b9ac9b4..7d3e33c46f 100644 --- a/packages/page-council/src/Overview/index.tsx +++ b/packages/page-council/src/Overview/index.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { DeriveCouncilVotes, DeriveElectionsInfo } from '@polkadot/api-derive/types'; import type { AccountId, BlockNumber } from '@polkadot/types/interfaces'; + +import React from 'react'; + import { Button } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-council/src/Overview/types.ts b/packages/page-council/src/Overview/types.ts index 162d43eea1..06000a3b83 100644 --- a/packages/page-council/src/Overview/types.ts +++ b/packages/page-council/src/Overview/types.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import BN from 'bn.js'; - import type { DeriveElectionsInfo } from '@polkadot/api-derive/types'; import type { SetIndex } from '@polkadot/types/interfaces'; +import BN from 'bn.js'; + export interface ComponentProps { electionsInfo?: DeriveElectionsInfo; } diff --git a/packages/page-council/src/index.tsx b/packages/page-council/src/index.tsx index dd747fd452..6e8d857886 100644 --- a/packages/page-council/src/index.tsx +++ b/packages/page-council/src/index.tsx @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveCollectiveProposal } from '@polkadot/api-derive/types'; +import type { Option } from '@polkadot/types'; +import type { AccountId } from '@polkadot/types/interfaces'; + import React, { useMemo } from 'react'; import { Route, Switch } from 'react-router'; import { useLocation } from 'react-router-dom'; import styled from 'styled-components'; -import type { DeriveCollectiveProposal } from '@polkadot/api-derive/types'; -import type { Option } from '@polkadot/types'; -import type { AccountId } from '@polkadot/types/interfaces'; import { Tabs } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-council/src/translate.ts b/packages/page-council/src/translate.ts index c65b6bad40..e48607ee01 100644 --- a/packages/page-council/src/translate.ts +++ b/packages/page-council/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/page-council/src/useCounter.ts b/packages/page-council/src/useCounter.ts index 3d9d13280b..66f3e3cd53 100644 --- a/packages/page-council/src/useCounter.ts +++ b/packages/page-council/src/useCounter.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { DeriveCollectiveProposal } from '@polkadot/api-derive/types'; + import { useAccounts, useApi, useCall } from '@polkadot/react-hooks'; const transformCounter = { diff --git a/packages/page-democracy/src/Execute/DispatchEntry.tsx b/packages/page-democracy/src/Execute/DispatchEntry.tsx index e38b2af7e3..b011b95101 100644 --- a/packages/page-democracy/src/Execute/DispatchEntry.tsx +++ b/packages/page-democracy/src/Execute/DispatchEntry.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { DeriveDispatch } from '@polkadot/api-derive/types'; import type { BlockNumber } from '@polkadot/types/interfaces'; + +import React from 'react'; + import { LinkExternal } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BlockToTime } from '@polkadot/react-query'; diff --git a/packages/page-democracy/src/Execute/DispatchQueue.tsx b/packages/page-democracy/src/Execute/DispatchQueue.tsx index 7b87dfced4..33076aeb5f 100644 --- a/packages/page-democracy/src/Execute/DispatchQueue.tsx +++ b/packages/page-democracy/src/Execute/DispatchQueue.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveDispatch } from '@polkadot/api-derive/types'; + import React, { useRef } from 'react'; -import type { DeriveDispatch } from '@polkadot/api-derive/types'; import { Table } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-democracy/src/Execute/Scheduled.tsx b/packages/page-democracy/src/Execute/Scheduled.tsx index e16b91bfb7..623761ec46 100644 --- a/packages/page-democracy/src/Execute/Scheduled.tsx +++ b/packages/page-democracy/src/Execute/Scheduled.tsx @@ -1,16 +1,16 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { BlockNumber } from '@polkadot/types/interfaces'; +import type { ScheduledExt } from './types'; + import React from 'react'; -import type { BlockNumber } from '@polkadot/types/interfaces'; import { CallExpander } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BlockToTime } from '@polkadot/react-query'; import { formatNumber } from '@polkadot/util'; -import type { ScheduledExt } from './types'; - interface Props { className?: string; value: ScheduledExt; diff --git a/packages/page-democracy/src/Execute/Scheduler.tsx b/packages/page-democracy/src/Execute/Scheduler.tsx index 6d9bd9a3cf..8500763bc1 100644 --- a/packages/page-democracy/src/Execute/Scheduler.tsx +++ b/packages/page-democracy/src/Execute/Scheduler.tsx @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useRef } from 'react'; - import type { Option } from '@polkadot/types'; import type { BlockNumber, Scheduled } from '@polkadot/types/interfaces'; +import type { ScheduledExt } from './types'; + +import React, { useRef } from 'react'; + import { Table } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; -import type { ScheduledExt } from './types'; import { useTranslation } from '../translate'; import ScheduledView from './Scheduled'; diff --git a/packages/page-democracy/src/Overview/External.tsx b/packages/page-democracy/src/Overview/External.tsx index 3ecb9ccca4..90c6689127 100644 --- a/packages/page-democracy/src/Overview/External.tsx +++ b/packages/page-democracy/src/Overview/External.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveProposalExternal } from '@polkadot/api-derive/types'; + import React from 'react'; -import type { DeriveProposalExternal } from '@polkadot/api-derive/types'; import { AddressMini, Button } from '@polkadot/react-components'; import { FormatBalance } from '@polkadot/react-query'; diff --git a/packages/page-democracy/src/Overview/ExternalCell.tsx b/packages/page-democracy/src/Overview/ExternalCell.tsx index bf2ded7819..f60f0a11b8 100644 --- a/packages/page-democracy/src/Overview/ExternalCell.tsx +++ b/packages/page-democracy/src/Overview/ExternalCell.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { DeriveProposalImage } from '@polkadot/api-derive/types'; import type { Hash } from '@polkadot/types/interfaces'; + +import React from 'react'; + import { CallExpander } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { Holder } from '@polkadot/react-params'; diff --git a/packages/page-democracy/src/Overview/Externals.tsx b/packages/page-democracy/src/Overview/Externals.tsx index 662ea69ad7..3492f7d77a 100644 --- a/packages/page-democracy/src/Overview/Externals.tsx +++ b/packages/page-democracy/src/Overview/Externals.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveProposalExternal } from '@polkadot/api-derive/types'; + import React, { useRef } from 'react'; -import type { DeriveProposalExternal } from '@polkadot/api-derive/types'; import { Table } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-democracy/src/Overview/Fasttrack.tsx b/packages/page-democracy/src/Overview/Fasttrack.tsx index 768980ce06..b71e9e7c95 100644 --- a/packages/page-democracy/src/Overview/Fasttrack.tsx +++ b/packages/page-democracy/src/Overview/Fasttrack.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsic } from '@polkadot/api/types'; +import type { Hash, VoteThreshold } from '@polkadot/types/interfaces'; + import BN from 'bn.js'; import React, { useEffect, useMemo, useState } from 'react'; -import type { SubmittableExtrinsic } from '@polkadot/api/types'; -import type { Hash, VoteThreshold } from '@polkadot/types/interfaces'; import { Button, Input, InputAddress, InputNumber, Modal, TxButton } from '@polkadot/react-components'; import { useApi, useMembers, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-democracy/src/Overview/PreImage.tsx b/packages/page-democracy/src/Overview/PreImage.tsx index 3ecc2168c2..744686017f 100644 --- a/packages/page-democracy/src/Overview/PreImage.tsx +++ b/packages/page-democracy/src/Overview/PreImage.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; +import type { Hash } from '@polkadot/types/interfaces'; + import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; -import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; -import type { Hash } from '@polkadot/types/interfaces'; import { Extrinsic, Input, InputAddress, InputBalance, Modal, TxButton } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import { Available } from '@polkadot/react-query'; diff --git a/packages/page-democracy/src/Overview/PreImageButton.tsx b/packages/page-democracy/src/Overview/PreImageButton.tsx index 6a19742136..0791f43caa 100644 --- a/packages/page-democracy/src/Overview/PreImageButton.tsx +++ b/packages/page-democracy/src/Overview/PreImageButton.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Hash } from '@polkadot/types/interfaces'; + import React from 'react'; -import type { Hash } from '@polkadot/types/interfaces'; import { Button } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-democracy/src/Overview/Proposal.tsx b/packages/page-democracy/src/Overview/Proposal.tsx index 02a97e072b..872ae8cd85 100644 --- a/packages/page-democracy/src/Overview/Proposal.tsx +++ b/packages/page-democracy/src/Overview/Proposal.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveProposal } from '@polkadot/api-derive/types'; + import React from 'react'; import styled from 'styled-components'; -import type { DeriveProposal } from '@polkadot/api-derive/types'; import { AddressMini, Button, Expander, LinkExternal } from '@polkadot/react-components'; import { FormatBalance } from '@polkadot/react-query'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/page-democracy/src/Overview/ProposalCell.tsx b/packages/page-democracy/src/Overview/ProposalCell.tsx index 10bd0da9f5..27865ba36b 100644 --- a/packages/page-democracy/src/Overview/ProposalCell.tsx +++ b/packages/page-democracy/src/Overview/ProposalCell.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { Compact } from '@polkadot/types'; import type { Hash, Proposal, ProposalIndex } from '@polkadot/types/interfaces'; + +import React from 'react'; + import { CallExpander } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-democracy/src/Overview/Proposals.tsx b/packages/page-democracy/src/Overview/Proposals.tsx index e8949fa4a6..3b323c5415 100644 --- a/packages/page-democracy/src/Overview/Proposals.tsx +++ b/packages/page-democracy/src/Overview/Proposals.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveProposal } from '@polkadot/api-derive/types'; + import React, { useRef } from 'react'; -import type { DeriveProposal } from '@polkadot/api-derive/types'; import { Table } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-democracy/src/Overview/Referendum.tsx b/packages/page-democracy/src/Overview/Referendum.tsx index 0d5d7c34c7..89614211ad 100644 --- a/packages/page-democracy/src/Overview/Referendum.tsx +++ b/packages/page-democracy/src/Overview/Referendum.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveReferendumExt } from '@polkadot/api-derive/types'; +import type { Balance, BlockNumber } from '@polkadot/types/interfaces'; + import BN from 'bn.js'; import React, { useMemo } from 'react'; import styled from 'styled-components'; -import type { DeriveReferendumExt } from '@polkadot/api-derive/types'; -import type { Balance, BlockNumber } from '@polkadot/types/interfaces'; import { Badge, Button, Icon, LinkExternal } from '@polkadot/react-components'; import { useAccounts, useApi, useCall } from '@polkadot/react-hooks'; import { BlockToTime } from '@polkadot/react-query'; diff --git a/packages/page-democracy/src/Overview/ReferendumVote.tsx b/packages/page-democracy/src/Overview/ReferendumVote.tsx index 40964ef58a..bed19a9117 100644 --- a/packages/page-democracy/src/Overview/ReferendumVote.tsx +++ b/packages/page-democracy/src/Overview/ReferendumVote.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { DeriveReferendumVote } from '@polkadot/api-derive/types'; import type { Vote } from '@polkadot/types/interfaces'; + +import React from 'react'; + import { AddressMini } from '@polkadot/react-components'; interface Props { diff --git a/packages/page-democracy/src/Overview/ReferendumVotes.tsx b/packages/page-democracy/src/Overview/ReferendumVotes.tsx index faa87969a1..547b9c02cb 100644 --- a/packages/page-democracy/src/Overview/ReferendumVotes.tsx +++ b/packages/page-democracy/src/Overview/ReferendumVotes.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveReferendumVote } from '@polkadot/api-derive/types'; + import BN from 'bn.js'; import React, { useMemo } from 'react'; -import type { DeriveReferendumVote } from '@polkadot/api-derive/types'; import { Expander } from '@polkadot/react-components'; import { FormatBalance } from '@polkadot/react-query'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/page-democracy/src/Overview/Referendums.tsx b/packages/page-democracy/src/Overview/Referendums.tsx index 4bbe106108..f60bf14fbf 100644 --- a/packages/page-democracy/src/Overview/Referendums.tsx +++ b/packages/page-democracy/src/Overview/Referendums.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveReferendumExt } from '@polkadot/api-derive/types'; + import React, { useRef } from 'react'; -import type { DeriveReferendumExt } from '@polkadot/api-derive/types'; import { Table } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-democracy/src/Overview/Seconding.tsx b/packages/page-democracy/src/Overview/Seconding.tsx index c405a5290f..1c1f190766 100644 --- a/packages/page-democracy/src/Overview/Seconding.tsx +++ b/packages/page-democracy/src/Overview/Seconding.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveProposalImage } from '@polkadot/api-derive/types'; +import type { AccountId } from '@polkadot/types/interfaces'; + import BN from 'bn.js'; import React, { useState } from 'react'; -import type { DeriveProposalImage } from '@polkadot/api-derive/types'; -import type { AccountId } from '@polkadot/types/interfaces'; import { Button, InputAddress, Modal, ProposedAction, TxButton } from '@polkadot/react-components'; import { useAccounts, useApi, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-democracy/src/Overview/TreasuryCell.tsx b/packages/page-democracy/src/Overview/TreasuryCell.tsx index b08f243031..8f71de39a2 100644 --- a/packages/page-democracy/src/Overview/TreasuryCell.tsx +++ b/packages/page-democracy/src/Overview/TreasuryCell.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useEffect, useState } from 'react'; - import type { Compact, Option } from '@polkadot/types'; import type { ProposalIndex, TreasuryProposal } from '@polkadot/types/interfaces'; import type { TypeDef } from '@polkadot/types/types'; + +import React, { useEffect, useState } from 'react'; + import { useApi, useCall } from '@polkadot/react-hooks'; import Params from '@polkadot/react-params'; import { getTypeDef } from '@polkadot/types/create'; diff --git a/packages/page-democracy/src/Overview/Voting.tsx b/packages/page-democracy/src/Overview/Voting.tsx index b7a5f9a14c..8b94775a33 100644 --- a/packages/page-democracy/src/Overview/Voting.tsx +++ b/packages/page-democracy/src/Overview/Voting.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { PropIndex, Proposal } from '@polkadot/types/interfaces'; + import BN from 'bn.js'; import React, { useMemo, useState } from 'react'; -import type { PropIndex, Proposal } from '@polkadot/types/interfaces'; import { Button, ConvictionDropdown, Modal, ProposedAction, TxButton, VoteAccount, VoteValue } from '@polkadot/react-components'; import { useAccounts, useApi, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-democracy/src/Overview/index.tsx b/packages/page-democracy/src/Overview/index.tsx index 9af72ee3a4..1c4688cc14 100644 --- a/packages/page-democracy/src/Overview/index.tsx +++ b/packages/page-democracy/src/Overview/index.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveReferendumExt } from '@polkadot/api-derive/types'; + import React from 'react'; -import type { DeriveReferendumExt } from '@polkadot/api-derive/types'; import { Button } from '@polkadot/react-components'; import { useApi, useCall, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-democracy/src/translate.ts b/packages/page-democracy/src/translate.ts index 83eb1754de..eba368ba85 100644 --- a/packages/page-democracy/src/translate.ts +++ b/packages/page-democracy/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/page-democracy/src/useChangeCalc.ts b/packages/page-democracy/src/useChangeCalc.ts index 460cafa75c..b4dbdaac82 100644 --- a/packages/page-democracy/src/useChangeCalc.ts +++ b/packages/page-democracy/src/useChangeCalc.ts @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { VoteThreshold } from '@polkadot/types/interfaces'; + import BN from 'bn.js'; import { useEffect, useState } from 'react'; -import type { VoteThreshold } from '@polkadot/types/interfaces'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BN_ZERO } from '@polkadot/util'; diff --git a/packages/page-democracy/src/util.ts b/packages/page-democracy/src/util.ts index 56db28a59f..dd14f1629a 100644 --- a/packages/page-democracy/src/util.ts +++ b/packages/page-democracy/src/util.ts @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { VoteThreshold } from '@polkadot/types/interfaces'; + import BN from 'bn.js'; -import type { VoteThreshold } from '@polkadot/types/interfaces'; import { calcPassing } from '@polkadot/api-derive/democracy/util'; import { BN_ONE, BN_TEN, BN_ZERO } from '@polkadot/util'; diff --git a/packages/page-explorer/src/BestHash.tsx b/packages/page-explorer/src/BestHash.tsx index 6e53eb074a..de7707610a 100644 --- a/packages/page-explorer/src/BestHash.tsx +++ b/packages/page-explorer/src/BestHash.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Header } from '@polkadot/types/interfaces'; + import React from 'react'; -import type { Header } from '@polkadot/types/interfaces'; import { useApi, useCall } from '@polkadot/react-hooks'; interface Props { diff --git a/packages/page-explorer/src/BlockInfo/ByHash.tsx b/packages/page-explorer/src/BlockInfo/ByHash.tsx index 1c516182e6..ae3630c439 100644 --- a/packages/page-explorer/src/BlockInfo/ByHash.tsx +++ b/packages/page-explorer/src/BlockInfo/ByHash.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-explorer authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { KeyedEvent } from '@polkadot/react-query/types'; +import type { EventRecord, SignedBlock } from '@polkadot/types/interfaces'; + import React, { useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; -import type { KeyedEvent } from '@polkadot/react-query/types'; -import type { EventRecord, SignedBlock } from '@polkadot/types/interfaces'; import { HeaderExtended } from '@polkadot/api-derive'; import { AddressSmall, Columar, Column, LinkExternal, Table } from '@polkadot/react-components'; import { useApi, useIsMountedRef } from '@polkadot/react-hooks'; diff --git a/packages/page-explorer/src/BlockInfo/ByNumber.tsx b/packages/page-explorer/src/BlockInfo/ByNumber.tsx index 246c704447..eff17fc054 100644 --- a/packages/page-explorer/src/BlockInfo/ByNumber.tsx +++ b/packages/page-explorer/src/BlockInfo/ByNumber.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-explorer authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Hash } from '@polkadot/types/interfaces'; + import React, { useEffect, useState } from 'react'; -import type { Hash } from '@polkadot/types/interfaces'; import { Spinner } from '@polkadot/react-components'; import { useApi, useIsMountedRef } from '@polkadot/react-hooks'; diff --git a/packages/page-explorer/src/BlockInfo/Extrinsic.tsx b/packages/page-explorer/src/BlockInfo/Extrinsic.tsx index c45fab66bb..6a0fa5dc88 100644 --- a/packages/page-explorer/src/BlockInfo/Extrinsic.tsx +++ b/packages/page-explorer/src/BlockInfo/Extrinsic.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-explorer authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { KeyedEvent } from '@polkadot/react-query/types'; +import type { BlockNumber, Extrinsic } from '@polkadot/types/interfaces'; + import React from 'react'; import styled from 'styled-components'; -import type { KeyedEvent } from '@polkadot/react-query/types'; -import type { BlockNumber, Extrinsic } from '@polkadot/types/interfaces'; import { AddressMini, Call, Expander, LinkExternal } from '@polkadot/react-components'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/page-explorer/src/BlockInfo/Extrinsics.tsx b/packages/page-explorer/src/BlockInfo/Extrinsics.tsx index 492abb8556..8f99fbf959 100644 --- a/packages/page-explorer/src/BlockInfo/Extrinsics.tsx +++ b/packages/page-explorer/src/BlockInfo/Extrinsics.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-explorer authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useMemo } from 'react'; - import type { KeyedEvent } from '@polkadot/react-query/types'; import type { BlockNumber, Extrinsic } from '@polkadot/types/interfaces'; + +import React, { useMemo } from 'react'; + import { Table } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-explorer/src/BlockInfo/Logs.tsx b/packages/page-explorer/src/BlockInfo/Logs.tsx index fd273e3d55..c8abb41cf5 100644 --- a/packages/page-explorer/src/BlockInfo/Logs.tsx +++ b/packages/page-explorer/src/BlockInfo/Logs.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-explorer authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useRef } from 'react'; - import type { DigestItem } from '@polkadot/types/interfaces'; import type { Codec, TypeDef } from '@polkadot/types/types'; + +import React, { useRef } from 'react'; + import { Expander, Table } from '@polkadot/react-components'; import Params from '@polkadot/react-params'; import { Raw, Struct, Tuple, Vec } from '@polkadot/types'; diff --git a/packages/page-explorer/src/BlockInfo/index.tsx b/packages/page-explorer/src/BlockInfo/index.tsx index 5e05cfa1e9..6d57b276cb 100644 --- a/packages/page-explorer/src/BlockInfo/index.tsx +++ b/packages/page-explorer/src/BlockInfo/index.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-explorer authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { BlockNumber } from '@polkadot/types/interfaces'; + import React, { useEffect, useState } from 'react'; import { useParams } from 'react-router-dom'; -import type { BlockNumber } from '@polkadot/types/interfaces'; import { useApi, useCall } from '@polkadot/react-hooks'; import { isHex } from '@polkadot/util'; diff --git a/packages/page-explorer/src/Event.tsx b/packages/page-explorer/src/Event.tsx index a26930b470..f4c5925dd8 100644 --- a/packages/page-explorer/src/Event.tsx +++ b/packages/page-explorer/src/Event.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-explorer authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { EventRecord } from '@polkadot/types/interfaces'; + import React from 'react'; -import type { EventRecord } from '@polkadot/types/interfaces'; import { Event as EventDisplay, Expander } from '@polkadot/react-components'; interface Props { diff --git a/packages/page-explorer/src/Events.tsx b/packages/page-explorer/src/Events.tsx index 3f4e40f270..1c6dc7e133 100644 --- a/packages/page-explorer/src/Events.tsx +++ b/packages/page-explorer/src/Events.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-explorer authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { KeyedEvent } from '@polkadot/react-query/types'; + import React, { useMemo } from 'react'; import { Link } from 'react-router-dom'; import styled from 'styled-components'; -import type { KeyedEvent } from '@polkadot/react-query/types'; import { Table } from '@polkadot/react-components'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/page-explorer/src/Forks.tsx b/packages/page-explorer/src/Forks.tsx index b6ab92332b..9e45e46088 100644 --- a/packages/page-explorer/src/Forks.tsx +++ b/packages/page-explorer/src/Forks.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-explorer authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useEffect, useRef, useState } from 'react'; -import styled from 'styled-components'; - import type { ApiProps } from '@polkadot/react-api/types'; import type { ThemeProps } from '@polkadot/react-components/types'; import type { Header } from '@polkadot/types/interfaces'; + +import React, { useCallback, useEffect, useRef, useState } from 'react'; +import styled from 'styled-components'; + import { CardSummary, IdentityIcon, SummaryBox } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/page-explorer/src/Main.tsx b/packages/page-explorer/src/Main.tsx index 7e4714eeed..9712c67334 100644 --- a/packages/page-explorer/src/Main.tsx +++ b/packages/page-explorer/src/Main.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-explorer authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { KeyedEvent } from '@polkadot/react-query/types'; + import React from 'react'; -import type { KeyedEvent } from '@polkadot/react-query/types'; import { HeaderExtended } from '@polkadot/api-derive'; import { Columar, Column } from '@polkadot/react-components'; diff --git a/packages/page-explorer/src/NodeInfo/Peers.tsx b/packages/page-explorer/src/NodeInfo/Peers.tsx index 408b8cb11f..a88d0a077f 100644 --- a/packages/page-explorer/src/NodeInfo/Peers.tsx +++ b/packages/page-explorer/src/NodeInfo/Peers.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-nodeinfo authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { PeerInfo } from '@polkadot/types/interfaces'; + import React, { useRef } from 'react'; import styled from 'styled-components'; -import type { PeerInfo } from '@polkadot/types/interfaces'; import { Table } from '@polkadot/react-components'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/page-explorer/src/NodeInfo/Summary.tsx b/packages/page-explorer/src/NodeInfo/Summary.tsx index 66708d43ff..2751ac8f57 100644 --- a/packages/page-explorer/src/NodeInfo/Summary.tsx +++ b/packages/page-explorer/src/NodeInfo/Summary.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/app-nodeinfo authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Info } from './types'; + import React, { useEffect, useState } from 'react'; import { CardSummary, SummaryBox } from '@polkadot/react-components'; import { BestNumber, Elapsed } from '@polkadot/react-query'; import { BN_ZERO, formatNumber } from '@polkadot/util'; -import type { Info } from './types'; import { useTranslation } from '../translate'; interface Props { diff --git a/packages/page-explorer/src/NodeInfo/index.tsx b/packages/page-explorer/src/NodeInfo/index.tsx index ee1f0fbcd7..12e25435f7 100644 --- a/packages/page-explorer/src/NodeInfo/index.tsx +++ b/packages/page-explorer/src/NodeInfo/index.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-nodeinfo authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Info } from './types'; + import React, { useEffect, useState } from 'react'; import { ApiPromise } from '@polkadot/api'; import { useApi } from '@polkadot/react-hooks'; -import type { Info } from './types'; import Extrinsics from '../BlockInfo/Extrinsics'; import { useTranslation } from '../translate'; import Peers from './Peers'; diff --git a/packages/page-explorer/src/SummarySession.tsx b/packages/page-explorer/src/SummarySession.tsx index 2c9d044f20..2bb66bd6b7 100644 --- a/packages/page-explorer/src/SummarySession.tsx +++ b/packages/page-explorer/src/SummarySession.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-explorer authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { DeriveSessionProgress } from '@polkadot/api-derive/types'; import type { Forcing } from '@polkadot/types/interfaces'; + +import React from 'react'; + import { CardSummary } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { Elapsed } from '@polkadot/react-query'; diff --git a/packages/page-explorer/src/index.tsx b/packages/page-explorer/src/index.tsx index 7394093195..ea3d64cb23 100644 --- a/packages/page-explorer/src/index.tsx +++ b/packages/page-explorer/src/index.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-explorer authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { KeyedEvent } from '@polkadot/react-query/types'; + import React, { useContext, useRef } from 'react'; import { Route, Switch } from 'react-router'; -import type { KeyedEvent } from '@polkadot/react-query/types'; import Tabs from '@polkadot/react-components/Tabs'; import { useApi } from '@polkadot/react-hooks'; import { BlockAuthorsContext, EventsContext } from '@polkadot/react-query'; diff --git a/packages/page-explorer/src/translate.ts b/packages/page-explorer/src/translate.ts index 57b6719108..19ccc57855 100644 --- a/packages/page-explorer/src/translate.ts +++ b/packages/page-explorer/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/page-extrinsics/src/Balance.tsx b/packages/page-extrinsics/src/Balance.tsx index 7eeb0819ea..eca2c71ee7 100644 --- a/packages/page-extrinsics/src/Balance.tsx +++ b/packages/page-extrinsics/src/Balance.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; + import React from 'react'; -import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; import { InputBalance } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-extrinsics/src/Selection.tsx b/packages/page-extrinsics/src/Selection.tsx index 7936709983..e9b1d4e604 100644 --- a/packages/page-extrinsics/src/Selection.tsx +++ b/packages/page-extrinsics/src/Selection.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-extrinsics authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsic } from '@polkadot/api/types'; + import React, { useCallback, useState } from 'react'; -import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { Button, Extrinsic, InputAddress, TxButton } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import { BalanceFree } from '@polkadot/react-query'; diff --git a/packages/page-extrinsics/src/index.tsx b/packages/page-extrinsics/src/index.tsx index 3b590e6eb0..997606cbac 100644 --- a/packages/page-extrinsics/src/index.tsx +++ b/packages/page-extrinsics/src/index.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-extrinsics authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AppProps as Props } from '@polkadot/react-components/types'; + import React, { useRef } from 'react'; -import type { AppProps as Props } from '@polkadot/react-components/types'; import { Tabs } from '@polkadot/react-components'; import Selection from './Selection'; diff --git a/packages/page-extrinsics/src/translate.ts b/packages/page-extrinsics/src/translate.ts index 70028321ea..d94c4ca5dc 100644 --- a/packages/page-extrinsics/src/translate.ts +++ b/packages/page-extrinsics/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/page-generic-asset/src/Assets.tsx b/packages/page-generic-asset/src/Assets.tsx index 5f9e74a09b..558ca7e26e 100644 --- a/packages/page-generic-asset/src/Assets.tsx +++ b/packages/page-generic-asset/src/Assets.tsx @@ -1,10 +1,11 @@ // Copyright 2019 @polkadot/app-generic-asset authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { I18nProps } from '@polkadot/react-components/types'; + import BN from 'bn.js'; import React, { useState } from 'react'; -import type { I18nProps } from '@polkadot/react-components/types'; import { withMulti, withObservable } from '@polkadot/react-api/hoc'; import { Button, CardGrid } from '@polkadot/react-components'; diff --git a/packages/page-generic-asset/src/Transfer.tsx b/packages/page-generic-asset/src/Transfer.tsx index 1e7ff678be..c4a6e20428 100644 --- a/packages/page-generic-asset/src/Transfer.tsx +++ b/packages/page-generic-asset/src/Transfer.tsx @@ -1,11 +1,12 @@ // Copyright 2019 @polkadot/app-generic-asset authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; + import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; -import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; import { withMulti, withObservable } from '@polkadot/react-api/hoc'; import { Button, Dropdown, InputAddress, InputBalance, TxButton } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; diff --git a/packages/page-generic-asset/src/translate.ts b/packages/page-generic-asset/src/translate.ts index 42eb4d1bca..01906645ab 100644 --- a/packages/page-generic-asset/src/translate.ts +++ b/packages/page-generic-asset/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase, withTranslation } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/page-js/src/Output.tsx b/packages/page-js/src/Output.tsx index 7eea52f880..86a6bd207b 100644 --- a/packages/page-js/src/Output.tsx +++ b/packages/page-js/src/Output.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-js authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeProps } from '@polkadot/react-components/types'; +import type { Log } from './types'; + import React from 'react'; import styled from 'styled-components'; -import type { ThemeProps } from '@polkadot/react-components/types'; import { isError, isNull, isUndefined } from '@polkadot/util'; -import type { Log } from './types'; - interface Props { children?: React.ReactNode; className?: string; diff --git a/packages/page-js/src/Playground.tsx b/packages/page-js/src/Playground.tsx index cf7597f4c5..d949811f91 100644 --- a/packages/page-js/src/Playground.tsx +++ b/packages/page-js/src/Playground.tsx @@ -1,13 +1,15 @@ // Copyright 2017-2020 @polkadot/app-js authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useEffect, useRef, useState } from 'react'; -import styled from 'styled-components'; - import type { ApiPromise } from '@polkadot/api'; import type { KeyringInstance } from '@polkadot/keyring/types'; import type { ApiProps } from '@polkadot/react-api/types'; import type { AppProps as Props } from '@polkadot/react-components/types'; +import type { Log, LogType, Snippet } from './types'; + +import React, { useCallback, useEffect, useRef, useState } from 'react'; +import styled from 'styled-components'; + import { Button, Dropdown, Editor } from '@polkadot/react-components'; import { useApi, useToggle } from '@polkadot/react-hooks'; import * as types from '@polkadot/types'; @@ -15,7 +17,6 @@ import uiKeyring from '@polkadot/ui-keyring'; import * as util from '@polkadot/util'; import * as hashing from '@polkadot/util-crypto'; -import type { Log, LogType, Snippet } from './types'; import ActionButtons from './ActionButtons'; import { CUSTOM_LABEL, STORE_EXAMPLES, STORE_SELECTED } from './constants'; import Output from './Output'; diff --git a/packages/page-js/src/index.tsx b/packages/page-js/src/index.tsx index da8fe06835..0bba04c573 100644 --- a/packages/page-js/src/index.tsx +++ b/packages/page-js/src/index.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-js authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { AppProps as Props } from '@polkadot/react-components/types'; +import React from 'react'; + import Playground from './Playground'; function JsApp (props: Props): React.ReactElement { diff --git a/packages/page-js/src/snippets/index.ts b/packages/page-js/src/snippets/index.ts index 6840c434d1..3f91f91d12 100644 --- a/packages/page-js/src/snippets/index.ts +++ b/packages/page-js/src/snippets/index.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Snippet } from './../types'; + import { constsStakingParameters } from './consts-examples'; import { extrinsicMakeTransfer } from './extrinsics-examples'; import { rpcNetworkAuthoring, rpcNewHead, rpcQueryState, rpcSysthemInfo } from './rpc-examples'; diff --git a/packages/page-js/src/translate.ts b/packages/page-js/src/translate.ts index 3d8c915501..cd47b0894e 100644 --- a/packages/page-js/src/translate.ts +++ b/packages/page-js/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/page-parachains/src/Overview/Parachain.tsx b/packages/page-parachains/src/Overview/Parachain.tsx index ca57ac860b..3c67de8d3b 100644 --- a/packages/page-parachains/src/Overview/Parachain.tsx +++ b/packages/page-parachains/src/Overview/Parachain.tsx @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback } from 'react'; -import { useHistory } from 'react-router-dom'; -import styled from 'styled-components'; - import type { DeriveParachain } from '@polkadot/api-derive/types'; import type { ThemeProps } from '@polkadot/react-components/types'; import type { Option } from '@polkadot/types'; import type { HeadData } from '@polkadot/types/interfaces'; + +import React, { useCallback } from 'react'; +import { useHistory } from 'react-router-dom'; +import styled from 'styled-components'; + import { Badge, Button, Icon } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/page-parachains/src/Overview/Parachains.tsx b/packages/page-parachains/src/Overview/Parachains.tsx index 7e57eefb3c..51b907d689 100644 --- a/packages/page-parachains/src/Overview/Parachains.tsx +++ b/packages/page-parachains/src/Overview/Parachains.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveParachain } from '@polkadot/api-derive/types'; + import React, { useRef } from 'react'; import styled from 'styled-components'; -import type { DeriveParachain } from '@polkadot/api-derive/types'; import { Table } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-parachains/src/Overview/Proposal.tsx b/packages/page-parachains/src/Overview/Proposal.tsx index 8d9beff7ed..32fc43f198 100644 --- a/packages/page-parachains/src/Overview/Proposal.tsx +++ b/packages/page-parachains/src/Overview/Proposal.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ProposalExt } from './types'; + import React, { useMemo } from 'react'; import { AddressMini, AddressSmall } from '@polkadot/react-components'; import { FormatBalance } from '@polkadot/react-query'; import { formatNumber } from '@polkadot/util'; -import type { ProposalExt } from './types'; - interface Props { proposal: ProposalExt; } diff --git a/packages/page-parachains/src/Overview/Proposals.tsx b/packages/page-parachains/src/Overview/Proposals.tsx index 4f0744bdfc..592d500932 100644 --- a/packages/page-parachains/src/Overview/Proposals.tsx +++ b/packages/page-parachains/src/Overview/Proposals.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ProposalExt } from './types'; + import React, { useRef } from 'react'; import { Table } from '@polkadot/react-components'; -import type { ProposalExt } from './types'; import { useTranslation } from '../translate'; import Proposal from './Proposal'; diff --git a/packages/page-parachains/src/Overview/Register.tsx b/packages/page-parachains/src/Overview/Register.tsx index 846283d4ea..18388347f3 100644 --- a/packages/page-parachains/src/Overview/Register.tsx +++ b/packages/page-parachains/src/Overview/Register.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; + import BN from 'bn.js'; import React, { useMemo, useRef } from 'react'; -import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; import { Button, Dropdown, InputFile, InputNumber, InputWasm, Modal, TxButton } from '@polkadot/react-components'; import { useApi, useFormField, useModal } from '@polkadot/react-hooks'; import { BN_THOUSAND, u8aToHex, u8aToString } from '@polkadot/util'; diff --git a/packages/page-parachains/src/Overview/index.tsx b/packages/page-parachains/src/Overview/index.tsx index 22205bb701..514ed0f156 100644 --- a/packages/page-parachains/src/Overview/index.tsx +++ b/packages/page-parachains/src/Overview/index.tsx @@ -1,16 +1,17 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 -import BN from 'bn.js'; -import React from 'react'; - import type { DeriveParachain } from '@polkadot/api-derive/types'; import type { Option } from '@polkadot/types'; import type { ParachainProposal, ParaId } from '@polkadot/types/interfaces'; +import type { ProposalExt } from './types'; + +import BN from 'bn.js'; +import React from 'react'; + import { Button } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; -import type { ProposalExt } from './types'; import Transfer from '../Transfer'; import Parachains from './Parachains'; import Proposals from './Proposals'; diff --git a/packages/page-parachains/src/Parachain/Deregister.tsx b/packages/page-parachains/src/Parachain/Deregister.tsx index b544de6bb6..dc24ebc1d4 100644 --- a/packages/page-parachains/src/Parachain/Deregister.tsx +++ b/packages/page-parachains/src/Parachain/Deregister.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; +import type { DeriveParachainInfo } from '@polkadot/api-derive/types'; + import React, { useCallback, useMemo, useRef } from 'react'; -import type { DeriveParachainInfo } from '@polkadot/api-derive/types'; -import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; import { Modal, Static, TxButton } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; diff --git a/packages/page-parachains/src/Parachain/Details.tsx b/packages/page-parachains/src/Parachain/Details.tsx index 726149e0cb..8b9b107610 100644 --- a/packages/page-parachains/src/Parachain/Details.tsx +++ b/packages/page-parachains/src/Parachain/Details.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveParachainFull } from '@polkadot/api-derive/types'; +import type { Bytes, Option } from '@polkadot/types'; + import FileSaver from 'file-saver'; import React, { useCallback } from 'react'; -import type { DeriveParachainFull } from '@polkadot/api-derive/types'; -import type { Bytes, Option } from '@polkadot/types'; import { Card, IconLink, Labelled, Output, Static } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; diff --git a/packages/page-parachains/src/Parachain/DispatchQueue.tsx b/packages/page-parachains/src/Parachain/DispatchQueue.tsx index 32436a852a..f78def87f0 100644 --- a/packages/page-parachains/src/Parachain/DispatchQueue.tsx +++ b/packages/page-parachains/src/Parachain/DispatchQueue.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { UpwardMessage } from '@polkadot/types/interfaces'; + import React from 'react'; import styled from 'styled-components'; -import type { UpwardMessage } from '@polkadot/types/interfaces'; import { Card, Output } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-parachains/src/Parachain/index.tsx b/packages/page-parachains/src/Parachain/index.tsx index 9e445911fd..cc220c8c0c 100644 --- a/packages/page-parachains/src/Parachain/index.tsx +++ b/packages/page-parachains/src/Parachain/index.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveParachainFull, DeriveParachainInfo } from '@polkadot/api-derive/types'; + import React, { useCallback } from 'react'; import { useHistory, useParams } from 'react-router-dom'; import styled from 'styled-components'; -import type { DeriveParachainFull, DeriveParachainInfo } from '@polkadot/api-derive/types'; import { Button, CardSummary, Columar, Column, Icon, Menu, Popup, Spinner, SummaryBox } from '@polkadot/react-components'; import { useApi, useCall, useModal, useToggle } from '@polkadot/react-hooks'; import { isNull, isUndefined } from '@polkadot/util'; diff --git a/packages/page-parachains/src/ParachainInfo.tsx b/packages/page-parachains/src/ParachainInfo.tsx index 82cd89bb75..498aecd525 100644 --- a/packages/page-parachains/src/ParachainInfo.tsx +++ b/packages/page-parachains/src/ParachainInfo.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveParachainInfo } from '@polkadot/api-derive/types'; + import React from 'react'; -import type { DeriveParachainInfo } from '@polkadot/api-derive/types'; import { AvatarItem, Icon } from '@polkadot/react-components'; import { useTranslation } from './translate'; diff --git a/packages/page-parachains/src/Transfer.tsx b/packages/page-parachains/src/Transfer.tsx index 5b29fcc692..7a9c30262f 100644 --- a/packages/page-parachains/src/Transfer.tsx +++ b/packages/page-parachains/src/Transfer.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsic } from '@polkadot/api/types'; +import type { DeriveParachain } from '@polkadot/api-derive/types'; + import BN from 'bn.js'; import React, { useMemo, useState } from 'react'; import styled from 'styled-components'; -import type { DeriveParachain } from '@polkadot/api-derive/types'; -import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { Button, Dropdown, Input, InputAddress, InputBalance, InputNumber, Modal, Toggle, TxButton } from '@polkadot/react-components'; import { useAccounts, useApi, useToggle } from '@polkadot/react-hooks'; import { Available } from '@polkadot/react-query'; diff --git a/packages/page-parachains/src/index.tsx b/packages/page-parachains/src/index.tsx index ae25183ec1..02947f2417 100644 --- a/packages/page-parachains/src/index.tsx +++ b/packages/page-parachains/src/index.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveParachainInfo } from '@polkadot/api-derive/types'; + import React, { useMemo, useRef } from 'react'; import { matchPath, Route, Switch } from 'react-router'; import { useLocation } from 'react-router-dom'; -import type { DeriveParachainInfo } from '@polkadot/api-derive/types'; import { Tabs } from '@polkadot/react-components'; import { useApi, useSudo } from '@polkadot/react-hooks'; diff --git a/packages/page-parachains/src/translate.ts b/packages/page-parachains/src/translate.ts index ea76311db0..8850a374e1 100644 --- a/packages/page-parachains/src/translate.ts +++ b/packages/page-parachains/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/page-parachains/src/util.ts b/packages/page-parachains/src/util.ts index 44ae056a39..cae3b54241 100644 --- a/packages/page-parachains/src/util.ts +++ b/packages/page-parachains/src/util.ts @@ -1,9 +1,8 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { TFunction } from 'i18next'; - import type { DeriveParachainInfo } from '@polkadot/api-derive/types'; +import type { TFunction } from 'i18next'; export function parachainName (t: TFunction, info: DeriveParachainInfo | null): string { return info?.name || t('Unknown Chain'); diff --git a/packages/page-poll/src/index.tsx b/packages/page-poll/src/index.tsx index 41023d18d0..a9fcb749de 100644 --- a/packages/page-poll/src/index.tsx +++ b/packages/page-poll/src/index.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/app-poll authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Approvals, Balance, BlockNumber } from '@polkadot/types/interfaces'; +import type { ITuple } from '@polkadot/types/types'; + import BN from 'bn.js'; import React, { useEffect, useRef, useState } from 'react'; import { Trans } from 'react-i18next'; import styled from 'styled-components'; -import type { Approvals, Balance, BlockNumber } from '@polkadot/types/interfaces'; -import type { ITuple } from '@polkadot/types/types'; import { Button, Columar, InputAddress, Progress, Spinner, Tabs, Toggle, TxButton } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BlockToTime, FormatBalance } from '@polkadot/react-query'; diff --git a/packages/page-poll/src/translate.ts b/packages/page-poll/src/translate.ts index 71a012f610..3d94f727f9 100644 --- a/packages/page-poll/src/translate.ts +++ b/packages/page-poll/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/page-rpc/src/Rpc/Results.tsx b/packages/page-rpc/src/Rpc/Results.tsx index d827316139..0c6e84f00c 100644 --- a/packages/page-rpc/src/Rpc/Results.tsx +++ b/packages/page-rpc/src/Rpc/Results.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-rpc authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { QueueTx } from '@polkadot/react-components/Status/types'; import type { Codec } from '@polkadot/types/types'; + +import React from 'react'; + import { Output } from '@polkadot/react-components'; import { isUndefined } from '@polkadot/util'; diff --git a/packages/page-rpc/src/Rpc/Selection.tsx b/packages/page-rpc/src/Rpc/Selection.tsx index 1110ed3be9..7150278cce 100644 --- a/packages/page-rpc/src/Rpc/Selection.tsx +++ b/packages/page-rpc/src/Rpc/Selection.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-rpc authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useMemo, useState } from 'react'; - import type { QueueTxRpcAdd } from '@polkadot/react-components/Status/types'; import type { ParamDef, RawParam } from '@polkadot/react-params/types'; import type { DefinitionRpcExt } from '@polkadot/types/types'; + +import React, { useCallback, useMemo, useState } from 'react'; + import { Button, InputRpc } from '@polkadot/react-components'; import Params from '@polkadot/react-params'; import { getTypeDef } from '@polkadot/types/create'; diff --git a/packages/page-rpc/src/index.tsx b/packages/page-rpc/src/index.tsx index 219c4fc3db..e12ae9da60 100644 --- a/packages/page-rpc/src/index.tsx +++ b/packages/page-rpc/src/index.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-rpc authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AppProps as Props } from '@polkadot/react-components/types'; + import React, { useRef } from 'react'; import { Route, Switch } from 'react-router'; -import type { AppProps as Props } from '@polkadot/react-components/types'; import Tabs from '@polkadot/react-components/Tabs'; import Rpc from './Rpc'; diff --git a/packages/page-rpc/src/translate.ts b/packages/page-rpc/src/translate.ts index f84f91d6fa..9328ecdd63 100644 --- a/packages/page-rpc/src/translate.ts +++ b/packages/page-rpc/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/page-settings/src/Developer.tsx b/packages/page-settings/src/Developer.tsx index eaf95068bd..ffebc8cced 100644 --- a/packages/page-settings/src/Developer.tsx +++ b/packages/page-settings/src/Developer.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-settings authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ActionStatus } from '@polkadot/react-components/Status/types'; + import React, { useCallback, useEffect, useState } from 'react'; import { Trans } from 'react-i18next'; import store from 'store'; import styled from 'styled-components'; -import type { ActionStatus } from '@polkadot/react-components/Status/types'; import { registry } from '@polkadot/react-api'; import { Button, Editor, InputFile } from '@polkadot/react-components'; import { isJsonObject, stringToU8a, u8aToString } from '@polkadot/util'; diff --git a/packages/page-settings/src/General.tsx b/packages/page-settings/src/General.tsx index 0a697bf6e8..075062c526 100644 --- a/packages/page-settings/src/General.tsx +++ b/packages/page-settings/src/General.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-settings authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Option } from '@polkadot/apps-config/settings/types'; + import React, { useCallback, useEffect, useMemo, useState } from 'react'; -import type { Option } from '@polkadot/apps-config/settings/types'; import { createLanguages, createSs58 } from '@polkadot/apps-config'; import { isLedgerCapable } from '@polkadot/react-api'; import { Button, Dropdown } from '@polkadot/react-components'; diff --git a/packages/page-settings/src/Metadata/Extensions.tsx b/packages/page-settings/src/Metadata/Extensions.tsx index 95ad1432c5..2c6c1eaedd 100644 --- a/packages/page-settings/src/Metadata/Extensions.tsx +++ b/packages/page-settings/src/Metadata/Extensions.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/app-settings authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ChainInfo } from '../types'; + import React, { useCallback, useMemo, useState } from 'react'; import { extensionLogos } from '@polkadot/apps-config'; import { Button, Dropdown, Spinner } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; -import type { ChainInfo } from '../types'; import { useTranslation } from '../translate'; import useExtensions from '../useExtensions'; import iconOption from './iconOption'; diff --git a/packages/page-settings/src/Metadata/NetworkSpecs.tsx b/packages/page-settings/src/Metadata/NetworkSpecs.tsx index d0a08ee7a4..36147d9752 100644 --- a/packages/page-settings/src/Metadata/NetworkSpecs.tsx +++ b/packages/page-settings/src/Metadata/NetworkSpecs.tsx @@ -1,6 +1,8 @@ // Copyright 2017-2020 @polkadot/app-settings authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ChainInfo } from '../types'; + import React, { useCallback, useEffect, useReducer, useState } from 'react'; import styled from 'styled-components'; @@ -8,7 +10,6 @@ import { Button, ChainImg, Columar, Column, Input, QrNetworkSpecs, Spinner } fro import { useApi, useDebounce } from '@polkadot/react-hooks'; import { NetworkSpecsStruct } from '@polkadot/ui-settings'; -import type { ChainInfo } from '../types'; import { useTranslation } from '../translate'; import ChainColorIndicator from './ChainColorIndicator'; diff --git a/packages/page-settings/src/index.tsx b/packages/page-settings/src/index.tsx index 84c3ea5d27..48a344a62e 100644 --- a/packages/page-settings/src/index.tsx +++ b/packages/page-settings/src/index.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-settings authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AppProps as Props } from '@polkadot/react-components/types'; + import React, { useMemo } from 'react'; import { Route, Switch } from 'react-router'; -import type { AppProps as Props } from '@polkadot/react-components/types'; import { HelpOverlay, Tabs } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; diff --git a/packages/page-settings/src/translate.ts b/packages/page-settings/src/translate.ts index 527baacf7f..f8a461bb63 100644 --- a/packages/page-settings/src/translate.ts +++ b/packages/page-settings/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/page-settings/src/useChainInfo.ts b/packages/page-settings/src/useChainInfo.ts index 4a15e12026..9425219e39 100644 --- a/packages/page-settings/src/useChainInfo.ts +++ b/packages/page-settings/src/useChainInfo.ts @@ -1,6 +1,8 @@ // Copyright 2017-2020 @polkadot/app-settings authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ChainInfo } from './types'; + import { useMemo } from 'react'; import { getSystemChainColor, getSystemIcon } from '@polkadot/apps-config'; @@ -9,8 +11,6 @@ import { useApi } from '@polkadot/react-hooks'; import { getSpecTypes } from '@polkadot/types-known'; import { isNumber } from '@polkadot/util'; -import type { ChainInfo } from './types'; - export default function useChainInfo (): ChainInfo | null { const { api, isApiReady, systemChain, systemName } = useApi(); diff --git a/packages/page-settings/src/useExtensions.ts b/packages/page-settings/src/useExtensions.ts index af99c43f82..eb72076c2e 100644 --- a/packages/page-settings/src/useExtensions.ts +++ b/packages/page-settings/src/useExtensions.ts @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-settings authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { InjectedExtension, InjectedMetadataKnown, MetadataDef } from '@polkadot/extension-inject/types'; + import { useEffect, useMemo, useState } from 'react'; import store from 'store'; -import type { InjectedExtension, InjectedMetadataKnown, MetadataDef } from '@polkadot/extension-inject/types'; import { ApiPromise } from '@polkadot/api'; import { registry } from '@polkadot/react-api'; import { useApi } from '@polkadot/react-hooks'; diff --git a/packages/page-settings/src/util.tsx b/packages/page-settings/src/util.tsx index 288bcb6927..eb0414987d 100644 --- a/packages/page-settings/src/util.tsx +++ b/packages/page-settings/src/util.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-settings authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { Option } from '@polkadot/apps-config/settings/types'; import type { SettingsStruct } from '@polkadot/ui-settings/types'; + +import React from 'react'; + import { ChainImg, Dropdown, IdentityIcon } from '@polkadot/react-components'; import uiSettings from '@polkadot/ui-settings'; diff --git a/packages/page-signing/src/Sign.tsx b/packages/page-signing/src/Sign.tsx index 09c33c92e7..7aafd8fe97 100644 --- a/packages/page-signing/src/Sign.tsx +++ b/packages/page-signing/src/Sign.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-signing authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Signer } from '@polkadot/api/types'; +import type { KeyringPair } from '@polkadot/keyring/types'; + import React, { useCallback, useEffect, useState } from 'react'; import styled from 'styled-components'; -import type { Signer } from '@polkadot/api/types'; -import type { KeyringPair } from '@polkadot/keyring/types'; import { web3FromSource } from '@polkadot/extension-dapp'; import { Button, Input, InputAddress, Output, Static } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-signing/src/Unlock.tsx b/packages/page-signing/src/Unlock.tsx index eaaceb888c..a91cacc23e 100644 --- a/packages/page-signing/src/Unlock.tsx +++ b/packages/page-signing/src/Unlock.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-signing authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { KeyringPair } from '@polkadot/keyring/types'; + import React, { useCallback, useEffect, useState } from 'react'; -import type { KeyringPair } from '@polkadot/keyring/types'; import { Button, InputAddress, Modal, Password } from '@polkadot/react-components'; import { useTranslation } from './translate'; diff --git a/packages/page-signing/src/Verify.tsx b/packages/page-signing/src/Verify.tsx index 72eadfd9f9..a30f46b80c 100644 --- a/packages/page-signing/src/Verify.tsx +++ b/packages/page-signing/src/Verify.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-signing authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { KeypairType } from '@polkadot/util-crypto/types'; + import React, { useCallback, useEffect, useState } from 'react'; import styled from 'styled-components'; -import type { KeypairType } from '@polkadot/util-crypto/types'; import { Badge, Dropdown, Input, InputAddress, Static } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import keyring from '@polkadot/ui-keyring'; diff --git a/packages/page-signing/src/index.tsx b/packages/page-signing/src/index.tsx index 14b8703781..6fd24311f1 100644 --- a/packages/page-signing/src/index.tsx +++ b/packages/page-signing/src/index.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-signing authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AppProps as Props } from '@polkadot/react-components/types'; + import React, { useRef } from 'react'; import { Route, Switch } from 'react-router'; -import type { AppProps as Props } from '@polkadot/react-components/types'; import Tabs from '@polkadot/react-components/Tabs'; import Hash from './Hash'; diff --git a/packages/page-signing/src/translate.ts b/packages/page-signing/src/translate.ts index b3319c2c45..f4c0ee3513 100644 --- a/packages/page-signing/src/translate.ts +++ b/packages/page-signing/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/page-society/src/Overview/Bid.tsx b/packages/page-society/src/Overview/Bid.tsx index eaddb2fd55..0b9ee1267f 100644 --- a/packages/page-society/src/Overview/Bid.tsx +++ b/packages/page-society/src/Overview/Bid.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-society authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Bid } from '@polkadot/types/interfaces'; + import React, { useEffect, useState } from 'react'; -import type { Bid } from '@polkadot/types/interfaces'; import { AddressSmall, TxButton } from '@polkadot/react-components'; import { useAccounts } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; diff --git a/packages/page-society/src/Overview/Bids.tsx b/packages/page-society/src/Overview/Bids.tsx index b1710ef61b..accfa790dc 100644 --- a/packages/page-society/src/Overview/Bids.tsx +++ b/packages/page-society/src/Overview/Bids.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-society authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Bid } from '@polkadot/types/interfaces'; + import React, { useRef } from 'react'; -import type { Bid } from '@polkadot/types/interfaces'; import { Table } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-society/src/Overview/Candidate.tsx b/packages/page-society/src/Overview/Candidate.tsx index 999eb155d8..0234931412 100644 --- a/packages/page-society/src/Overview/Candidate.tsx +++ b/packages/page-society/src/Overview/Candidate.tsx @@ -1,16 +1,17 @@ // Copyright 2017-2020 @polkadot/app-society authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { DeriveSocietyCandidate } from '@polkadot/api-derive/types'; import type { Option } from '@polkadot/types'; import type { AccountId, SocietyVote } from '@polkadot/types/interfaces'; +import type { VoteType } from '../types'; + +import React from 'react'; + import { AddressSmall } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; -import type { VoteType } from '../types'; import CandidateVoting from './CandidateVoting'; import Votes from './Votes'; diff --git a/packages/page-society/src/Overview/Candidates.tsx b/packages/page-society/src/Overview/Candidates.tsx index 313a077dea..253319a7b7 100644 --- a/packages/page-society/src/Overview/Candidates.tsx +++ b/packages/page-society/src/Overview/Candidates.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-society authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveSocietyCandidate } from '@polkadot/api-derive/types'; + import React, { useRef } from 'react'; -import type { DeriveSocietyCandidate } from '@polkadot/api-derive/types'; import { Table } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-society/src/Overview/Defender.tsx b/packages/page-society/src/Overview/Defender.tsx index 31ce66a2ca..a9e887a1d1 100644 --- a/packages/page-society/src/Overview/Defender.tsx +++ b/packages/page-society/src/Overview/Defender.tsx @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/app-society authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useRef } from 'react'; - import type { DeriveSociety, DeriveSocietyMember } from '@polkadot/api-derive/types'; import type { SocietyVote } from '@polkadot/types/interfaces'; +import type { VoteType } from '../types'; + +import React, { useRef } from 'react'; + import { AddressSmall, Table } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; -import type { VoteType } from '../types'; import { useTranslation } from '../translate'; import DefenderVoting from './DefenderVoting'; import Votes from './Votes'; diff --git a/packages/page-society/src/Overview/Member.tsx b/packages/page-society/src/Overview/Member.tsx index cae5b2daa5..381e910237 100644 --- a/packages/page-society/src/Overview/Member.tsx +++ b/packages/page-society/src/Overview/Member.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-society authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveSocietyMember } from '@polkadot/api-derive/types'; + import React, { useEffect, useRef, useState } from 'react'; -import type { DeriveSocietyMember } from '@polkadot/api-derive/types'; import { AddressSmall, Icon, Modal, Tag } from '@polkadot/react-components'; import { useApi, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-society/src/Overview/Members.tsx b/packages/page-society/src/Overview/Members.tsx index 11640ccfa4..89c16d0bff 100644 --- a/packages/page-society/src/Overview/Members.tsx +++ b/packages/page-society/src/Overview/Members.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-society authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveSociety, DeriveSocietyMember } from '@polkadot/api-derive/types'; + import React, { useMemo, useRef } from 'react'; -import type { DeriveSociety, DeriveSocietyMember } from '@polkadot/api-derive/types'; import { Table } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-society/src/Overview/Summary.tsx b/packages/page-society/src/Overview/Summary.tsx index b0f24f87c5..dfcdd83c80 100644 --- a/packages/page-society/src/Overview/Summary.tsx +++ b/packages/page-society/src/Overview/Summary.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-society authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveSociety } from '@polkadot/api-derive/types'; +import type { BlockNumber } from '@polkadot/types/interfaces'; + import React, { useMemo } from 'react'; import styled from 'styled-components'; -import type { DeriveSociety } from '@polkadot/api-derive/types'; -import type { BlockNumber } from '@polkadot/types/interfaces'; import { CardSummary, SummaryBox } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; diff --git a/packages/page-society/src/Overview/Votes.tsx b/packages/page-society/src/Overview/Votes.tsx index 1c22332b1a..85efd849e4 100644 --- a/packages/page-society/src/Overview/Votes.tsx +++ b/packages/page-society/src/Overview/Votes.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-society authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { VoteSplit, VoteType } from '../types'; + import React, { useEffect, useState } from 'react'; -import type { VoteSplit, VoteType } from '../types'; import { useTranslation } from '../translate'; import VotesExpander from './VotesExpander'; diff --git a/packages/page-society/src/Overview/VotesExpander.tsx b/packages/page-society/src/Overview/VotesExpander.tsx index fb1f34bca2..e0efdac2b2 100644 --- a/packages/page-society/src/Overview/VotesExpander.tsx +++ b/packages/page-society/src/Overview/VotesExpander.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-society authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { VoteType } from '../types'; + import React from 'react'; import { AddressMini, Expander } from '@polkadot/react-components'; -import type { VoteType } from '../types'; - interface Props { label: string; votes: VoteType[]; diff --git a/packages/page-society/src/Overview/index.tsx b/packages/page-society/src/Overview/index.tsx index a097156951..b1ed77a702 100644 --- a/packages/page-society/src/Overview/index.tsx +++ b/packages/page-society/src/Overview/index.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-society authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveSociety } from '@polkadot/api-derive/types'; + import React from 'react'; import styled from 'styled-components'; -import type { DeriveSociety } from '@polkadot/api-derive/types'; import { Button } from '@polkadot/react-components'; import { useApi, useCall, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-society/src/translate.ts b/packages/page-society/src/translate.ts index 84047d3c8b..06ff9a3d4e 100644 --- a/packages/page-society/src/translate.ts +++ b/packages/page-society/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/page-society/src/useCounter.ts b/packages/page-society/src/useCounter.ts index 6fb954a1d6..46c8fb2a62 100644 --- a/packages/page-society/src/useCounter.ts +++ b/packages/page-society/src/useCounter.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Bid } from '@polkadot/types/interfaces'; + import { useApi, useCall } from '@polkadot/react-hooks'; export default function useCounter (): number { diff --git a/packages/page-society/src/useMembers.ts b/packages/page-society/src/useMembers.ts index a584c20291..f4a126b5c7 100644 --- a/packages/page-society/src/useMembers.ts +++ b/packages/page-society/src/useMembers.ts @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/app-society authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveSocietyMember } from '@polkadot/api-derive/types'; +import type { OwnMembers } from './types'; + import { useEffect, useState } from 'react'; -import type { DeriveSocietyMember } from '@polkadot/api-derive/types'; import { useAccounts, useApi, useCall } from '@polkadot/react-hooks'; -import type { OwnMembers } from './types'; - function transform (allAccounts: string[], members: DeriveSocietyMember[]): OwnMembers { const allMembers = members .filter((member): boolean => !member.isSuspended) diff --git a/packages/page-staking/src/Actions/Account/BondExtra.tsx b/packages/page-staking/src/Actions/Account/BondExtra.tsx index fb27195063..993c489211 100644 --- a/packages/page-staking/src/Actions/Account/BondExtra.tsx +++ b/packages/page-staking/src/Actions/Account/BondExtra.tsx @@ -1,17 +1,18 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveBalancesAll, DeriveStakingAccount } from '@polkadot/api-derive/types'; +import type { AmountValidateState } from '../types'; + import BN from 'bn.js'; import React, { useMemo, useState } from 'react'; -import type { DeriveBalancesAll, DeriveStakingAccount } from '@polkadot/api-derive/types'; import { ApiPromise } from '@polkadot/api'; import { InputAddress, InputBalance, Modal, TxButton } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BalanceFree } from '@polkadot/react-query'; import { BN_ZERO } from '@polkadot/util'; -import type { AmountValidateState } from '../types'; import { useTranslation } from '../../translate'; import ValidateAmount from './InputValidateAmount'; diff --git a/packages/page-staking/src/Actions/Account/InjectKeys.tsx b/packages/page-staking/src/Actions/Account/InjectKeys.tsx index 8601261cd1..ec84e98481 100644 --- a/packages/page-staking/src/Actions/Account/InjectKeys.tsx +++ b/packages/page-staking/src/Actions/Account/InjectKeys.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { KeypairType } from '@polkadot/util-crypto/types'; + import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react'; -import type { KeypairType } from '@polkadot/util-crypto/types'; import { Button, Dropdown, Input, Modal, StatusContext } from '@polkadot/react-components'; import keyring from '@polkadot/ui-keyring'; import { assert, u8aToHex } from '@polkadot/util'; diff --git a/packages/page-staking/src/Actions/Account/InputValidateAmount.tsx b/packages/page-staking/src/Actions/Account/InputValidateAmount.tsx index 6d8225dd55..e28c0430c6 100644 --- a/packages/page-staking/src/Actions/Account/InputValidateAmount.tsx +++ b/packages/page-staking/src/Actions/Account/InputValidateAmount.tsx @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; +import type { AmountValidateState } from '../types'; + import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; -import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BN_TEN, BN_THOUSAND, BN_ZERO, formatBalance } from '@polkadot/util'; -import type { AmountValidateState } from '../types'; import { useTranslation } from '../../translate'; interface Props { diff --git a/packages/page-staking/src/Actions/Account/InputValidationController.tsx b/packages/page-staking/src/Actions/Account/InputValidationController.tsx index e5fd52194d..de1c16bccf 100644 --- a/packages/page-staking/src/Actions/Account/InputValidationController.tsx +++ b/packages/page-staking/src/Actions/Account/InputValidationController.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useEffect, useState } from 'react'; - import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; import type { Option } from '@polkadot/types'; import type { AccountId, StakingLedger } from '@polkadot/types/interfaces'; + +import React, { useEffect, useState } from 'react'; + import { useApi, useCall } from '@polkadot/react-hooks'; import { useTranslation } from '../../translate'; diff --git a/packages/page-staking/src/Actions/Account/InputValidationSessionKey.tsx b/packages/page-staking/src/Actions/Account/InputValidationSessionKey.tsx index 9f19390d1d..ed7266feda 100644 --- a/packages/page-staking/src/Actions/Account/InputValidationSessionKey.tsx +++ b/packages/page-staking/src/Actions/Account/InputValidationSessionKey.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useEffect, useState } from 'react'; - import type { I18nProps } from '@polkadot/react-components/types'; +import React, { useEffect, useState } from 'react'; + import { useTranslation } from '../../translate'; interface Props extends I18nProps { diff --git a/packages/page-staking/src/Actions/Account/ListNominees.tsx b/packages/page-staking/src/Actions/Account/ListNominees.tsx index 5d9e0a5cbb..50e7013149 100644 --- a/packages/page-staking/src/Actions/Account/ListNominees.tsx +++ b/packages/page-staking/src/Actions/Account/ListNominees.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveEraExposure, DeriveSessionIndexes } from '@polkadot/api-derive/types'; + import BN from 'bn.js'; import React, { useMemo } from 'react'; -import type { DeriveEraExposure, DeriveSessionIndexes } from '@polkadot/api-derive/types'; import { AddressMini, Expander } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-staking/src/Actions/Account/Nominate.tsx b/packages/page-staking/src/Actions/Account/Nominate.tsx index 5e9e82d441..991ccbcbea 100644 --- a/packages/page-staking/src/Actions/Account/Nominate.tsx +++ b/packages/page-staking/src/Actions/Account/Nominate.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SortedTargets } from '../../types'; +import type { NominateInfo } from '../partials/types'; + import React, { useState } from 'react'; import styled from 'styled-components'; import { Modal, TxButton } from '@polkadot/react-components'; -import type { SortedTargets } from '../../types'; -import type { NominateInfo } from '../partials/types'; import { useTranslation } from '../../translate'; import NominatePartial from '../partials/Nominate'; diff --git a/packages/page-staking/src/Actions/Account/SetRewardDestination.tsx b/packages/page-staking/src/Actions/Account/SetRewardDestination.tsx index a6b57015db..be3db76c1e 100644 --- a/packages/page-staking/src/Actions/Account/SetRewardDestination.tsx +++ b/packages/page-staking/src/Actions/Account/SetRewardDestination.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { RewardDestination } from '@polkadot/types/interfaces'; +import type { DestinationType } from '../types'; + import React, { useMemo, useState } from 'react'; -import type { RewardDestination } from '@polkadot/types/interfaces'; import { Dropdown, InputAddress, Modal, TxButton } from '@polkadot/react-components'; -import type { DestinationType } from '../types'; import { useTranslation } from '../../translate'; import { createDestCurr } from '../destOptions'; diff --git a/packages/page-staking/src/Actions/Account/SetSessionKey.tsx b/packages/page-staking/src/Actions/Account/SetSessionKey.tsx index 4946777c57..e775df840d 100644 --- a/packages/page-staking/src/Actions/Account/SetSessionKey.tsx +++ b/packages/page-staking/src/Actions/Account/SetSessionKey.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SessionInfo } from '../partials/types'; + import React, { useState } from 'react'; import { Modal, TxButton } from '@polkadot/react-components'; -import type { SessionInfo } from '../partials/types'; import { useTranslation } from '../../translate'; import SessionKeyPartital from '../partials/SessionKey'; diff --git a/packages/page-staking/src/Actions/Account/Unbond.tsx b/packages/page-staking/src/Actions/Account/Unbond.tsx index a111a1cbe6..bfa3e4a2b7 100644 --- a/packages/page-staking/src/Actions/Account/Unbond.tsx +++ b/packages/page-staking/src/Actions/Account/Unbond.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AccountId, StakingLedger } from '@polkadot/types/interfaces'; + import BN from 'bn.js'; import React, { useState } from 'react'; import styled from 'styled-components'; -import type { AccountId, StakingLedger } from '@polkadot/types/interfaces'; import { InputAddress, InputBalance, Modal, Static, Toggle, TxButton } from '@polkadot/react-components'; import { BlockToTime } from '@polkadot/react-query'; diff --git a/packages/page-staking/src/Actions/Account/Validate.tsx b/packages/page-staking/src/Actions/Account/Validate.tsx index 9d662e9846..bf6a80a8ff 100644 --- a/packages/page-staking/src/Actions/Account/Validate.tsx +++ b/packages/page-staking/src/Actions/Account/Validate.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ValidateInfo } from '../partials/types'; + import React, { useState } from 'react'; import { Modal, TxButton } from '@polkadot/react-components'; -import type { ValidateInfo } from '../partials/types'; import { useTranslation } from '../../translate'; import ValidatePartial from '../partials/Validate'; diff --git a/packages/page-staking/src/Actions/Account/index.tsx b/packages/page-staking/src/Actions/Account/index.tsx index febb89fa39..2bf198d9ab 100644 --- a/packages/page-staking/src/Actions/Account/index.tsx +++ b/packages/page-staking/src/Actions/Account/index.tsx @@ -1,21 +1,22 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import BN from 'bn.js'; -import React, { useCallback, useContext, useMemo } from 'react'; -import styled from 'styled-components'; - import type { DeriveBalancesAll, DeriveStakingAccount } from '@polkadot/api-derive/types'; import type { StakerState } from '@polkadot/react-hooks/types'; import type { Option } from '@polkadot/types'; import type { SlashingSpans, UnappliedSlash } from '@polkadot/types/interfaces'; +import type { SortedTargets } from '../../types'; +import type { Slash } from '../types'; + +import BN from 'bn.js'; +import React, { useCallback, useContext, useMemo } from 'react'; +import styled from 'styled-components'; + import { ApiPromise } from '@polkadot/api'; import { AddressInfo, AddressMini, AddressSmall, Badge, Button, Menu, Popup, StakingBonded, StakingRedeemable, StakingUnbonding, StatusContext, TxButton } from '@polkadot/react-components'; import { useApi, useCall, useToggle } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; -import type { SortedTargets } from '../../types'; -import type { Slash } from '../types'; import { useTranslation } from '../../translate'; import BondExtra from './BondExtra'; import InjectKeys from './InjectKeys'; diff --git a/packages/page-staking/src/Actions/NewNominator.tsx b/packages/page-staking/src/Actions/NewNominator.tsx index 89799f7889..d678b7dddb 100644 --- a/packages/page-staking/src/Actions/NewNominator.tsx +++ b/packages/page-staking/src/Actions/NewNominator.tsx @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SortedTargets } from '../types'; +import type { BondInfo, NominateInfo } from './partials/types'; + import React, { useCallback, useState } from 'react'; import { Button, Modal, TxButton } from '@polkadot/react-components'; import { useApi, useToggle } from '@polkadot/react-hooks'; import { isFunction } from '@polkadot/util'; -import type { SortedTargets } from '../types'; -import type { BondInfo, NominateInfo } from './partials/types'; import { useTranslation } from '../translate'; import BondPartial from './partials/Bond'; import NominatePartial from './partials/Nominate'; diff --git a/packages/page-staking/src/Actions/NewStash.tsx b/packages/page-staking/src/Actions/NewStash.tsx index e5537a55e3..30a32b9cc2 100644 --- a/packages/page-staking/src/Actions/NewStash.tsx +++ b/packages/page-staking/src/Actions/NewStash.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { BondInfo } from './partials/types'; + import React, { useCallback, useState } from 'react'; import { Button, Modal, TxButton } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; -import type { BondInfo } from './partials/types'; import { useTranslation } from '../translate'; import BondPartial from './partials/Bond'; diff --git a/packages/page-staking/src/Actions/NewValidator.tsx b/packages/page-staking/src/Actions/NewValidator.tsx index ebde4b5494..7bf09fbb9e 100644 --- a/packages/page-staking/src/Actions/NewValidator.tsx +++ b/packages/page-staking/src/Actions/NewValidator.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { BondInfo, SessionInfo, ValidateInfo } from './partials/types'; + import React, { useCallback, useState } from 'react'; import { Button, Modal, TxButton } from '@polkadot/react-components'; import { useApi, useToggle } from '@polkadot/react-hooks'; import { isFunction } from '@polkadot/util'; -import type { BondInfo, SessionInfo, ValidateInfo } from './partials/types'; import { useTranslation } from '../translate'; import BondPartial from './partials/Bond'; import SessionKeyPartial from './partials/SessionKey'; diff --git a/packages/page-staking/src/Actions/index.tsx b/packages/page-staking/src/Actions/index.tsx index c410be7fdc..89ce17eab7 100644 --- a/packages/page-staking/src/Actions/index.tsx +++ b/packages/page-staking/src/Actions/index.tsx @@ -1,16 +1,17 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { StakerState } from '@polkadot/react-hooks/types'; +import type { SortedTargets } from '../types'; + import BN from 'bn.js'; import React, { useMemo, useRef, useState } from 'react'; -import type { StakerState } from '@polkadot/react-hooks/types'; import { Button, Table, ToggleGroup } from '@polkadot/react-components'; import { useAvailableSlashes } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; import { BN_ZERO } from '@polkadot/util'; -import type { SortedTargets } from '../types'; import ElectionBanner from '../ElectionBanner'; import { useTranslation } from '../translate'; import Account from './Account'; diff --git a/packages/page-staking/src/Actions/partials/Bond.tsx b/packages/page-staking/src/Actions/partials/Bond.tsx index 8811c91205..c204ba9047 100644 --- a/packages/page-staking/src/Actions/partials/Bond.tsx +++ b/packages/page-staking/src/Actions/partials/Bond.tsx @@ -1,17 +1,18 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; +import type { AmountValidateState, DestinationType } from '../types'; +import type { BondInfo } from './types'; + import BN from 'bn.js'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; -import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; import { Dropdown, InputAddress, InputBalance, Modal, Static } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BalanceFree, BlockToTime } from '@polkadot/react-query'; import { BN_ZERO } from '@polkadot/util'; -import type { AmountValidateState, DestinationType } from '../types'; -import type { BondInfo } from './types'; import { useTranslation } from '../../translate'; import InputValidateAmount from '../Account/InputValidateAmount'; import InputValidationController from '../Account/InputValidationController'; diff --git a/packages/page-staking/src/Actions/partials/Nominate.tsx b/packages/page-staking/src/Actions/partials/Nominate.tsx index 2d6fa2c8ee..db7fbf5272 100644 --- a/packages/page-staking/src/Actions/partials/Nominate.tsx +++ b/packages/page-staking/src/Actions/partials/Nominate.tsx @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SortedTargets } from '../../types'; +import type { NominateInfo } from './types'; + import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; import { InputAddress, InputAddressMulti, Modal } from '@polkadot/react-components'; import { useApi, useFavorites } from '@polkadot/react-hooks'; -import type { SortedTargets } from '../../types'; -import type { NominateInfo } from './types'; import { MAX_NOMINATIONS, STORE_FAVS_BASE } from '../../constants'; import { useTranslation } from '../../translate'; diff --git a/packages/page-staking/src/Actions/partials/SessionKey.tsx b/packages/page-staking/src/Actions/partials/SessionKey.tsx index a2dc55bf49..26bd22a353 100644 --- a/packages/page-staking/src/Actions/partials/SessionKey.tsx +++ b/packages/page-staking/src/Actions/partials/SessionKey.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SessionInfo } from './types'; + import React, { useEffect, useState } from 'react'; import { Input, InputAddress, Modal } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import { isHex } from '@polkadot/util'; -import type { SessionInfo } from './types'; import { useTranslation } from '../../translate'; interface Props { diff --git a/packages/page-staking/src/Actions/partials/Validate.tsx b/packages/page-staking/src/Actions/partials/Validate.tsx index 29626caa03..04831ff8fb 100644 --- a/packages/page-staking/src/Actions/partials/Validate.tsx +++ b/packages/page-staking/src/Actions/partials/Validate.tsx @@ -1,6 +1,8 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ValidateInfo } from './types'; + import BN from 'bn.js'; import React, { useCallback } from 'react'; @@ -8,7 +10,6 @@ import { InputAddress, InputNumber, Modal } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import { BN_HUNDRED as MAX_COMM, BN_ZERO } from '@polkadot/util'; -import type { ValidateInfo } from './types'; import { useTranslation } from '../../translate'; interface Props { diff --git a/packages/page-staking/src/Actions/types.ts b/packages/page-staking/src/Actions/types.ts index b94c5e3ad0..59c989bff6 100644 --- a/packages/page-staking/src/Actions/types.ts +++ b/packages/page-staking/src/Actions/types.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import BN from 'bn.js'; - import type { AccountId, Balance, UnappliedSlashOther } from '@polkadot/types/interfaces'; +import BN from 'bn.js'; + export interface AmountValidateState { error: string | null; warning: string | null; diff --git a/packages/page-staking/src/Actions/useInactives.ts b/packages/page-staking/src/Actions/useInactives.ts index 965d96ad50..c89ad3013f 100644 --- a/packages/page-staking/src/Actions/useInactives.ts +++ b/packages/page-staking/src/Actions/useInactives.ts @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { useEffect, useState } from 'react'; - import type { DeriveSessionIndexes } from '@polkadot/api-derive/types'; import type { Option } from '@polkadot/types'; import type { EraIndex, Exposure, Nominations, SlashingSpans } from '@polkadot/types/interfaces'; + +import { useEffect, useState } from 'react'; + import { ApiPromise } from '@polkadot/api'; import { useApi, useCall, useIsMountedRef } from '@polkadot/react-hooks'; diff --git a/packages/page-staking/src/Actions/useUnbondDuration.ts b/packages/page-staking/src/Actions/useUnbondDuration.ts index 8de52e16e3..a407b3c075 100644 --- a/packages/page-staking/src/Actions/useUnbondDuration.ts +++ b/packages/page-staking/src/Actions/useUnbondDuration.ts @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveSessionInfo } from '@polkadot/api-derive/types'; + import BN from 'bn.js'; import { useMemo } from 'react'; -import type { DeriveSessionInfo } from '@polkadot/api-derive/types'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BN_ONE } from '@polkadot/util'; diff --git a/packages/page-staking/src/Overview/Address/NominatedBy.tsx b/packages/page-staking/src/Overview/Address/NominatedBy.tsx index d3799384fb..fd10b41e2a 100644 --- a/packages/page-staking/src/Overview/Address/NominatedBy.tsx +++ b/packages/page-staking/src/Overview/Address/NominatedBy.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SlashingSpans } from '@polkadot/types/interfaces'; +import type { NominatedBy as NominatedByType } from '../../types'; + import React, { useMemo } from 'react'; -import type { SlashingSpans } from '@polkadot/types/interfaces'; import { AddressMini, Expander } from '@polkadot/react-components'; import { formatNumber } from '@polkadot/util'; -import type { NominatedBy as NominatedByType } from '../../types'; import { useTranslation } from '../../translate'; interface Props { diff --git a/packages/page-staking/src/Overview/Address/StakeOther.tsx b/packages/page-staking/src/Overview/Address/StakeOther.tsx index 21785e3a9f..2e1c5ab61b 100644 --- a/packages/page-staking/src/Overview/Address/StakeOther.tsx +++ b/packages/page-staking/src/Overview/Address/StakeOther.tsx @@ -1,6 +1,8 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { NominatorValue } from './types'; + import BN from 'bn.js'; import React, { useMemo } from 'react'; @@ -9,8 +11,6 @@ import { useApi } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; import { BN_ZERO } from '@polkadot/util'; -import type { NominatorValue } from './types'; - interface Props { stakeOther?: BN; nominators: NominatorValue[]; diff --git a/packages/page-staking/src/Overview/Address/index.tsx b/packages/page-staking/src/Overview/Address/index.tsx index c4e3132b3b..6c7e656831 100644 --- a/packages/page-staking/src/Overview/Address/index.tsx +++ b/packages/page-staking/src/Overview/Address/index.tsx @@ -1,20 +1,21 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import BN from 'bn.js'; -import React, { useCallback, useMemo } from 'react'; - import type { DeriveAccountInfo } from '@polkadot/api-derive/types'; import type { Option } from '@polkadot/types'; import type { SlashingSpans, ValidatorPrefs } from '@polkadot/types/interfaces'; +import type { NominatedBy as NominatedByType, ValidatorInfo } from '../../types'; +import type { NominatorValue } from './types'; + +import BN from 'bn.js'; +import React, { useCallback, useMemo } from 'react'; + import { ApiPromise } from '@polkadot/api'; import { AddressSmall, Icon, LinkExternal } from '@polkadot/react-components'; import { checkVisibility } from '@polkadot/react-components/util'; import { useApi, useCall } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; -import type { NominatedBy as NominatedByType, ValidatorInfo } from '../../types'; -import type { NominatorValue } from './types'; import Favorite from './Favorite'; import NominatedBy from './NominatedBy'; import StakeOther from './StakeOther'; diff --git a/packages/page-staking/src/Overview/CurrentList.tsx b/packages/page-staking/src/Overview/CurrentList.tsx index 329cefdc41..c0a7bbcc60 100644 --- a/packages/page-staking/src/Overview/CurrentList.tsx +++ b/packages/page-staking/src/Overview/CurrentList.tsx @@ -1,16 +1,17 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useContext, useMemo, useRef, useState } from 'react'; - import type { DeriveHeartbeats, DeriveStakingOverview } from '@polkadot/api-derive/types'; import type { Authors } from '@polkadot/react-query/BlockAuthors'; import type { AccountId } from '@polkadot/types/interfaces'; +import type { SortedTargets, ValidatorInfo } from '../types'; + +import React, { useCallback, useContext, useMemo, useRef, useState } from 'react'; + import { Table } from '@polkadot/react-components'; import { useApi, useCall, useLoadingDelay } from '@polkadot/react-hooks'; import { BlockAuthorsContext } from '@polkadot/react-query'; -import type { SortedTargets, ValidatorInfo } from '../types'; import Filtering from '../Filtering'; import Legend from '../Legend'; import { useTranslation } from '../translate'; diff --git a/packages/page-staking/src/Overview/Summary.tsx b/packages/page-staking/src/Overview/Summary.tsx index 2795a92ef5..9485216949 100644 --- a/packages/page-staking/src/Overview/Summary.tsx +++ b/packages/page-staking/src/Overview/Summary.tsx @@ -1,15 +1,16 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveStakingOverview } from '@polkadot/api-derive/types'; +import type { SortedTargets } from '../types'; + import React, { useContext } from 'react'; import styled from 'styled-components'; -import type { DeriveStakingOverview } from '@polkadot/api-derive/types'; import SummarySession from '@polkadot/app-explorer/SummarySession'; import { CardSummary, IdentityIcon, SummaryBox } from '@polkadot/react-components'; import { BlockAuthorsContext } from '@polkadot/react-query'; -import type { SortedTargets } from '../types'; import { useTranslation } from '../translate'; interface Props { diff --git a/packages/page-staking/src/Overview/index.tsx b/packages/page-staking/src/Overview/index.tsx index c4e8343ec2..c3a64810d6 100644 --- a/packages/page-staking/src/Overview/index.tsx +++ b/packages/page-staking/src/Overview/index.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveStakingOverview } from '@polkadot/api-derive/types'; +import type { SortedTargets } from '../types'; + import React from 'react'; -import type { DeriveStakingOverview } from '@polkadot/api-derive/types'; - -import type { SortedTargets } from '../types'; import CurrentList from './CurrentList'; interface Props { diff --git a/packages/page-staking/src/Payouts/PayButton.tsx b/packages/page-staking/src/Payouts/PayButton.tsx index 1577299d79..c875325f47 100644 --- a/packages/page-staking/src/Payouts/PayButton.tsx +++ b/packages/page-staking/src/Payouts/PayButton.tsx @@ -1,16 +1,17 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsic } from '@polkadot/api/types'; +import type { EraIndex } from '@polkadot/types/interfaces'; +import type { PayoutValidator } from './types'; + import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; -import type { SubmittableExtrinsic } from '@polkadot/api/types'; -import type { EraIndex } from '@polkadot/types/interfaces'; import { ApiPromise } from '@polkadot/api'; import { AddressMini, Button, InputAddress, Modal, Static, TxButton } from '@polkadot/react-components'; import { useAccounts, useApi, useToggle } from '@polkadot/react-hooks'; -import type { PayoutValidator } from './types'; import { useTranslation } from '../translate'; interface Props { diff --git a/packages/page-staking/src/Payouts/Stash.tsx b/packages/page-staking/src/Payouts/Stash.tsx index 545b938c04..885e3ce134 100644 --- a/packages/page-staking/src/Payouts/Stash.tsx +++ b/packages/page-staking/src/Payouts/Stash.tsx @@ -1,17 +1,18 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsic } from '@polkadot/api/types'; +import type { DeriveStakerReward, DeriveStakingAccount } from '@polkadot/api-derive/types'; +import type { PayoutStash } from './types'; + import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; -import type { DeriveStakerReward, DeriveStakingAccount } from '@polkadot/api-derive/types'; -import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { ApiPromise } from '@polkadot/api'; import { AddressSmall, TxButton } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BlockToTime, FormatBalance } from '@polkadot/react-query'; -import type { PayoutStash } from './types'; import { useTranslation } from '../translate'; import useEraBlocks from './useEraBlocks'; import { createErasString } from './util'; diff --git a/packages/page-staking/src/Payouts/Validator.tsx b/packages/page-staking/src/Payouts/Validator.tsx index fd5a26adeb..25038281f0 100644 --- a/packages/page-staking/src/Payouts/Validator.tsx +++ b/packages/page-staking/src/Payouts/Validator.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { PayoutValidator } from './types'; + import BN from 'bn.js'; import React, { useMemo } from 'react'; import { AddressMini, AddressSmall, Expander } from '@polkadot/react-components'; import { BlockToTime, FormatBalance } from '@polkadot/react-query'; -import type { PayoutValidator } from './types'; import { useTranslation } from '../translate'; import PayButton from './PayButton'; import useEraBlocks from './useEraBlocks'; diff --git a/packages/page-staking/src/Payouts/index.tsx b/packages/page-staking/src/Payouts/index.tsx index 3e35c31277..b4f72ccd20 100644 --- a/packages/page-staking/src/Payouts/index.tsx +++ b/packages/page-staking/src/Payouts/index.tsx @@ -1,20 +1,21 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveStakerReward } from '@polkadot/api-derive/types'; +import type { StakerState } from '@polkadot/react-hooks/types'; import type { TFunction } from 'i18next'; +import type { PayoutStash, PayoutValidator } from './types'; + import BN from 'bn.js'; import React, { useMemo, useRef, useState } from 'react'; import styled from 'styled-components'; -import type { DeriveStakerReward } from '@polkadot/api-derive/types'; -import type { StakerState } from '@polkadot/react-hooks/types'; import { ApiPromise } from '@polkadot/api'; import { Button, Table, ToggleGroup } from '@polkadot/react-components'; import { useApi, useCall, useOwnEraRewards } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; import { BN_ZERO, isFunction } from '@polkadot/util'; -import type { PayoutStash, PayoutValidator } from './types'; import ElectionBanner from '../ElectionBanner'; import { useTranslation } from '../translate'; import PayButton from './PayButton'; diff --git a/packages/page-staking/src/Payouts/types.ts b/packages/page-staking/src/Payouts/types.ts index 584401f419..e993b84c4f 100644 --- a/packages/page-staking/src/Payouts/types.ts +++ b/packages/page-staking/src/Payouts/types.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import BN from 'bn.js'; - import type { DeriveStakerReward } from '@polkadot/api-derive/types'; import type { Balance, EraIndex } from '@polkadot/types/interfaces'; +import BN from 'bn.js'; + export interface PayoutEraValidator { era: EraIndex; stashes: Record; diff --git a/packages/page-staking/src/Payouts/useEraBlocks.ts b/packages/page-staking/src/Payouts/useEraBlocks.ts index 9cf57b2db2..c64836dfdb 100644 --- a/packages/page-staking/src/Payouts/useEraBlocks.ts +++ b/packages/page-staking/src/Payouts/useEraBlocks.ts @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveSessionProgress } from '@polkadot/api-derive/types'; +import type { Forcing } from '@polkadot/types/interfaces'; + import BN from 'bn.js'; import { useMemo } from 'react'; -import type { DeriveSessionProgress } from '@polkadot/api-derive/types'; -import type { Forcing } from '@polkadot/types/interfaces'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BN_ONE } from '@polkadot/util'; diff --git a/packages/page-staking/src/Payouts/useStakerPayouts.ts b/packages/page-staking/src/Payouts/useStakerPayouts.ts index 7a1d08549a..03460727b0 100644 --- a/packages/page-staking/src/Payouts/useStakerPayouts.ts +++ b/packages/page-staking/src/Payouts/useStakerPayouts.ts @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Option } from '@polkadot/types'; +import type { EraIndex } from '@polkadot/types/interfaces'; + import BN from 'bn.js'; import { useMemo } from 'react'; -import type { Option } from '@polkadot/types'; -import type { EraIndex } from '@polkadot/types/interfaces'; import { useApi, useCall } from '@polkadot/react-hooks'; import { isFunction } from '@polkadot/util'; diff --git a/packages/page-staking/src/Query/ChartPoints.tsx b/packages/page-staking/src/Query/ChartPoints.tsx index 35c7cadec5..c14ca81d2d 100644 --- a/packages/page-staking/src/Query/ChartPoints.tsx +++ b/packages/page-staking/src/Query/ChartPoints.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveStakerPoints } from '@polkadot/api-derive/types'; +import type { ChartInfo, LineDataEntry, Props } from './types'; + import React, { useMemo, useRef } from 'react'; -import type { DeriveStakerPoints } from '@polkadot/api-derive/types'; import { Chart, Spinner } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; -import type { ChartInfo, LineDataEntry, Props } from './types'; import { useTranslation } from '../translate'; const COLORS_POINTS = [undefined, '#acacac']; diff --git a/packages/page-staking/src/Query/ChartPrefs.tsx b/packages/page-staking/src/Query/ChartPrefs.tsx index c5db39aa2b..fc61d03327 100644 --- a/packages/page-staking/src/Query/ChartPrefs.tsx +++ b/packages/page-staking/src/Query/ChartPrefs.tsx @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveStakerPrefs } from '@polkadot/api-derive/types'; +import type { ChartInfo, LineDataEntry, Props } from './types'; + import BN from 'bn.js'; import React, { useMemo, useRef } from 'react'; -import type { DeriveStakerPrefs } from '@polkadot/api-derive/types'; import { Chart, Spinner } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; -import type { ChartInfo, LineDataEntry, Props } from './types'; import { useTranslation } from '../translate'; const MULT = new BN(100 * 100); diff --git a/packages/page-staking/src/Query/ChartRewards.tsx b/packages/page-staking/src/Query/ChartRewards.tsx index 97da8f1e75..a2705fd233 100644 --- a/packages/page-staking/src/Query/ChartRewards.tsx +++ b/packages/page-staking/src/Query/ChartRewards.tsx @@ -1,15 +1,16 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveEraRewards, DeriveOwnSlashes, DeriveStakerPoints } from '@polkadot/api-derive/types'; +import type { ChartInfo, LineDataEntry, Props } from './types'; + import BN from 'bn.js'; import React, { useMemo } from 'react'; -import type { DeriveEraRewards, DeriveOwnSlashes, DeriveStakerPoints } from '@polkadot/api-derive/types'; import { Chart, Spinner } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { formatBalance } from '@polkadot/util'; -import type { ChartInfo, LineDataEntry, Props } from './types'; import { useTranslation } from '../translate'; import { balanceToNumber } from './util'; diff --git a/packages/page-staking/src/Query/ChartStake.tsx b/packages/page-staking/src/Query/ChartStake.tsx index c5e90575e5..14b9637cdd 100644 --- a/packages/page-staking/src/Query/ChartStake.tsx +++ b/packages/page-staking/src/Query/ChartStake.tsx @@ -1,15 +1,16 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveOwnExposure } from '@polkadot/api-derive/types'; +import type { ChartInfo, LineDataEntry, Props } from './types'; + import BN from 'bn.js'; import React, { useMemo } from 'react'; -import type { DeriveOwnExposure } from '@polkadot/api-derive/types'; import { Chart, Spinner } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { formatBalance } from '@polkadot/util'; -import type { ChartInfo, LineDataEntry, Props } from './types'; import { useTranslation } from '../translate'; import { balanceToNumber } from './util'; diff --git a/packages/page-staking/src/Query/Validator.tsx b/packages/page-staking/src/Query/Validator.tsx index 490583fa25..a51188ef91 100644 --- a/packages/page-staking/src/Query/Validator.tsx +++ b/packages/page-staking/src/Query/Validator.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Props } from './types'; + import React from 'react'; import styled from 'styled-components'; import { Columar, Column } from '@polkadot/react-components'; -import type { Props } from './types'; import ChartPoints from './ChartPoints'; import ChartPrefs from './ChartPrefs'; import ChartRewards from './ChartRewards'; diff --git a/packages/page-staking/src/Query/useBlockCounts.tsx b/packages/page-staking/src/Query/useBlockCounts.tsx index 3b63981dfe..528965a377 100644 --- a/packages/page-staking/src/Query/useBlockCounts.tsx +++ b/packages/page-staking/src/Query/useBlockCounts.tsx @@ -1,15 +1,15 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { useEffect, useState } from 'react'; - import type { DeriveSessionIndexes } from '@polkadot/api-derive/types'; import type { u32 } from '@polkadot/types'; +import type { SessionRewards } from '../types'; + +import { useEffect, useState } from 'react'; + import { useApi, useCall, useIsMountedRef } from '@polkadot/react-hooks'; import { isFunction } from '@polkadot/util'; -import type { SessionRewards } from '../types'; - export default function useBlockCounts (accountId: string, sessionRewards: SessionRewards[]): u32[] { const { api } = useApi(); const mountedRef = useIsMountedRef(); diff --git a/packages/page-staking/src/Slashes/Era.tsx b/packages/page-staking/src/Slashes/Era.tsx index a6d98b9ae1..4ee6bc0453 100644 --- a/packages/page-staking/src/Slashes/Era.tsx +++ b/packages/page-staking/src/Slashes/Era.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsic } from '@polkadot/api/types'; +import type { SlashEra } from './types'; + import React, { useCallback, useRef, useState } from 'react'; -import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { Button, Table, TxButton } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; -import type { SlashEra } from './types'; import { useTranslation } from '../translate'; import Row from './Row'; import Summary from './Summary'; diff --git a/packages/page-staking/src/Slashes/Row.tsx b/packages/page-staking/src/Slashes/Row.tsx index 6bb27b70b1..c3442f04f4 100644 --- a/packages/page-staking/src/Slashes/Row.tsx +++ b/packages/page-staking/src/Slashes/Row.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Slash } from './types'; + import React, { useCallback } from 'react'; import { AddressMini, AddressSmall, Badge, Checkbox, Expander } from '@polkadot/react-components'; import { FormatBalance } from '@polkadot/react-query'; import { formatNumber } from '@polkadot/util'; -import type { Slash } from './types'; import { useTranslation } from '../translate'; interface Props { diff --git a/packages/page-staking/src/Slashes/Summary.tsx b/packages/page-staking/src/Slashes/Summary.tsx index dd03251cff..273c055f01 100644 --- a/packages/page-staking/src/Slashes/Summary.tsx +++ b/packages/page-staking/src/Slashes/Summary.tsx @@ -1,16 +1,17 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveSessionProgress } from '@polkadot/api-derive/types'; +import type { SlashEra } from './types'; + import BN from 'bn.js'; import React, { useMemo } from 'react'; -import type { DeriveSessionProgress } from '@polkadot/api-derive/types'; import { CardSummary, SummaryBox } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; import { formatNumber } from '@polkadot/util'; -import type { SlashEra } from './types'; import { useTranslation } from '../translate'; interface Props { diff --git a/packages/page-staking/src/Slashes/index.tsx b/packages/page-staking/src/Slashes/index.tsx index 5c4c5bbecd..62034f0399 100644 --- a/packages/page-staking/src/Slashes/index.tsx +++ b/packages/page-staking/src/Slashes/index.tsx @@ -1,17 +1,18 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { StakerState } from '@polkadot/react-hooks/types'; +import type { UnappliedSlash } from '@polkadot/types/interfaces'; +import type { Slash, SlashEra } from './types'; + import BN from 'bn.js'; import React, { useMemo, useState } from 'react'; -import type { StakerState } from '@polkadot/react-hooks/types'; -import type { UnappliedSlash } from '@polkadot/types/interfaces'; import { getSlashProposalThreshold } from '@polkadot/apps-config'; import { Table, ToggleGroup } from '@polkadot/react-components'; import { useAccounts, useApi, useMembers } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; -import type { Slash, SlashEra } from './types'; import { useTranslation } from '../translate'; import Era from './Era'; diff --git a/packages/page-staking/src/Slashes/types.ts b/packages/page-staking/src/Slashes/types.ts index 7fd31e5d2f..c609d555f4 100644 --- a/packages/page-staking/src/Slashes/types.ts +++ b/packages/page-staking/src/Slashes/types.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import BN from 'bn.js'; - import type { UnappliedSlash } from '@polkadot/types/interfaces'; +import BN from 'bn.js'; + export interface Slash { era: BN; isMine: boolean; diff --git a/packages/page-staking/src/Targets/Nominate.tsx b/packages/page-staking/src/Targets/Nominate.tsx index 7cfe8b02c5..9d344cd0f7 100644 --- a/packages/page-staking/src/Targets/Nominate.tsx +++ b/packages/page-staking/src/Targets/Nominate.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { StakerState } from '@polkadot/react-hooks/types'; + import React, { useCallback, useMemo, useState } from 'react'; import styled from 'styled-components'; -import type { StakerState } from '@polkadot/react-hooks/types'; import { AddressMini, Button, InputAddress, Modal, Static, TxButton } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-staking/src/Targets/Summary.tsx b/packages/page-staking/src/Targets/Summary.tsx index 9319aed6c7..9291f213ca 100644 --- a/packages/page-staking/src/Targets/Summary.tsx +++ b/packages/page-staking/src/Targets/Summary.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import BN from 'bn.js'; -import React, { useMemo } from 'react'; - import type { DeriveSessionIndexes } from '@polkadot/api-derive/types'; import type { Option } from '@polkadot/types'; import type { Balance } from '@polkadot/types/interfaces'; + +import BN from 'bn.js'; +import React, { useMemo } from 'react'; + import { CardSummary, SummaryBox } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; diff --git a/packages/page-staking/src/Targets/Validator.tsx b/packages/page-staking/src/Targets/Validator.tsx index 59b1c6067b..0e5f8ec2ae 100644 --- a/packages/page-staking/src/Targets/Validator.tsx +++ b/packages/page-staking/src/Targets/Validator.tsx @@ -1,18 +1,19 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveAccountInfo } from '@polkadot/api-derive/types'; +import type { UnappliedSlash } from '@polkadot/types/interfaces'; +import type { NominatedBy, ValidatorInfo } from '../types'; + import BN from 'bn.js'; import React, { useCallback, useMemo } from 'react'; -import type { DeriveAccountInfo } from '@polkadot/api-derive/types'; -import type { UnappliedSlash } from '@polkadot/types/interfaces'; import { AddressSmall, Badge, Checkbox, Icon } from '@polkadot/react-components'; import { checkVisibility } from '@polkadot/react-components/util'; import { useApi, useBlockTime, useCall } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; import { formatNumber } from '@polkadot/util'; -import type { NominatedBy, ValidatorInfo } from '../types'; import MaxBadge from '../MaxBadge'; import Favorite from '../Overview/Address/Favorite'; import { useTranslation } from '../translate'; diff --git a/packages/page-staking/src/Targets/index.tsx b/packages/page-staking/src/Targets/index.tsx index c9a1b07c18..d971d59307 100644 --- a/packages/page-staking/src/Targets/index.tsx +++ b/packages/page-staking/src/Targets/index.tsx @@ -1,16 +1,17 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveHasIdentity, DeriveStakingOverview } from '@polkadot/api-derive/types'; +import type { StakerState } from '@polkadot/react-hooks/types'; +import type { NominatedBy, SortedTargets, TargetSortBy, ValidatorInfo } from '../types'; + import BN from 'bn.js'; import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import styled from 'styled-components'; -import type { DeriveHasIdentity, DeriveStakingOverview } from '@polkadot/api-derive/types'; -import type { StakerState } from '@polkadot/react-hooks/types'; import { Button, Icon, Table, Toggle } from '@polkadot/react-components'; import { useApi, useAvailableSlashes, useBlocksPerDays } from '@polkadot/react-hooks'; -import type { NominatedBy, SortedTargets, TargetSortBy, ValidatorInfo } from '../types'; import { MAX_NOMINATIONS } from '../constants'; import ElectionBanner from '../ElectionBanner'; import Filtering from '../Filtering'; diff --git a/packages/page-staking/src/Targets/useOwnNominators.ts b/packages/page-staking/src/Targets/useOwnNominators.ts index 53c11c7688..efd909dcf2 100644 --- a/packages/page-staking/src/Targets/useOwnNominators.ts +++ b/packages/page-staking/src/Targets/useOwnNominators.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { useMemo } from 'react'; - import type { StakerState } from '@polkadot/react-hooks/types'; +import { useMemo } from 'react'; + export default function useOwnNominators (ownStashes?: StakerState[]): StakerState[] | undefined { return useMemo( () => ownStashes ? ownStashes.filter(({ isOwnController, isStashValidating }) => isOwnController && !isStashValidating) : undefined, diff --git a/packages/page-staking/src/index.tsx b/packages/page-staking/src/index.tsx index cb807ca415..2c6b9424f9 100644 --- a/packages/page-staking/src/index.tsx +++ b/packages/page-staking/src/index.tsx @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveStakingOverview } from '@polkadot/api-derive/types'; +import type { AppProps as Props, ThemeProps } from '@polkadot/react-components/types'; +import type { ElectionStatus } from '@polkadot/types/interfaces'; + import React, { useMemo } from 'react'; import { Route, Switch } from 'react-router'; import { useLocation } from 'react-router-dom'; import styled from 'styled-components'; -import type { DeriveStakingOverview } from '@polkadot/api-derive/types'; -import type { AppProps as Props, ThemeProps } from '@polkadot/react-components/types'; -import type { ElectionStatus } from '@polkadot/types/interfaces'; import { HelpOverlay } from '@polkadot/react-components'; import Tabs from '@polkadot/react-components/Tabs'; import { useAccounts, useApi, useAvailableSlashes, useCall, useFavorites, useOwnStashInfos } from '@polkadot/react-hooks'; diff --git a/packages/page-staking/src/translate.ts b/packages/page-staking/src/translate.ts index 78fecdfd3a..c69088b8af 100644 --- a/packages/page-staking/src/translate.ts +++ b/packages/page-staking/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/page-staking/src/types.ts b/packages/page-staking/src/types.ts index 80bf361d67..fa610adbf8 100644 --- a/packages/page-staking/src/types.ts +++ b/packages/page-staking/src/types.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import BN from 'bn.js'; - import type { Inflation } from '@polkadot/react-hooks/types'; import type { AccountId, Balance, BlockNumber, EraIndex, Exposure, Hash, SessionIndex, ValidatorPrefs, ValidatorPrefsTo196 } from '@polkadot/types/interfaces'; +import BN from 'bn.js'; + export type Nominators = Record; export type AccountFilter = 'all' | 'controller' | 'session' | 'stash' | 'unbonded'; diff --git a/packages/page-staking/src/useIdentities.ts b/packages/page-staking/src/useIdentities.ts index 3bdae971db..a56528a778 100644 --- a/packages/page-staking/src/useIdentities.ts +++ b/packages/page-staking/src/useIdentities.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { DeriveHasIdentity } from '@polkadot/api-derive/types'; + import { useApi, useCall } from '@polkadot/react-hooks'; function transformIdentity ([[validatorIds], hasIdentities]: [[string[]], DeriveHasIdentity[]]): Record { diff --git a/packages/page-staking/src/useNominations.ts b/packages/page-staking/src/useNominations.ts index f2ca10a32d..ae650ddea9 100644 --- a/packages/page-staking/src/useNominations.ts +++ b/packages/page-staking/src/useNominations.ts @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { useMemo } from 'react'; - import type { Option, StorageKey } from '@polkadot/types'; import type { Nominations } from '@polkadot/types/interfaces'; -import { useApi, useCall } from '@polkadot/react-hooks'; - import type { NominatedBy } from './types'; +import { useMemo } from 'react'; + +import { useApi, useCall } from '@polkadot/react-hooks'; + type Result = Record; function extractNominators (nominations: [StorageKey, Option][]): Result { diff --git a/packages/page-staking/src/useSortedTargets.ts b/packages/page-staking/src/useSortedTargets.ts index 1c303cd224..289df9c69e 100644 --- a/packages/page-staking/src/useSortedTargets.ts +++ b/packages/page-staking/src/useSortedTargets.ts @@ -1,17 +1,17 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ApiPromise } from '@polkadot/api'; +import type { DeriveSessionInfo, DeriveStakingElected, DeriveStakingWaiting } from '@polkadot/api-derive/types'; +import type { SortedTargets, TargetSortBy, ValidatorInfo } from './types'; + import BN from 'bn.js'; import { useMemo } from 'react'; -import type { ApiPromise } from '@polkadot/api'; -import type { DeriveSessionInfo, DeriveStakingElected, DeriveStakingWaiting } from '@polkadot/api-derive/types'; import { registry } from '@polkadot/react-api'; import { calcInflation, useAccounts, useApi, useCall } from '@polkadot/react-hooks'; import { BN_ONE, BN_ZERO } from '@polkadot/util'; -import type { SortedTargets, TargetSortBy, ValidatorInfo } from './types'; - interface LastEra { activeEra: BN; eraLength: BN; diff --git a/packages/page-storage/src/Queries.tsx b/packages/page-storage/src/Queries.tsx index 6da171e3ef..6a251d8889 100644 --- a/packages/page-storage/src/Queries.tsx +++ b/packages/page-storage/src/Queries.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-storage authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { QueryTypes } from './types'; + import React from 'react'; -import type { QueryTypes } from './types'; import Query from './Query'; interface Props { diff --git a/packages/page-storage/src/Query.tsx b/packages/page-storage/src/Query.tsx index e0259eecca..4009c4e995 100644 --- a/packages/page-storage/src/Query.tsx +++ b/packages/page-storage/src/Query.tsx @@ -1,21 +1,21 @@ // Copyright 2017-2020 @polkadot/app-storage authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useMemo } from 'react'; -import styled from 'styled-components'; - import type { QueryableStorageEntry } from '@polkadot/api/types'; import type { ComponentRenderer, DefaultProps, RenderFn } from '@polkadot/react-api/hoc/types'; import type { ConstValue } from '@polkadot/react-components/InputConsts/types'; import type { Option, Raw } from '@polkadot/types'; +import type { QueryTypes, StorageModuleQuery } from './types'; + +import React, { useCallback, useMemo } from 'react'; +import styled from 'styled-components'; + import { withCallDiv } from '@polkadot/react-api/hoc'; import { Button, Labelled } from '@polkadot/react-components'; import valueToText from '@polkadot/react-params/valueToText'; import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey'; import { compactStripLength, isU8a, u8aToHex, u8aToString } from '@polkadot/util'; -import type { QueryTypes, StorageModuleQuery } from './types'; - interface Props { className?: string; onRemove: (id: number) => void; diff --git a/packages/page-storage/src/Selection/Consts.tsx b/packages/page-storage/src/Selection/Consts.tsx index 26c922f587..3d6a93e785 100644 --- a/packages/page-storage/src/Selection/Consts.tsx +++ b/packages/page-storage/src/Selection/Consts.tsx @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/app-storage authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useState } from 'react'; - import type { ConstantCodec } from '@polkadot/metadata/decorate/types'; import type { ConstValue } from '@polkadot/react-components/InputConsts/types'; +import type { ComponentProps as Props } from '../types'; + +import React, { useCallback, useState } from 'react'; + import { Button, InputConsts } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; -import type { ComponentProps as Props } from '../types'; import { useTranslation } from '../translate'; function Consts ({ onAdd }: Props): React.ReactElement { diff --git a/packages/page-storage/src/Selection/Modules.tsx b/packages/page-storage/src/Selection/Modules.tsx index cf334fa570..f8d85bf37d 100644 --- a/packages/page-storage/src/Selection/Modules.tsx +++ b/packages/page-storage/src/Selection/Modules.tsx @@ -1,12 +1,14 @@ // Copyright 2017-2020 @polkadot/app-storage authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useState } from 'react'; - import type { QueryableStorageEntry } from '@polkadot/api/types'; import type { RawParams } from '@polkadot/react-params/types'; import type { StorageEntryTypeLatest } from '@polkadot/types/interfaces'; import type { TypeDef } from '@polkadot/types/types'; +import type { ComponentProps as Props } from '../types'; + +import React, { useCallback, useState } from 'react'; + import { ApiPromise } from '@polkadot/api'; import { Button, InputStorage } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; @@ -15,7 +17,6 @@ import { getTypeDef } from '@polkadot/types'; import { TypeDefInfo } from '@polkadot/types/types'; import { isNull, isUndefined } from '@polkadot/util'; -import type { ComponentProps as Props } from '../types'; import { useTranslation } from '../translate'; interface TypeDefExt extends TypeDef { diff --git a/packages/page-storage/src/Selection/Raw.tsx b/packages/page-storage/src/Selection/Raw.tsx index 4701ccea4a..8f03de3bdf 100644 --- a/packages/page-storage/src/Selection/Raw.tsx +++ b/packages/page-storage/src/Selection/Raw.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-storage authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ComponentProps as Props } from '../types'; + import React, { useCallback, useState } from 'react'; import { Button, Input } from '@polkadot/react-components'; import { compactAddLength, u8aToU8a } from '@polkadot/util'; -import type { ComponentProps as Props } from '../types'; import { useTranslation } from '../translate'; function Raw ({ onAdd }: Props): React.ReactElement { diff --git a/packages/page-storage/src/Selection/index.tsx b/packages/page-storage/src/Selection/index.tsx index 688d896894..8dc818f398 100644 --- a/packages/page-storage/src/Selection/index.tsx +++ b/packages/page-storage/src/Selection/index.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-storage authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ParitalQueryTypes, QueryTypes } from '../types'; + import React, { useCallback, useRef } from 'react'; import { Route, Switch } from 'react-router'; import { Tabs } from '@polkadot/react-components'; -import type { ParitalQueryTypes, QueryTypes } from '../types'; import { useTranslation } from '../translate'; import Consts from './Consts'; import Modules from './Modules'; diff --git a/packages/page-storage/src/index.tsx b/packages/page-storage/src/index.tsx index a5edb5cfc7..f4a214776c 100644 --- a/packages/page-storage/src/index.tsx +++ b/packages/page-storage/src/index.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-storage authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AppProps as Props } from '@polkadot/react-components/types'; +import type { QueryTypes } from './types'; + import React, { useCallback, useState } from 'react'; import styled from 'styled-components'; -import type { AppProps as Props } from '@polkadot/react-components/types'; - -import type { QueryTypes } from './types'; import Queries from './Queries'; import Selection from './Selection'; diff --git a/packages/page-storage/src/translate.ts b/packages/page-storage/src/translate.ts index bcb031623f..4057232318 100644 --- a/packages/page-storage/src/translate.ts +++ b/packages/page-storage/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/page-sudo/src/Sudo.tsx b/packages/page-sudo/src/Sudo.tsx index 2727f02766..db24ff0823 100644 --- a/packages/page-sudo/src/Sudo.tsx +++ b/packages/page-sudo/src/Sudo.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-js authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsic } from '@polkadot/api/types'; + import BN from 'bn.js'; import React, { useCallback, useState } from 'react'; import styled from 'styled-components'; -import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { Button, Extrinsic, Icon, InputNumber, Toggle, TxButton } from '@polkadot/react-components'; import { useApi, useToggle } from '@polkadot/react-hooks'; import { BN_ZERO } from '@polkadot/util'; diff --git a/packages/page-sudo/src/index.tsx b/packages/page-sudo/src/index.tsx index 0bf3cf6821..38acb46c5e 100644 --- a/packages/page-sudo/src/index.tsx +++ b/packages/page-sudo/src/index.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-js authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AppProps as Props } from '@polkadot/react-components/types'; + import React, { useRef } from 'react'; import { Route, Switch } from 'react-router'; -import type { AppProps as Props } from '@polkadot/react-components/types'; import { Icon, Tabs } from '@polkadot/react-components'; import { useSudo } from '@polkadot/react-hooks'; diff --git a/packages/page-sudo/src/translate.ts b/packages/page-sudo/src/translate.ts index 2fe7cb697e..c322840e4d 100644 --- a/packages/page-sudo/src/translate.ts +++ b/packages/page-sudo/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/page-tech-comm/src/Overview/Members.tsx b/packages/page-tech-comm/src/Overview/Members.tsx index 178bf7f959..817403f400 100644 --- a/packages/page-tech-comm/src/Overview/Members.tsx +++ b/packages/page-tech-comm/src/Overview/Members.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-tech-comm authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AccountId } from '@polkadot/types/interfaces'; + import React, { useRef } from 'react'; -import type { AccountId } from '@polkadot/types/interfaces'; import { AddressSmall, Table, Tag } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-tech-comm/src/Overview/Summary.tsx b/packages/page-tech-comm/src/Overview/Summary.tsx index 4a2c41eb90..8d65ede586 100644 --- a/packages/page-tech-comm/src/Overview/Summary.tsx +++ b/packages/page-tech-comm/src/Overview/Summary.tsx @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/app-tech-comm authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { u32 } from '@polkadot/types'; +import type { ComponentProps as Props } from '../types'; + import React from 'react'; -import type { u32 } from '@polkadot/types'; import { CardSummary, SummaryBox } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; -import type { ComponentProps as Props } from '../types'; import { useTranslation } from '../translate'; function Summary ({ className = '', members, proposals }: Props): React.ReactElement { diff --git a/packages/page-tech-comm/src/Overview/index.tsx b/packages/page-tech-comm/src/Overview/index.tsx index 88fd45c50c..e4dd3809be 100644 --- a/packages/page-tech-comm/src/Overview/index.tsx +++ b/packages/page-tech-comm/src/Overview/index.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-tech-comm authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ComponentProps as Props } from '../types'; + import React from 'react'; -import type { ComponentProps as Props } from '../types'; import Members from './Members'; import Summary from './Summary'; diff --git a/packages/page-tech-comm/src/Proposals/Close.tsx b/packages/page-tech-comm/src/Proposals/Close.tsx index de3478e9ba..708b965d80 100644 --- a/packages/page-tech-comm/src/Proposals/Close.tsx +++ b/packages/page-tech-comm/src/Proposals/Close.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-tech-comm authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Hash, Proposal, ProposalIndex } from '@polkadot/types/interfaces'; + import React, { useState } from 'react'; -import type { Hash, Proposal, ProposalIndex } from '@polkadot/types/interfaces'; import { Button, InputAddress, Modal, ProposedAction, TxButton } from '@polkadot/react-components'; import { useApi, useToggle, useWeight } from '@polkadot/react-hooks'; diff --git a/packages/page-tech-comm/src/Proposals/Proposal.tsx b/packages/page-tech-comm/src/Proposals/Proposal.tsx index 7a96786d9e..f705719a5f 100644 --- a/packages/page-tech-comm/src/Proposals/Proposal.tsx +++ b/packages/page-tech-comm/src/Proposals/Proposal.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-tech-comm authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useMemo } from 'react'; - import type { Option } from '@polkadot/types'; import type { AccountId, Hash, Proposal as ProposalType, Votes } from '@polkadot/types/interfaces'; + +import React, { useMemo } from 'react'; + import ProposalCell from '@polkadot/app-democracy/Overview/ProposalCell'; import { AddressMini, TxButton } from '@polkadot/react-components'; import { useAccounts, useApi, useCall, useVotingStatus, useWeight } from '@polkadot/react-hooks'; diff --git a/packages/page-tech-comm/src/Proposals/Propose.tsx b/packages/page-tech-comm/src/Proposals/Propose.tsx index 02e8252584..7b5c394df3 100644 --- a/packages/page-tech-comm/src/Proposals/Propose.tsx +++ b/packages/page-tech-comm/src/Proposals/Propose.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-tech-comm authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsic } from '@polkadot/api/types'; + import BN from 'bn.js'; import React, { useCallback, useState } from 'react'; -import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { Button, Extrinsic, InputAddress, InputNumber, Modal, TxButton } from '@polkadot/react-components'; import { useApi, useModal } from '@polkadot/react-hooks'; diff --git a/packages/page-tech-comm/src/Proposals/Voting.tsx b/packages/page-tech-comm/src/Proposals/Voting.tsx index 9ad12fac18..22629c3345 100644 --- a/packages/page-tech-comm/src/Proposals/Voting.tsx +++ b/packages/page-tech-comm/src/Proposals/Voting.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-tech-comm authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AccountId, Hash } from '@polkadot/types/interfaces'; + import BN from 'bn.js'; import React, { useState } from 'react'; -import type { AccountId, Hash } from '@polkadot/types/interfaces'; import { Button, Modal, TxButton, VoteAccount } from '@polkadot/react-components'; import { useAccounts, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-tech-comm/src/Proposals/index.tsx b/packages/page-tech-comm/src/Proposals/index.tsx index 28c502c7b6..3f6207c5ba 100644 --- a/packages/page-tech-comm/src/Proposals/index.tsx +++ b/packages/page-tech-comm/src/Proposals/index.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-tech-comm authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Hash } from '@polkadot/types/interfaces'; +import type { ComponentProps as Props } from '../types'; + import React, { useRef } from 'react'; -import type { Hash } from '@polkadot/types/interfaces'; import { Button, Table } from '@polkadot/react-components'; -import type { ComponentProps as Props } from '../types'; import { useTranslation } from '../translate'; import Proposal from './Proposal'; import Propose from './Propose'; diff --git a/packages/page-tech-comm/src/index.tsx b/packages/page-tech-comm/src/index.tsx index c61bd4e27e..f7d0616a17 100644 --- a/packages/page-tech-comm/src/index.tsx +++ b/packages/page-tech-comm/src/index.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-tech-comm authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Option } from '@polkadot/types'; +import type { AccountId, Hash } from '@polkadot/types/interfaces'; + import React, { useMemo } from 'react'; import { Route, Switch } from 'react-router'; -import type { Option } from '@polkadot/types'; -import type { AccountId, Hash } from '@polkadot/types/interfaces'; import { Tabs } from '@polkadot/react-components'; import { useApi, useCall, useMembers } from '@polkadot/react-hooks'; diff --git a/packages/page-tech-comm/src/translate.ts b/packages/page-tech-comm/src/translate.ts index aa29a0da24..9b91bec164 100644 --- a/packages/page-tech-comm/src/translate.ts +++ b/packages/page-tech-comm/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/page-tech-comm/src/useCounter.ts b/packages/page-tech-comm/src/useCounter.ts index de41a3955c..c6f01aaddb 100644 --- a/packages/page-tech-comm/src/useCounter.ts +++ b/packages/page-tech-comm/src/useCounter.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Hash } from '@polkadot/types/interfaces'; + import { useApi, useCall } from '@polkadot/react-hooks'; const transformCounter = { diff --git a/packages/page-treasury/src/Overview/Council.tsx b/packages/page-treasury/src/Overview/Council.tsx index 0315ab1174..a8a92d4726 100644 --- a/packages/page-treasury/src/Overview/Council.tsx +++ b/packages/page-treasury/src/Overview/Council.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-treasury authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useEffect, useRef, useState } from 'react'; - import type { SubmittableExtrinsic } from '@polkadot/api/types'; import type { ProposalIndex } from '@polkadot/types/interfaces'; + +import React, { useEffect, useRef, useState } from 'react'; + import { getTreasuryProposalThreshold } from '@polkadot/apps-config'; import { Button, Dropdown, InputAddress, Modal, TxButton } from '@polkadot/react-components'; import { useApi, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-treasury/src/Overview/Proposal.tsx b/packages/page-treasury/src/Overview/Proposal.tsx index fe4d060567..146ba3aec3 100644 --- a/packages/page-treasury/src/Overview/Proposal.tsx +++ b/packages/page-treasury/src/Overview/Proposal.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-treasury authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveTreasuryProposal } from '@polkadot/api-derive/types'; + import React, { useMemo } from 'react'; -import type { DeriveTreasuryProposal } from '@polkadot/api-derive/types'; import { AddressMini, AddressSmall, LinkExternal } from '@polkadot/react-components'; import { FormatBalance } from '@polkadot/react-query'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/page-treasury/src/Overview/Proposals.tsx b/packages/page-treasury/src/Overview/Proposals.tsx index 48ab68f871..89cf6c68c6 100644 --- a/packages/page-treasury/src/Overview/Proposals.tsx +++ b/packages/page-treasury/src/Overview/Proposals.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-treasury authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveTreasuryProposal } from '@polkadot/api-derive/types'; + import React, { useCallback, useMemo } from 'react'; import { useHistory } from 'react-router-dom'; -import type { DeriveTreasuryProposal } from '@polkadot/api-derive/types'; import { Table } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-treasury/src/Overview/Summary.tsx b/packages/page-treasury/src/Overview/Summary.tsx index 03567b5f7b..61db6db6e5 100644 --- a/packages/page-treasury/src/Overview/Summary.tsx +++ b/packages/page-treasury/src/Overview/Summary.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-treasury authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveBalancesAccount } from '@polkadot/api-derive/types'; +import type { Balance } from '@polkadot/types/interfaces'; + import BN from 'bn.js'; import React from 'react'; -import type { DeriveBalancesAccount } from '@polkadot/api-derive/types'; -import type { Balance } from '@polkadot/types/interfaces'; import { CardSummary, SummaryBox } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; diff --git a/packages/page-treasury/src/Overview/index.tsx b/packages/page-treasury/src/Overview/index.tsx index 1674b5acd9..cb5560883d 100644 --- a/packages/page-treasury/src/Overview/index.tsx +++ b/packages/page-treasury/src/Overview/index.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-treasury authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveTreasuryProposals } from '@polkadot/api-derive/types'; + import React from 'react'; -import type { DeriveTreasuryProposals } from '@polkadot/api-derive/types'; import { Button } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-treasury/src/Tips/Tip.tsx b/packages/page-treasury/src/Tips/Tip.tsx index 1763f7dd83..18dce83621 100644 --- a/packages/page-treasury/src/Tips/Tip.tsx +++ b/packages/page-treasury/src/Tips/Tip.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-treasury authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AccountId, Balance, BlockNumber, OpenTip, OpenTipTo225 } from '@polkadot/types/interfaces'; + import BN from 'bn.js'; import React, { useEffect, useMemo, useState } from 'react'; import styled from 'styled-components'; -import type { AccountId, Balance, BlockNumber, OpenTip, OpenTipTo225 } from '@polkadot/types/interfaces'; import { AddressMini, AddressSmall, Checkbox, Expander, Icon, LinkExternal, TxButton } from '@polkadot/react-components'; import { useAccounts } from '@polkadot/react-hooks'; import { BlockToTime, FormatBalance } from '@polkadot/react-query'; diff --git a/packages/page-treasury/src/Tips/TipReason.tsx b/packages/page-treasury/src/Tips/TipReason.tsx index fb0d007e33..9a3f8cceac 100644 --- a/packages/page-treasury/src/Tips/TipReason.tsx +++ b/packages/page-treasury/src/Tips/TipReason.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-treasury authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { Bytes, Option } from '@polkadot/types'; import type { Hash } from '@polkadot/types/interfaces'; + +import React from 'react'; + import { useApi, useCall } from '@polkadot/react-hooks'; import { hexToString } from '@polkadot/util'; diff --git a/packages/page-treasury/src/Tips/Tips.tsx b/packages/page-treasury/src/Tips/Tips.tsx index 9803326532..3f34ed91e4 100644 --- a/packages/page-treasury/src/Tips/Tips.tsx +++ b/packages/page-treasury/src/Tips/Tips.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-treasury authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Option } from '@polkadot/types'; +import type { BlockNumber, OpenTip, OpenTipTo225 } from '@polkadot/types/interfaces'; + import BN from 'bn.js'; import React, { useMemo, useRef, useState } from 'react'; import styled from 'styled-components'; -import type { Option } from '@polkadot/types'; -import type { BlockNumber, OpenTip, OpenTipTo225 } from '@polkadot/types/interfaces'; import { Table, Toggle } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-treasury/src/Tips/index.tsx b/packages/page-treasury/src/Tips/index.tsx index f8f8cdf165..1d95a99019 100644 --- a/packages/page-treasury/src/Tips/index.tsx +++ b/packages/page-treasury/src/Tips/index.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-treasury authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsic } from '@polkadot/api/types'; + import BN from 'bn.js'; import React, { useCallback, useMemo, useState } from 'react'; -import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { Button, TxButton } from '@polkadot/react-components'; import { useAccounts, useApi } from '@polkadot/react-hooks'; diff --git a/packages/page-treasury/src/translate.ts b/packages/page-treasury/src/translate.ts index 3cc9b6d2fb..600444e50c 100644 --- a/packages/page-treasury/src/translate.ts +++ b/packages/page-treasury/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/page-treasury/src/useCounter.ts b/packages/page-treasury/src/useCounter.ts index 9e8f1ed1f4..3f0ccd6561 100644 --- a/packages/page-treasury/src/useCounter.ts +++ b/packages/page-treasury/src/useCounter.ts @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-treasury authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveTreasuryProposals } from '@polkadot/api-derive/types'; + import { useEffect, useState } from 'react'; -import type { DeriveTreasuryProposals } from '@polkadot/api-derive/types'; import { useAccounts, useApi, useCall } from '@polkadot/react-hooks'; export default function useCounter (): number { diff --git a/packages/react-api/src/Api.tsx b/packages/react-api/src/Api.tsx index fb015d65ef..72a7fee368 100644 --- a/packages/react-api/src/Api.tsx +++ b/packages/react-api/src/Api.tsx @@ -1,14 +1,16 @@ // Copyright 2017-2020 @polkadot/react-api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useContext, useEffect, useMemo, useState } from 'react'; -import store from 'store'; - import type { InjectedExtension } from '@polkadot/extension-inject/types'; import type { ChainProperties, ChainType } from '@polkadot/types/interfaces'; import type { KeyringStore } from '@polkadot/ui-keyring/types'; -import { deriveMapCache, setDeriveCache } from '@polkadot/api-derive/util'; +import type { ApiProps, ApiState } from './types'; + +import React, { useContext, useEffect, useMemo, useState } from 'react'; +import store from 'store'; + import { ApiPromise } from '@polkadot/api/promise'; +import { deriveMapCache, setDeriveCache } from '@polkadot/api-derive/util'; import { ethereumNetworks, POLKADOT_DENOM_BLOCK, POLKADOT_GENESIS, typesBundle, typesChain, typesRpc, typesSpec } from '@polkadot/apps-config'; import { web3Accounts, web3Enable } from '@polkadot/extension-dapp'; import { TokenUnit } from '@polkadot/react-components/InputNumber'; @@ -21,7 +23,6 @@ import { formatBalance, isTestChain } from '@polkadot/util'; import { setSS58Format } from '@polkadot/util-crypto'; import { defaults as addressDefaults } from '@polkadot/util-crypto/address/defaults'; -import type { ApiProps, ApiState } from './types'; import ApiContext from './ApiContext'; import registry from './typeRegistry'; diff --git a/packages/react-api/src/ApiContext.ts b/packages/react-api/src/ApiContext.ts index ed9f408944..03b4c64d73 100644 --- a/packages/react-api/src/ApiContext.ts +++ b/packages/react-api/src/ApiContext.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { ApiProps } from './types'; +import React from 'react'; + const ApiContext: React.Context = React.createContext({} as unknown as ApiProps); const ApiConsumer: React.Consumer = ApiContext.Consumer; const ApiProvider: React.Provider = ApiContext.Provider; diff --git a/packages/react-api/src/hoc/api.tsx b/packages/react-api/src/hoc/api.tsx index 99a6c226ca..cf60259c17 100644 --- a/packages/react-api/src/hoc/api.tsx +++ b/packages/react-api/src/hoc/api.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-api authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ApiProps, SubtractProps } from '../types'; +import type { DefaultProps } from './types'; + import React from 'react'; import { assert } from '@polkadot/util'; -import type { ApiProps, SubtractProps } from '../types'; -import type { DefaultProps } from './types'; import { ApiConsumer } from '../ApiContext'; export default function withApi

(Inner: React.ComponentType

, defaultProps: DefaultProps = {}): React.ComponentType { diff --git a/packages/react-api/src/hoc/call.tsx b/packages/react-api/src/hoc/call.tsx index e4d22eacb8..c19155cd06 100644 --- a/packages/react-api/src/hoc/call.tsx +++ b/packages/react-api/src/hoc/call.tsx @@ -9,12 +9,13 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ +import type { ApiProps, CallState as State, SubtractProps } from '../types'; +import type { Options } from './types'; + import React from 'react'; import { assert, isNull, isUndefined } from '@polkadot/util'; -import type { ApiProps, CallState as State, SubtractProps } from '../types'; -import type { Options } from './types'; import echoTransform from '../transform/echo'; import { isEqual, triggerChange } from '../util'; import withApi from './api'; diff --git a/packages/react-api/src/hoc/callDiv.tsx b/packages/react-api/src/hoc/callDiv.tsx index 80a600e098..04431037f1 100644 --- a/packages/react-api/src/hoc/callDiv.tsx +++ b/packages/react-api/src/hoc/callDiv.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { BaseProps } from '../types'; import type { DefaultProps, Options } from './types'; + +import React from 'react'; + import withCall from './call'; interface Props extends BaseProps { diff --git a/packages/react-api/src/hoc/calls.ts b/packages/react-api/src/hoc/calls.ts index 56a347131a..8c51fbe57c 100644 --- a/packages/react-api/src/hoc/calls.ts +++ b/packages/react-api/src/hoc/calls.ts @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { ApiProps, SubtractProps } from '../types'; import type { Options } from './types'; + +import React from 'react'; + import withCall from './call'; type Call = string | [string, Options]; diff --git a/packages/react-api/src/hoc/observable.tsx b/packages/react-api/src/hoc/observable.tsx index 43eb892446..d34d9f2031 100644 --- a/packages/react-api/src/hoc/observable.tsx +++ b/packages/react-api/src/hoc/observable.tsx @@ -3,12 +3,13 @@ // TODO: Lots of duplicated code between this and withObservable, surely there is a better way of doing this? +import type { CallState } from '../types'; +import type { DefaultProps, HOC, Options, RenderFn } from './types'; + import React from 'react'; import { Observable, of } from 'rxjs'; import { catchError, map } from 'rxjs/operators'; -import type { CallState } from '../types'; -import type { DefaultProps, HOC, Options, RenderFn } from './types'; import echoTransform from '../transform/echo'; import { intervalObservable, isEqual, triggerChange } from '../util'; diff --git a/packages/react-api/src/hoc/onlyOn.tsx b/packages/react-api/src/hoc/onlyOn.tsx index 24027013d4..3315d817f1 100644 --- a/packages/react-api/src/hoc/onlyOn.tsx +++ b/packages/react-api/src/hoc/onlyOn.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Environment } from '../types'; + import { ComponentType } from 'react'; -import type { Environment } from '../types'; import { getEnvironment } from '../util'; const onlyOn = (environment: Environment) => >(component: T): T | (() => null) => { diff --git a/packages/react-api/src/hoc/types.ts b/packages/react-api/src/hoc/types.ts index 2191c99294..200d63ec7b 100644 --- a/packages/react-api/src/hoc/types.ts +++ b/packages/react-api/src/hoc/types.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { OnChangeCb } from '../types'; +import React from 'react'; + export type Transform = (value: any, index: number) => any; export interface DefaultProps { diff --git a/packages/react-api/src/types.ts b/packages/react-api/src/types.ts index 83fbc34cd7..c0a830bda7 100644 --- a/packages/react-api/src/types.ts +++ b/packages/react-api/src/types.ts @@ -3,6 +3,7 @@ import type { SubmittableExtrinsicFunction } from '@polkadot/api/promise/types'; import type { InjectedExtension } from '@polkadot/extension-inject/types'; + import { ApiPromise } from '@polkadot/api/promise'; // helpers for HOC props diff --git a/packages/react-api/src/util/intervalObservable.ts b/packages/react-api/src/util/intervalObservable.ts index 6479188542..ad365a670b 100644 --- a/packages/react-api/src/util/intervalObservable.ts +++ b/packages/react-api/src/util/intervalObservable.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-api authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { CallState } from '../types'; + import { Subscription } from 'rxjs'; import { interval } from 'rxjs/observable/interval'; -import type { CallState } from '../types'; - const interval$ = interval(500); export default function intervalObservable (that: React.Component): Subscription { diff --git a/packages/react-api/src/util/triggerChange.ts b/packages/react-api/src/util/triggerChange.ts index 29e120f802..1dd853dcf9 100644 --- a/packages/react-api/src/util/triggerChange.ts +++ b/packages/react-api/src/util/triggerChange.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { isFunction, isObservable } from '@polkadot/util'; - import type { OnChangeCb } from '../types'; +import { isFunction, isObservable } from '@polkadot/util'; + export default function triggerChange (value?: unknown, ...callOnResult: (OnChangeCb | undefined)[]): void { if (!callOnResult || !callOnResult.length) { return; diff --git a/packages/react-components/src/AccountIndex.tsx b/packages/react-components/src/AccountIndex.tsx index f7af3c61c0..f560fca5a2 100644 --- a/packages/react-components/src/AccountIndex.tsx +++ b/packages/react-components/src/AccountIndex.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useMemo } from 'react'; -import styled from 'styled-components'; - import type { DeriveAccountInfo } from '@polkadot/api-derive/types'; import type { ThemeProps } from '@polkadot/react-components/types'; import type { AccountId, Address } from '@polkadot/types/interfaces'; + +import React, { useMemo } from 'react'; +import styled from 'styled-components'; + import { useApi, useCall } from '@polkadot/react-hooks'; interface Props { diff --git a/packages/react-components/src/AccountName.tsx b/packages/react-components/src/AccountName.tsx index 365ff055c7..c61ce2b73f 100644 --- a/packages/react-components/src/AccountName.tsx +++ b/packages/react-components/src/AccountName.tsx @@ -2,12 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 import type { IconName } from '@fortawesome/fontawesome-svg-core'; -import React, { useCallback, useContext, useEffect, useState } from 'react'; -import styled from 'styled-components'; - import type { DeriveAccountInfo, DeriveAccountRegistration } from '@polkadot/api-derive/types'; import type { ThemeProps } from '@polkadot/react-components/types'; import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; + +import React, { useCallback, useContext, useEffect, useState } from 'react'; +import styled from 'styled-components'; + import { AccountSidebarToggle } from '@polkadot/app-accounts/Sidebar'; import registry from '@polkadot/react-api/typeRegistry'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/react-components/src/ActionItem.tsx b/packages/react-components/src/ActionItem.tsx index 2390d9bdca..9892d4499f 100644 --- a/packages/react-components/src/ActionItem.tsx +++ b/packages/react-components/src/ActionItem.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Proposal } from '@polkadot/types/interfaces'; + import BN from 'bn.js'; import React from 'react'; import styled from 'styled-components'; -import type { Proposal } from '@polkadot/types/interfaces'; - import Card from './Card'; import ProposedAction, { styles as proposedActionStyles } from './ProposedAction'; import { styles as rowStyles } from './Row'; diff --git a/packages/react-components/src/AddressInfo.tsx b/packages/react-components/src/AddressInfo.tsx index 70fea0fe81..812ddb3eec 100644 --- a/packages/react-components/src/AddressInfo.tsx +++ b/packages/react-components/src/AddressInfo.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveBalancesAll, DeriveDemocracyLock, DeriveStakingAccount } from '@polkadot/api-derive/types'; +import type { BlockNumber, LockIdentifier, ValidatorPrefsTo145 } from '@polkadot/types/interfaces'; import type { TFunction } from 'i18next'; + import BN from 'bn.js'; import React from 'react'; import styled from 'styled-components'; -import type { DeriveBalancesAll, DeriveDemocracyLock, DeriveStakingAccount } from '@polkadot/api-derive/types'; -import type { BlockNumber, LockIdentifier, ValidatorPrefsTo145 } from '@polkadot/types/interfaces'; import { withCalls, withMulti } from '@polkadot/react-api/hoc'; import { Expander, Icon, Tooltip } from '@polkadot/react-components'; import { useAccounts, useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/react-components/src/AddressMini.tsx b/packages/react-components/src/AddressMini.tsx index 040ad12c2d..d4f494953d 100644 --- a/packages/react-components/src/AddressMini.tsx +++ b/packages/react-components/src/AddressMini.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; +import type { KeyringItemType } from '@polkadot/ui-keyring/types'; + import BN from 'bn.js'; import React from 'react'; import styled from 'styled-components'; -import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; -import type { KeyringItemType } from '@polkadot/ui-keyring/types'; - import AccountName from './AccountName'; import BalanceDisplay from './Balance'; import BondedDisplay from './Bonded'; diff --git a/packages/react-components/src/AddressRow.tsx b/packages/react-components/src/AddressRow.tsx index 4621259e55..970282fc22 100644 --- a/packages/react-components/src/AddressRow.tsx +++ b/packages/react-components/src/AddressRow.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; + import React from 'react'; import styled from 'styled-components'; -import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; import { useAccountInfo } from '@polkadot/react-hooks'; import BaseIdentityIcon from '@polkadot/react-identicon'; diff --git a/packages/react-components/src/AddressSmall.tsx b/packages/react-components/src/AddressSmall.tsx index 35d7c25a29..d3a7308d70 100644 --- a/packages/react-components/src/AddressSmall.tsx +++ b/packages/react-components/src/AddressSmall.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AccountId, Address } from '@polkadot/types/interfaces'; + import React from 'react'; import styled from 'styled-components'; -import type { AccountId, Address } from '@polkadot/types/interfaces'; - import AccountName from './AccountName'; import IdentityIcon from './IdentityIcon'; diff --git a/packages/react-components/src/AddressToggle.tsx b/packages/react-components/src/AddressToggle.tsx index 409db31fc1..cdca5ac141 100644 --- a/packages/react-components/src/AddressToggle.tsx +++ b/packages/react-components/src/AddressToggle.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveAccountInfo } from '@polkadot/api-derive/types'; + import React, { useCallback, useMemo } from 'react'; import styled from 'styled-components'; -import type { DeriveAccountInfo } from '@polkadot/api-derive/types'; import { useApi, useCall } from '@polkadot/react-hooks'; import AddressMini from './AddressMini'; diff --git a/packages/react-components/src/Available.tsx b/packages/react-components/src/Available.tsx index 0b5afd395b..7ec820f7db 100644 --- a/packages/react-components/src/Available.tsx +++ b/packages/react-components/src/Available.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; + import React from 'react'; -import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; import { Available } from '@polkadot/react-query'; export interface Props { diff --git a/packages/react-components/src/Badge.tsx b/packages/react-components/src/Badge.tsx index 07c7ede811..07819dfba4 100644 --- a/packages/react-components/src/Badge.tsx +++ b/packages/react-components/src/Badge.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { IconName } from '@fortawesome/fontawesome-svg-core'; + import React, { useState } from 'react'; import styled from 'styled-components'; diff --git a/packages/react-components/src/Balance.tsx b/packages/react-components/src/Balance.tsx index cdac821a7e..384a71db7b 100644 --- a/packages/react-components/src/Balance.tsx +++ b/packages/react-components/src/Balance.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; + import BN from 'bn.js'; import React from 'react'; -import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; import { Balance, FormatBalance } from '@polkadot/react-query'; import { BN_ZERO } from '@polkadot/util'; diff --git a/packages/react-components/src/Bonded.tsx b/packages/react-components/src/Bonded.tsx index a57695699d..aa6346af13 100644 --- a/packages/react-components/src/Bonded.tsx +++ b/packages/react-components/src/Bonded.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; + import BN from 'bn.js'; import React from 'react'; -import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; import { Bonded } from '@polkadot/react-query'; import { renderProvided } from './Balance'; diff --git a/packages/react-components/src/Button/Button.tsx b/packages/react-components/src/Button/Button.tsx index 72399256ab..4518bd3ac0 100644 --- a/packages/react-components/src/Button/Button.tsx +++ b/packages/react-components/src/Button/Button.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeProps } from '../types'; +import type { ButtonProps } from './types'; + import React, { useCallback } from 'react'; import styled from 'styled-components'; -import type { ThemeProps } from '../types'; -import type { ButtonProps } from './types'; import Icon from '../Icon'; import Spinner from '../Spinner'; diff --git a/packages/react-components/src/Button/Group.tsx b/packages/react-components/src/Button/Group.tsx index 590e80ad2e..57f54400b3 100644 --- a/packages/react-components/src/Button/Group.tsx +++ b/packages/react-components/src/Button/Group.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { GroupProps } from './types'; + import React from 'react'; import styled from 'styled-components'; -import type { GroupProps } from './types'; - function ButtonGroup ({ children, className = '', isCentered }: GroupProps): React.ReactElement { return (

diff --git a/packages/react-components/src/Button/index.tsx b/packages/react-components/src/Button/index.tsx index 6a53aa4ec5..9533c25fa3 100644 --- a/packages/react-components/src/Button/index.tsx +++ b/packages/react-components/src/Button/index.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { ButtonType } from './types'; + import IButton from './Button'; import Group from './Group'; diff --git a/packages/react-components/src/Button/types.ts b/packages/react-components/src/Button/types.ts index 3d4e026db1..bb2f6ee90f 100644 --- a/packages/react-components/src/Button/types.ts +++ b/packages/react-components/src/Button/types.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import type { IconName } from '@fortawesome/fontawesome-svg-core'; - import type { BareProps } from '../types'; export type Button$Callback = () => void | Promise; diff --git a/packages/react-components/src/Call.tsx b/packages/react-components/src/Call.tsx index cb6f6ad335..f6a458cbed 100644 --- a/packages/react-components/src/Call.tsx +++ b/packages/react-components/src/Call.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Hash } from '@polkadot/types/interfaces'; +import type { Codec, IExtrinsic, IMethod, TypeDef } from '@polkadot/types/types'; + import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; -import type { Hash } from '@polkadot/types/interfaces'; -import type { Codec, IExtrinsic, IMethod, TypeDef } from '@polkadot/types/types'; import Params from '@polkadot/react-params'; import { FormatBalance } from '@polkadot/react-query'; import { GenericCall, getTypeDef } from '@polkadot/types'; diff --git a/packages/react-components/src/CallExpander.tsx b/packages/react-components/src/CallExpander.tsx index 4205367d94..ee4628276c 100644 --- a/packages/react-components/src/CallExpander.tsx +++ b/packages/react-components/src/CallExpander.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { Call } from '@polkadot/types/interfaces'; +import React from 'react'; + import CallDisplay from './Call'; import Expander from './Expander'; diff --git a/packages/react-components/src/CardSummary.tsx b/packages/react-components/src/CardSummary.tsx index c7e2c32cda..9f2930bf58 100644 --- a/packages/react-components/src/CardSummary.tsx +++ b/packages/react-components/src/CardSummary.tsx @@ -1,15 +1,16 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { UInt } from '@polkadot/types'; +import type { ThemeProps } from './types'; + import BN from 'bn.js'; import React from 'react'; import styled from 'styled-components'; -import type { UInt } from '@polkadot/types'; import { BlockToTime } from '@polkadot/react-query'; import { formatNumber, isUndefined } from '@polkadot/util'; -import type { ThemeProps } from './types'; import Labelled from './Labelled'; import Progress from './Progress'; diff --git a/packages/react-components/src/Chart/Base.tsx b/packages/react-components/src/Chart/Base.tsx index 5804b189fc..f2befa6363 100644 --- a/packages/react-components/src/Chart/Base.tsx +++ b/packages/react-components/src/Chart/Base.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { BaseProps } from './types'; + import React from 'react'; import styled from 'styled-components'; -import type { BaseProps } from './types'; - const Wrapper = styled.div` position: relative; display: inline-block; diff --git a/packages/react-components/src/Chart/Doughnut.tsx b/packages/react-components/src/Chart/Doughnut.tsx index 0e49b5bca9..b2e3145925 100644 --- a/packages/react-components/src/Chart/Doughnut.tsx +++ b/packages/react-components/src/Chart/Doughnut.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DoughnutProps } from './types'; + import React from 'react'; import { Doughnut } from 'react-chartjs-2'; import { bnToBn } from '@polkadot/util'; -import type { DoughnutProps } from './types'; import Base from './Base'; interface Options { diff --git a/packages/react-components/src/Chart/HorizBar.tsx b/packages/react-components/src/Chart/HorizBar.tsx index 16a6f53380..be0382260b 100644 --- a/packages/react-components/src/Chart/HorizBar.tsx +++ b/packages/react-components/src/Chart/HorizBar.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { HorizBarProps, HorizBarValue } from './types'; + import ChartJs from 'chart.js'; import React, { useEffect, useState } from 'react'; import { HorizontalBar } from 'react-chartjs-2'; import { bnToBn, isNumber } from '@polkadot/util'; -import type { HorizBarProps, HorizBarValue } from './types'; - interface State { chartData?: ChartJs.ChartData; chartOptions?: ChartJs.ChartOptions; diff --git a/packages/react-components/src/Chart/Line.tsx b/packages/react-components/src/Chart/Line.tsx index b9759c8710..36d60ff87a 100644 --- a/packages/react-components/src/Chart/Line.tsx +++ b/packages/react-components/src/Chart/Line.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { LineProps } from './types'; + import BN from 'bn.js'; import ChartJs from 'chart.js'; import React, { useMemo } from 'react'; import * as Chart from 'react-chartjs-2'; -import type { LineProps } from './types'; - interface State { chartData: ChartJs.ChartData; chartOptions: ChartJs.ChartOptions; diff --git a/packages/react-components/src/Checkbox.tsx b/packages/react-components/src/Checkbox.tsx index 5b3a2e540a..184a7df312 100644 --- a/packages/react-components/src/Checkbox.tsx +++ b/packages/react-components/src/Checkbox.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeProps } from './types'; + import React, { useCallback } from 'react'; import styled from 'styled-components'; -import type { ThemeProps } from './types'; import Icon from './Icon'; interface Props { diff --git a/packages/react-components/src/Collection.tsx b/packages/react-components/src/Collection.tsx index b6f439c597..0978043e73 100644 --- a/packages/react-components/src/Collection.tsx +++ b/packages/react-components/src/Collection.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { I18nProps } from '@polkadot/react-components/types'; +import React from 'react'; + export interface CollectionProps extends I18nProps { banner?: React.ReactNode; buttons?: React.ReactNode; diff --git a/packages/react-components/src/ConvictionDropdown.tsx b/packages/react-components/src/ConvictionDropdown.tsx index b33cf1648d..49d74094ab 100644 --- a/packages/react-components/src/ConvictionDropdown.tsx +++ b/packages/react-components/src/ConvictionDropdown.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; + import BN from 'bn.js'; import React, { useRef } from 'react'; diff --git a/packages/react-components/src/CopyButton.tsx b/packages/react-components/src/CopyButton.tsx index a7dbcd9a50..519c4fe15c 100644 --- a/packages/react-components/src/CopyButton.tsx +++ b/packages/react-components/src/CopyButton.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { IconName } from '@fortawesome/fontawesome-svg-core'; + import React, { useCallback, useContext } from 'react'; import CopyToClipboard from 'react-copy-to-clipboard'; import styled from 'styled-components'; diff --git a/packages/react-components/src/CryptoType.tsx b/packages/react-components/src/CryptoType.tsx index 816da0df74..8a5f61bbcc 100644 --- a/packages/react-components/src/CryptoType.tsx +++ b/packages/react-components/src/CryptoType.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; + import React, { useEffect, useState } from 'react'; -import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; import keyring from '@polkadot/ui-keyring'; interface Props { diff --git a/packages/react-components/src/DemocracyLocks.tsx b/packages/react-components/src/DemocracyLocks.tsx index 769f425116..830ee966e0 100644 --- a/packages/react-components/src/DemocracyLocks.tsx +++ b/packages/react-components/src/DemocracyLocks.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveDemocracyLock } from '@polkadot/api-derive/types'; import type { TFunction } from 'i18next'; + import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; -import type { DeriveDemocracyLock } from '@polkadot/api-derive/types'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BlockToTime, FormatBalance } from '@polkadot/react-query'; import { BN_ZERO, bnMax, formatBalance, formatNumber } from '@polkadot/util'; diff --git a/packages/react-components/src/EditButton.tsx b/packages/react-components/src/EditButton.tsx index 40f7d2890f..7d85c6986d 100644 --- a/packages/react-components/src/EditButton.tsx +++ b/packages/react-components/src/EditButton.tsx @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { IconName } from '@fortawesome/fontawesome-svg-core'; +import type { VoidFn } from './types'; + import React from 'react'; import styled from 'styled-components'; -import type { VoidFn } from './types'; import Icon from './Icon'; import { colorLink } from './styles/theme'; diff --git a/packages/react-components/src/ErrorBoundary.tsx b/packages/react-components/src/ErrorBoundary.tsx index 64f8decebd..d799a207f1 100644 --- a/packages/react-components/src/ErrorBoundary.tsx +++ b/packages/react-components/src/ErrorBoundary.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { I18nProps } from './types'; + import React from 'react'; -import type { I18nProps } from './types'; import translate from './translate'; interface Props extends I18nProps { diff --git a/packages/react-components/src/Event.tsx b/packages/react-components/src/Event.tsx index 507076bdf3..bc1cef30cd 100644 --- a/packages/react-components/src/Event.tsx +++ b/packages/react-components/src/Event.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useMemo } from 'react'; - import type { DecodedEvent } from '@polkadot/api-contract/types'; import type { Bytes } from '@polkadot/types'; import type { Event } from '@polkadot/types/interfaces'; import type { Codec } from '@polkadot/types/types'; + +import React, { useMemo } from 'react'; + import { Input } from '@polkadot/react-components'; import Params from '@polkadot/react-params'; import { getTypeDef } from '@polkadot/types'; diff --git a/packages/react-components/src/Expander.tsx b/packages/react-components/src/Expander.tsx index 7779ad93bc..6b41cce37b 100644 --- a/packages/react-components/src/Expander.tsx +++ b/packages/react-components/src/Expander.tsx @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { IconName } from '@fortawesome/fontawesome-svg-core'; +import type { Text } from '@polkadot/types'; + import React, { useMemo } from 'react'; import styled from 'styled-components'; -import type { Text } from '@polkadot/types'; import { LabelHelp } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; diff --git a/packages/react-components/src/Extrinsic.tsx b/packages/react-components/src/Extrinsic.tsx index 839199fb2f..ab1395200b 100644 --- a/packages/react-components/src/Extrinsic.tsx +++ b/packages/react-components/src/Extrinsic.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-extrinsics authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useEffect, useState } from 'react'; - import type { SubmittableExtrinsic, SubmittableExtrinsicFunction } from '@polkadot/api/types'; import type { RawParam } from '@polkadot/react-params/types'; import type { TypeDef } from '@polkadot/types/types'; + +import React, { useCallback, useEffect, useState } from 'react'; + import Params from '@polkadot/react-params'; import { GenericCall } from '@polkadot/types'; import { getTypeDef } from '@polkadot/types/create'; diff --git a/packages/react-components/src/HelpOverlay.tsx b/packages/react-components/src/HelpOverlay.tsx index 99e0759c6a..eebe081a66 100644 --- a/packages/react-components/src/HelpOverlay.tsx +++ b/packages/react-components/src/HelpOverlay.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeProps } from './types'; + import React from 'react'; import ReactMd from 'react-markdown'; import styled from 'styled-components'; import { useToggle } from '@polkadot/react-hooks'; -import type { ThemeProps } from './types'; import Icon from './Icon'; interface Props { diff --git a/packages/react-components/src/Icon.tsx b/packages/react-components/src/Icon.tsx index a281e23318..35d310b06b 100644 --- a/packages/react-components/src/Icon.tsx +++ b/packages/react-components/src/Icon.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { IconName } from '@fortawesome/fontawesome-svg-core'; + import { library } from '@fortawesome/fontawesome-svg-core'; import { fas } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; diff --git a/packages/react-components/src/IdentityIcon/RoboHash/index.tsx b/packages/react-components/src/IdentityIcon/RoboHash/index.tsx index 65f548dfcc..065f65b864 100644 --- a/packages/react-components/src/IdentityIcon/RoboHash/index.tsx +++ b/packages/react-components/src/IdentityIcon/RoboHash/index.tsx @@ -10,12 +10,13 @@ // The Cats/"set4" were created by David Revoy, used under CC-BY-4.0 https://www.peppercarrot.com/en/article391/cat-avatar-generator // The avatars used in "set5" were created by Pablo Stanley, for https://avataaars.com/ They are "Free for personal and commercial use. đŸ˜‡" +import type { ThemeProps } from '../../types'; + import React, { useMemo } from 'react'; import styled from 'styled-components'; import { blake2AsU8a } from '@polkadot/util-crypto'; -import type { ThemeProps } from '../../types'; import backgrounds from './backgrounds'; import sets from './sets'; diff --git a/packages/react-components/src/IdentityIcon/RoboHash/sets/index.ts b/packages/react-components/src/IdentityIcon/RoboHash/sets/index.ts index 39a08cbc51..988499b45d 100644 --- a/packages/react-components/src/IdentityIcon/RoboHash/sets/index.ts +++ b/packages/react-components/src/IdentityIcon/RoboHash/sets/index.ts @@ -835,6 +835,7 @@ import s013006010 from './set5/003-Mouth/Twinkle.png'; import s013006011 from './set5/003-Mouth/Vomit.png'; import s013002000 from './set5/004-Cloth/BlazerShirt.png'; import s013002001 from './set5/004-Cloth/BlazerSweater.png'; +import s013002016 from './set5/004-Cloth/CollarSweater.png'; import s013002002 from './set5/004-Cloth/CollarSweater-Black.png'; import s013002003 from './set5/004-Cloth/CollarSweater-Blue01.png'; import s013002004 from './set5/004-Cloth/CollarSweater-Blue02.png'; @@ -849,7 +850,7 @@ import s013002012 from './set5/004-Cloth/CollarSweater-PastelYellow.png'; import s013002013 from './set5/004-Cloth/CollarSweater-Pink.png'; import s013002014 from './set5/004-Cloth/CollarSweater-Red.png'; import s013002015 from './set5/004-Cloth/CollarSweater-White.png'; -import s013002016 from './set5/004-Cloth/CollarSweater.png'; +import s013002181 from './set5/004-Cloth/GraphicShirt.png'; import s013002017 from './set5/004-Cloth/GraphicShirt--Bat.png'; import s013002018 from './set5/004-Cloth/GraphicShirt--Bear.png'; import s013002019 from './set5/004-Cloth/GraphicShirt--Cumbia.png'; @@ -860,6 +861,7 @@ import s013002023 from './set5/004-Cloth/GraphicShirt--Pizza.png'; import s013002024 from './set5/004-Cloth/GraphicShirt--Resist.png'; import s013002025 from './set5/004-Cloth/GraphicShirt--Selena.png'; import s013002026 from './set5/004-Cloth/GraphicShirt--SkullOutline.png'; +import s013002037 from './set5/004-Cloth/GraphicShirt-Black.png'; import s013002027 from './set5/004-Cloth/GraphicShirt-Black-Bat.png'; import s013002028 from './set5/004-Cloth/GraphicShirt-Black-Bear.png'; import s013002029 from './set5/004-Cloth/GraphicShirt-Black-Cumbia.png'; @@ -870,7 +872,7 @@ import s013002033 from './set5/004-Cloth/GraphicShirt-Black-Pizza.png'; import s013002034 from './set5/004-Cloth/GraphicShirt-Black-Resist.png'; import s013002035 from './set5/004-Cloth/GraphicShirt-Black-Selena.png'; import s013002036 from './set5/004-Cloth/GraphicShirt-Black-SkullOutline.png'; -import s013002037 from './set5/004-Cloth/GraphicShirt-Black.png'; +import s013002048 from './set5/004-Cloth/GraphicShirt-Blue01.png'; import s013002038 from './set5/004-Cloth/GraphicShirt-Blue01-Bat.png'; import s013002039 from './set5/004-Cloth/GraphicShirt-Blue01-Bear.png'; import s013002040 from './set5/004-Cloth/GraphicShirt-Blue01-Cumbia.png'; @@ -881,7 +883,7 @@ import s013002044 from './set5/004-Cloth/GraphicShirt-Blue01-Pizza.png'; import s013002045 from './set5/004-Cloth/GraphicShirt-Blue01-Resist.png'; import s013002046 from './set5/004-Cloth/GraphicShirt-Blue01-Selena.png'; import s013002047 from './set5/004-Cloth/GraphicShirt-Blue01-SkullOutline.png'; -import s013002048 from './set5/004-Cloth/GraphicShirt-Blue01.png'; +import s013002059 from './set5/004-Cloth/GraphicShirt-Blue02.png'; import s013002049 from './set5/004-Cloth/GraphicShirt-Blue02-Bat.png'; import s013002050 from './set5/004-Cloth/GraphicShirt-Blue02-Bear.png'; import s013002051 from './set5/004-Cloth/GraphicShirt-Blue02-Cumbia.png'; @@ -892,7 +894,7 @@ import s013002055 from './set5/004-Cloth/GraphicShirt-Blue02-Pizza.png'; import s013002056 from './set5/004-Cloth/GraphicShirt-Blue02-Resist.png'; import s013002057 from './set5/004-Cloth/GraphicShirt-Blue02-Selena.png'; import s013002058 from './set5/004-Cloth/GraphicShirt-Blue02-SkullOutline.png'; -import s013002059 from './set5/004-Cloth/GraphicShirt-Blue02.png'; +import s013002070 from './set5/004-Cloth/GraphicShirt-Blue03.png'; import s013002060 from './set5/004-Cloth/GraphicShirt-Blue03-Bat.png'; import s013002061 from './set5/004-Cloth/GraphicShirt-Blue03-Bear.png'; import s013002062 from './set5/004-Cloth/GraphicShirt-Blue03-Cumbia.png'; @@ -903,7 +905,7 @@ import s013002066 from './set5/004-Cloth/GraphicShirt-Blue03-Pizza.png'; import s013002067 from './set5/004-Cloth/GraphicShirt-Blue03-Resist.png'; import s013002068 from './set5/004-Cloth/GraphicShirt-Blue03-Selena.png'; import s013002069 from './set5/004-Cloth/GraphicShirt-Blue03-SkullOutline.png'; -import s013002070 from './set5/004-Cloth/GraphicShirt-Blue03.png'; +import s013002081 from './set5/004-Cloth/GraphicShirt-Gray02.png'; import s013002071 from './set5/004-Cloth/GraphicShirt-Gray02-Bat.png'; import s013002072 from './set5/004-Cloth/GraphicShirt-Gray02-Bear.png'; import s013002073 from './set5/004-Cloth/GraphicShirt-Gray02-Cumbia.png'; @@ -914,7 +916,7 @@ import s013002077 from './set5/004-Cloth/GraphicShirt-Gray02-Pizza.png'; import s013002078 from './set5/004-Cloth/GraphicShirt-Gray02-Resist.png'; import s013002079 from './set5/004-Cloth/GraphicShirt-Gray02-Selena.png'; import s013002080 from './set5/004-Cloth/GraphicShirt-Gray02-SkullOutline.png'; -import s013002081 from './set5/004-Cloth/GraphicShirt-Gray02.png'; +import s013002092 from './set5/004-Cloth/GraphicShirt-Heather.png'; import s013002082 from './set5/004-Cloth/GraphicShirt-Heather-Bat.png'; import s013002083 from './set5/004-Cloth/GraphicShirt-Heather-Bear.png'; import s013002084 from './set5/004-Cloth/GraphicShirt-Heather-Cumbia.png'; @@ -925,7 +927,7 @@ import s013002088 from './set5/004-Cloth/GraphicShirt-Heather-Pizza.png'; import s013002089 from './set5/004-Cloth/GraphicShirt-Heather-Resist.png'; import s013002090 from './set5/004-Cloth/GraphicShirt-Heather-Selena.png'; import s013002091 from './set5/004-Cloth/GraphicShirt-Heather-SkullOutline.png'; -import s013002092 from './set5/004-Cloth/GraphicShirt-Heather.png'; +import s013002103 from './set5/004-Cloth/GraphicShirt-PastelBlue.png'; import s013002093 from './set5/004-Cloth/GraphicShirt-PastelBlue-Bat.png'; import s013002094 from './set5/004-Cloth/GraphicShirt-PastelBlue-Bear.png'; import s013002095 from './set5/004-Cloth/GraphicShirt-PastelBlue-Cumbia.png'; @@ -936,7 +938,7 @@ import s013002099 from './set5/004-Cloth/GraphicShirt-PastelBlue-Pizza.png'; import s013002100 from './set5/004-Cloth/GraphicShirt-PastelBlue-Resist.png'; import s013002101 from './set5/004-Cloth/GraphicShirt-PastelBlue-Selena.png'; import s013002102 from './set5/004-Cloth/GraphicShirt-PastelBlue-SkullOutline.png'; -import s013002103 from './set5/004-Cloth/GraphicShirt-PastelBlue.png'; +import s013002114 from './set5/004-Cloth/GraphicShirt-PastelGreen.png'; import s013002104 from './set5/004-Cloth/GraphicShirt-PastelGreen-Bat.png'; import s013002105 from './set5/004-Cloth/GraphicShirt-PastelGreen-Bear.png'; import s013002106 from './set5/004-Cloth/GraphicShirt-PastelGreen-Cumbia.png'; @@ -947,7 +949,7 @@ import s013002110 from './set5/004-Cloth/GraphicShirt-PastelGreen-Pizza.png'; import s013002111 from './set5/004-Cloth/GraphicShirt-PastelGreen-Resist.png'; import s013002112 from './set5/004-Cloth/GraphicShirt-PastelGreen-Selena.png'; import s013002113 from './set5/004-Cloth/GraphicShirt-PastelGreen-SkullOutline.png'; -import s013002114 from './set5/004-Cloth/GraphicShirt-PastelGreen.png'; +import s013002125 from './set5/004-Cloth/GraphicShirt-PastelOrange.png'; import s013002115 from './set5/004-Cloth/GraphicShirt-PastelOrange-Bat.png'; import s013002116 from './set5/004-Cloth/GraphicShirt-PastelOrange-Bear.png'; import s013002117 from './set5/004-Cloth/GraphicShirt-PastelOrange-Cumbia.png'; @@ -958,7 +960,7 @@ import s013002121 from './set5/004-Cloth/GraphicShirt-PastelOrange-Pizza.png'; import s013002122 from './set5/004-Cloth/GraphicShirt-PastelOrange-Resist.png'; import s013002123 from './set5/004-Cloth/GraphicShirt-PastelOrange-Selena.png'; import s013002124 from './set5/004-Cloth/GraphicShirt-PastelOrange-SkullOutline.png'; -import s013002125 from './set5/004-Cloth/GraphicShirt-PastelOrange.png'; +import s013002136 from './set5/004-Cloth/GraphicShirt-PastelRed.png'; import s013002126 from './set5/004-Cloth/GraphicShirt-PastelRed-Bat.png'; import s013002127 from './set5/004-Cloth/GraphicShirt-PastelRed-Bear.png'; import s013002128 from './set5/004-Cloth/GraphicShirt-PastelRed-Cumbia.png'; @@ -969,7 +971,7 @@ import s013002132 from './set5/004-Cloth/GraphicShirt-PastelRed-Pizza.png'; import s013002133 from './set5/004-Cloth/GraphicShirt-PastelRed-Resist.png'; import s013002134 from './set5/004-Cloth/GraphicShirt-PastelRed-Selena.png'; import s013002135 from './set5/004-Cloth/GraphicShirt-PastelRed-SkullOutline.png'; -import s013002136 from './set5/004-Cloth/GraphicShirt-PastelRed.png'; +import s013002147 from './set5/004-Cloth/GraphicShirt-PastelYellow.png'; import s013002137 from './set5/004-Cloth/GraphicShirt-PastelYellow-Bat.png'; import s013002138 from './set5/004-Cloth/GraphicShirt-PastelYellow-Bear.png'; import s013002139 from './set5/004-Cloth/GraphicShirt-PastelYellow-Cumbia.png'; @@ -980,7 +982,7 @@ import s013002143 from './set5/004-Cloth/GraphicShirt-PastelYellow-Pizza.png'; import s013002144 from './set5/004-Cloth/GraphicShirt-PastelYellow-Resist.png'; import s013002145 from './set5/004-Cloth/GraphicShirt-PastelYellow-Selena.png'; import s013002146 from './set5/004-Cloth/GraphicShirt-PastelYellow-SkullOutline.png'; -import s013002147 from './set5/004-Cloth/GraphicShirt-PastelYellow.png'; +import s013002158 from './set5/004-Cloth/GraphicShirt-Pink.png'; import s013002148 from './set5/004-Cloth/GraphicShirt-Pink-Bat.png'; import s013002149 from './set5/004-Cloth/GraphicShirt-Pink-Bear.png'; import s013002150 from './set5/004-Cloth/GraphicShirt-Pink-Cumbia.png'; @@ -991,7 +993,7 @@ import s013002154 from './set5/004-Cloth/GraphicShirt-Pink-Pizza.png'; import s013002155 from './set5/004-Cloth/GraphicShirt-Pink-Resist.png'; import s013002156 from './set5/004-Cloth/GraphicShirt-Pink-Selena.png'; import s013002157 from './set5/004-Cloth/GraphicShirt-Pink-SkullOutline.png'; -import s013002158 from './set5/004-Cloth/GraphicShirt-Pink.png'; +import s013002169 from './set5/004-Cloth/GraphicShirt-Red.png'; import s013002159 from './set5/004-Cloth/GraphicShirt-Red-Bat.png'; import s013002160 from './set5/004-Cloth/GraphicShirt-Red-Bear.png'; import s013002161 from './set5/004-Cloth/GraphicShirt-Red-Cumbia.png'; @@ -1002,7 +1004,7 @@ import s013002165 from './set5/004-Cloth/GraphicShirt-Red-Pizza.png'; import s013002166 from './set5/004-Cloth/GraphicShirt-Red-Resist.png'; import s013002167 from './set5/004-Cloth/GraphicShirt-Red-Selena.png'; import s013002168 from './set5/004-Cloth/GraphicShirt-Red-SkullOutline.png'; -import s013002169 from './set5/004-Cloth/GraphicShirt-Red.png'; +import s013002180 from './set5/004-Cloth/GraphicShirt-White.png'; import s013002170 from './set5/004-Cloth/GraphicShirt-White-Bat.png'; import s013002171 from './set5/004-Cloth/GraphicShirt-White-Bear.png'; import s013002172 from './set5/004-Cloth/GraphicShirt-White-Cumbia.png'; @@ -1013,8 +1015,7 @@ import s013002176 from './set5/004-Cloth/GraphicShirt-White-Pizza.png'; import s013002177 from './set5/004-Cloth/GraphicShirt-White-Resist.png'; import s013002178 from './set5/004-Cloth/GraphicShirt-White-Selena.png'; import s013002179 from './set5/004-Cloth/GraphicShirt-White-SkullOutline.png'; -import s013002180 from './set5/004-Cloth/GraphicShirt-White.png'; -import s013002181 from './set5/004-Cloth/GraphicShirt.png'; +import s013002196 from './set5/004-Cloth/Hoodie.png'; import s013002182 from './set5/004-Cloth/Hoodie-Black.png'; import s013002183 from './set5/004-Cloth/Hoodie-Blue01.png'; import s013002184 from './set5/004-Cloth/Hoodie-Blue02.png'; @@ -1029,7 +1030,7 @@ import s013002192 from './set5/004-Cloth/Hoodie-PastelYellow.png'; import s013002193 from './set5/004-Cloth/Hoodie-Pink.png'; import s013002194 from './set5/004-Cloth/Hoodie-Red.png'; import s013002195 from './set5/004-Cloth/Hoodie-White.png'; -import s013002196 from './set5/004-Cloth/Hoodie.png'; +import s013002211 from './set5/004-Cloth/Overall.png'; import s013002197 from './set5/004-Cloth/Overall-Black.png'; import s013002198 from './set5/004-Cloth/Overall-Blue01.png'; import s013002199 from './set5/004-Cloth/Overall-Blue02.png'; @@ -1044,7 +1045,7 @@ import s013002207 from './set5/004-Cloth/Overall-PastelYellow.png'; import s013002208 from './set5/004-Cloth/Overall-Pink.png'; import s013002209 from './set5/004-Cloth/Overall-Red.png'; import s013002210 from './set5/004-Cloth/Overall-White.png'; -import s013002211 from './set5/004-Cloth/Overall.png'; +import s013002226 from './set5/004-Cloth/ShirtCrewNeck.png'; import s013002212 from './set5/004-Cloth/ShirtCrewNeck-Black.png'; import s013002213 from './set5/004-Cloth/ShirtCrewNeck-Blue01.png'; import s013002214 from './set5/004-Cloth/ShirtCrewNeck-Blue02.png'; @@ -1059,7 +1060,7 @@ import s013002222 from './set5/004-Cloth/ShirtCrewNeck-PastelYellow.png'; import s013002223 from './set5/004-Cloth/ShirtCrewNeck-Pink.png'; import s013002224 from './set5/004-Cloth/ShirtCrewNeck-Red.png'; import s013002225 from './set5/004-Cloth/ShirtCrewNeck-White.png'; -import s013002226 from './set5/004-Cloth/ShirtCrewNeck.png'; +import s013002241 from './set5/004-Cloth/ShirtScoopNeck.png'; import s013002227 from './set5/004-Cloth/ShirtScoopNeck-Black.png'; import s013002228 from './set5/004-Cloth/ShirtScoopNeck-Blue01.png'; import s013002229 from './set5/004-Cloth/ShirtScoopNeck-Blue02.png'; @@ -1074,8 +1075,8 @@ import s013002237 from './set5/004-Cloth/ShirtScoopNeck-PastelYellow.png'; import s013002238 from './set5/004-Cloth/ShirtScoopNeck-Pink.png'; import s013002239 from './set5/004-Cloth/ShirtScoopNeck-Red.png'; import s013002240 from './set5/004-Cloth/ShirtScoopNeck-White.png'; -import s013002241 from './set5/004-Cloth/ShirtScoopNeck.png'; import s013002242 from './set5/004-Cloth/ShirtVNeck.png'; +import s013005008 from './set5/005-FacialHair/BeardLight.png'; import s013005000 from './set5/005-FacialHair/BeardLight-Auburn.png'; import s013005001 from './set5/005-FacialHair/BeardLight-Black.png'; import s013005002 from './set5/005-FacialHair/BeardLight-Blonde.png'; @@ -1084,7 +1085,7 @@ import s013005004 from './set5/005-FacialHair/BeardLight-Brown.png'; import s013005005 from './set5/005-FacialHair/BeardLight-BrownDark.png'; import s013005006 from './set5/005-FacialHair/BeardLight-Platinum.png'; import s013005007 from './set5/005-FacialHair/BeardLight-Red.png'; -import s013005008 from './set5/005-FacialHair/BeardLight.png'; +import s013005017 from './set5/005-FacialHair/BeardMagestic.png'; import s013005009 from './set5/005-FacialHair/BeardMagestic-Auburn.png'; import s013005010 from './set5/005-FacialHair/BeardMagestic-Black.png'; import s013005011 from './set5/005-FacialHair/BeardMagestic-Blonde.png'; @@ -1093,7 +1094,7 @@ import s013005013 from './set5/005-FacialHair/BeardMagestic-Brown.png'; import s013005014 from './set5/005-FacialHair/BeardMagestic-BrownDark.png'; import s013005015 from './set5/005-FacialHair/BeardMagestic-Platinum.png'; import s013005016 from './set5/005-FacialHair/BeardMagestic-Red.png'; -import s013005017 from './set5/005-FacialHair/BeardMagestic.png'; +import s013005026 from './set5/005-FacialHair/BeardMedium.png'; import s013005018 from './set5/005-FacialHair/BeardMedium-Auburn.png'; import s013005019 from './set5/005-FacialHair/BeardMedium-Black.png'; import s013005020 from './set5/005-FacialHair/BeardMedium-Blonde.png'; @@ -1102,7 +1103,6 @@ import s013005022 from './set5/005-FacialHair/BeardMedium-Brown.png'; import s013005023 from './set5/005-FacialHair/BeardMedium-BrownDark.png'; import s013005024 from './set5/005-FacialHair/BeardMedium-Platinum.png'; import s013005025 from './set5/005-FacialHair/BeardMedium-Red.png'; -import s013005026 from './set5/005-FacialHair/BeardMedium.png'; import s013005027 from './set5/005-FacialHair/Blush.png'; import s013005028 from './set5/005-FacialHair/FrecklesHeavy001.png'; import s013005029 from './set5/005-FacialHair/FrecklesLight001.png'; @@ -1111,6 +1111,7 @@ import s013005031 from './set5/005-FacialHair/FrecklesLight003.png'; import s013005032 from './set5/005-FacialHair/FrecklesLight004.png'; import s013005033 from './set5/005-FacialHair/FrecklesLight005.png'; import s013005034 from './set5/005-FacialHair/FrecklesLight006.png'; +import s013005043 from './set5/005-FacialHair/MoustacheFancy.png'; import s013005035 from './set5/005-FacialHair/MoustacheFancy-Auburn.png'; import s013005036 from './set5/005-FacialHair/MoustacheFancy-Black.png'; import s013005037 from './set5/005-FacialHair/MoustacheFancy-Blonde.png'; @@ -1119,7 +1120,7 @@ import s013005039 from './set5/005-FacialHair/MoustacheFancy-Brown.png'; import s013005040 from './set5/005-FacialHair/MoustacheFancy-BrownDark.png'; import s013005041 from './set5/005-FacialHair/MoustacheFancy-Platinum.png'; import s013005042 from './set5/005-FacialHair/MoustacheFancy-Red.png'; -import s013005043 from './set5/005-FacialHair/MoustacheFancy.png'; +import s013005052 from './set5/005-FacialHair/MoustacheMagnum.png'; import s013005044 from './set5/005-FacialHair/MoustacheMagnum-Auburn.png'; import s013005045 from './set5/005-FacialHair/MoustacheMagnum-Black.png'; import s013005046 from './set5/005-FacialHair/MoustacheMagnum-Blonde.png'; @@ -1128,13 +1129,13 @@ import s013005048 from './set5/005-FacialHair/MoustacheMagnum-Brown.png'; import s013005049 from './set5/005-FacialHair/MoustacheMagnum-BrownDark.png'; import s013005050 from './set5/005-FacialHair/MoustacheMagnum-Platinum.png'; import s013005051 from './set5/005-FacialHair/MoustacheMagnum-Red.png'; -import s013005052 from './set5/005-FacialHair/MoustacheMagnum.png'; import s013005053 from './set5/005-FacialHair/RedDot.png'; import s013005054 from './set5/005-FacialHair/Wrinkle.png'; import s013005055 from './set5/005-FacialHair/WrinkleTop.png'; import s013007000 from './set5/006-Top/Blank.png'; import s013007001 from './set5/006-Top/Eyepatch.png'; import s013007002 from './set5/006-Top/Hat.png'; +import s013007018 from './set5/006-Top/Hijab.png'; import s013007003 from './set5/006-Top/Hijab-Black.png'; import s013007004 from './set5/006-Top/Hijab-Blue01.png'; import s013007005 from './set5/006-Top/Hijab-Blue02.png'; @@ -1150,7 +1151,7 @@ import s013007014 from './set5/006-Top/Hijab-PastelYellow.png'; import s013007015 from './set5/006-Top/Hijab-Pink.png'; import s013007016 from './set5/006-Top/Hijab-Red.png'; import s013007017 from './set5/006-Top/Hijab-White.png'; -import s013007018 from './set5/006-Top/Hijab.png'; +import s013007029 from './set5/006-Top/LongHairBigHair.png'; import s013007019 from './set5/006-Top/LongHairBigHair-Auburn.png'; import s013007020 from './set5/006-Top/LongHairBigHair-Black.png'; import s013007021 from './set5/006-Top/LongHairBigHair-Blonde.png'; @@ -1161,7 +1162,7 @@ import s013007025 from './set5/006-Top/LongHairBigHair-Pink.png'; import s013007026 from './set5/006-Top/LongHairBigHair-Platinum.png'; import s013007027 from './set5/006-Top/LongHairBigHair-Red.png'; import s013007028 from './set5/006-Top/LongHairBigHair-SilverGray.png'; -import s013007029 from './set5/006-Top/LongHairBigHair.png'; +import s013007040 from './set5/006-Top/LongHairBob.png'; import s013007030 from './set5/006-Top/LongHairBob-Auburn.png'; import s013007031 from './set5/006-Top/LongHairBob-Black.png'; import s013007032 from './set5/006-Top/LongHairBob-Blonde.png'; @@ -1172,7 +1173,7 @@ import s013007036 from './set5/006-Top/LongHairBob-Pink.png'; import s013007037 from './set5/006-Top/LongHairBob-Platinum.png'; import s013007038 from './set5/006-Top/LongHairBob-Red.png'; import s013007039 from './set5/006-Top/LongHairBob-SilverGray.png'; -import s013007040 from './set5/006-Top/LongHairBob.png'; +import s013007051 from './set5/006-Top/LongHairBun.png'; import s013007041 from './set5/006-Top/LongHairBun-Auburn.png'; import s013007042 from './set5/006-Top/LongHairBun-Black.png'; import s013007043 from './set5/006-Top/LongHairBun-Blonde.png'; @@ -1183,7 +1184,7 @@ import s013007047 from './set5/006-Top/LongHairBun-Pink.png'; import s013007048 from './set5/006-Top/LongHairBun-Platinum.png'; import s013007049 from './set5/006-Top/LongHairBun-Red.png'; import s013007050 from './set5/006-Top/LongHairBun-SilverGray.png'; -import s013007051 from './set5/006-Top/LongHairBun.png'; +import s013007062 from './set5/006-Top/LongHairCurly.png'; import s013007052 from './set5/006-Top/LongHairCurly-Auburn.png'; import s013007053 from './set5/006-Top/LongHairCurly-Black.png'; import s013007054 from './set5/006-Top/LongHairCurly-Blonde.png'; @@ -1194,7 +1195,7 @@ import s013007058 from './set5/006-Top/LongHairCurly-Pink.png'; import s013007059 from './set5/006-Top/LongHairCurly-Platinum.png'; import s013007060 from './set5/006-Top/LongHairCurly-Red.png'; import s013007061 from './set5/006-Top/LongHairCurly-SilverGray.png'; -import s013007062 from './set5/006-Top/LongHairCurly.png'; +import s013007073 from './set5/006-Top/LongHairCurvy.png'; import s013007063 from './set5/006-Top/LongHairCurvy-Auburn.png'; import s013007064 from './set5/006-Top/LongHairCurvy-Black.png'; import s013007065 from './set5/006-Top/LongHairCurvy-Blonde.png'; @@ -1205,7 +1206,7 @@ import s013007069 from './set5/006-Top/LongHairCurvy-Pink.png'; import s013007070 from './set5/006-Top/LongHairCurvy-Platinum.png'; import s013007071 from './set5/006-Top/LongHairCurvy-Red.png'; import s013007072 from './set5/006-Top/LongHairCurvy-SilverGray.png'; -import s013007073 from './set5/006-Top/LongHairCurvy.png'; +import s013007084 from './set5/006-Top/LongHairDreads.png'; import s013007074 from './set5/006-Top/LongHairDreads-Auburn.png'; import s013007075 from './set5/006-Top/LongHairDreads-Black.png'; import s013007076 from './set5/006-Top/LongHairDreads-Blonde.png'; @@ -1216,8 +1217,8 @@ import s013007080 from './set5/006-Top/LongHairDreads-Pink.png'; import s013007081 from './set5/006-Top/LongHairDreads-Platinum.png'; import s013007082 from './set5/006-Top/LongHairDreads-Red.png'; import s013007083 from './set5/006-Top/LongHairDreads-SilverGray.png'; -import s013007084 from './set5/006-Top/LongHairDreads.png'; import s013007085 from './set5/006-Top/LongHairFrida.png'; +import s013007096 from './set5/006-Top/LongHairFro.png'; import s013007086 from './set5/006-Top/LongHairFro-Auburn.png'; import s013007087 from './set5/006-Top/LongHairFro-Black.png'; import s013007088 from './set5/006-Top/LongHairFro-Blonde.png'; @@ -1228,7 +1229,7 @@ import s013007092 from './set5/006-Top/LongHairFro-Pink.png'; import s013007093 from './set5/006-Top/LongHairFro-Platinum.png'; import s013007094 from './set5/006-Top/LongHairFro-Red.png'; import s013007095 from './set5/006-Top/LongHairFro-SilverGray.png'; -import s013007096 from './set5/006-Top/LongHairFro.png'; +import s013007107 from './set5/006-Top/LongHairFroBand.png'; import s013007097 from './set5/006-Top/LongHairFroBand-Auburn.png'; import s013007098 from './set5/006-Top/LongHairFroBand-Black.png'; import s013007099 from './set5/006-Top/LongHairFroBand-Blonde.png'; @@ -1239,7 +1240,7 @@ import s013007103 from './set5/006-Top/LongHairFroBand-Pink.png'; import s013007104 from './set5/006-Top/LongHairFroBand-Platinum.png'; import s013007105 from './set5/006-Top/LongHairFroBand-Red.png'; import s013007106 from './set5/006-Top/LongHairFroBand-SilverGray.png'; -import s013007107 from './set5/006-Top/LongHairFroBand.png'; +import s013007118 from './set5/006-Top/LongHairMiaWallace.png'; import s013007108 from './set5/006-Top/LongHairMiaWallace-Auburn.png'; import s013007109 from './set5/006-Top/LongHairMiaWallace-Black.png'; import s013007110 from './set5/006-Top/LongHairMiaWallace-Blonde.png'; @@ -1250,7 +1251,7 @@ import s013007114 from './set5/006-Top/LongHairMiaWallace-Pink.png'; import s013007115 from './set5/006-Top/LongHairMiaWallace-Platinum.png'; import s013007116 from './set5/006-Top/LongHairMiaWallace-Red.png'; import s013007117 from './set5/006-Top/LongHairMiaWallace-SilverGray.png'; -import s013007118 from './set5/006-Top/LongHairMiaWallace.png'; +import s013007129 from './set5/006-Top/LongHairNotTooLong.png'; import s013007119 from './set5/006-Top/LongHairNotTooLong-Auburn.png'; import s013007120 from './set5/006-Top/LongHairNotTooLong-Black.png'; import s013007121 from './set5/006-Top/LongHairNotTooLong-Blonde.png'; @@ -1261,8 +1262,8 @@ import s013007125 from './set5/006-Top/LongHairNotTooLong-Pink.png'; import s013007126 from './set5/006-Top/LongHairNotTooLong-Platinum.png'; import s013007127 from './set5/006-Top/LongHairNotTooLong-Red.png'; import s013007128 from './set5/006-Top/LongHairNotTooLong-SilverGray.png'; -import s013007129 from './set5/006-Top/LongHairNotTooLong.png'; import s013007130 from './set5/006-Top/LongHairShavedSides.png'; +import s013007141 from './set5/006-Top/LongHairStraight.png'; import s013007131 from './set5/006-Top/LongHairStraight-Auburn.png'; import s013007132 from './set5/006-Top/LongHairStraight-Black.png'; import s013007133 from './set5/006-Top/LongHairStraight-Blonde.png'; @@ -1273,7 +1274,7 @@ import s013007137 from './set5/006-Top/LongHairStraight-Pink.png'; import s013007138 from './set5/006-Top/LongHairStraight-Platinum.png'; import s013007139 from './set5/006-Top/LongHairStraight-Red.png'; import s013007140 from './set5/006-Top/LongHairStraight-SilverGray.png'; -import s013007141 from './set5/006-Top/LongHairStraight.png'; +import s013007152 from './set5/006-Top/LongHairStraight2.png'; import s013007142 from './set5/006-Top/LongHairStraight2-Auburn.png'; import s013007143 from './set5/006-Top/LongHairStraight2-Black.png'; import s013007144 from './set5/006-Top/LongHairStraight2-Blonde.png'; @@ -1284,7 +1285,7 @@ import s013007148 from './set5/006-Top/LongHairStraight2-Pink.png'; import s013007149 from './set5/006-Top/LongHairStraight2-Platinum.png'; import s013007150 from './set5/006-Top/LongHairStraight2-Red.png'; import s013007151 from './set5/006-Top/LongHairStraight2-SilverGray.png'; -import s013007152 from './set5/006-Top/LongHairStraight2.png'; +import s013007163 from './set5/006-Top/LongHairStraightStrand.png'; import s013007153 from './set5/006-Top/LongHairStraightStrand-Auburn.png'; import s013007154 from './set5/006-Top/LongHairStraightStrand-Black.png'; import s013007155 from './set5/006-Top/LongHairStraightStrand-Blonde.png'; @@ -1295,7 +1296,7 @@ import s013007159 from './set5/006-Top/LongHairStraightStrand-Pink.png'; import s013007160 from './set5/006-Top/LongHairStraightStrand-Platinum.png'; import s013007161 from './set5/006-Top/LongHairStraightStrand-Red.png'; import s013007162 from './set5/006-Top/LongHairStraightStrand-SilverGray.png'; -import s013007163 from './set5/006-Top/LongHairStraightStrand.png'; +import s013007174 from './set5/006-Top/ShortHairDreads01.png'; import s013007164 from './set5/006-Top/ShortHairDreads01-Auburn.png'; import s013007165 from './set5/006-Top/ShortHairDreads01-Black.png'; import s013007166 from './set5/006-Top/ShortHairDreads01-Blonde.png'; @@ -1306,7 +1307,7 @@ import s013007170 from './set5/006-Top/ShortHairDreads01-Pink.png'; import s013007171 from './set5/006-Top/ShortHairDreads01-Platinum.png'; import s013007172 from './set5/006-Top/ShortHairDreads01-Red.png'; import s013007173 from './set5/006-Top/ShortHairDreads01-SilverGray.png'; -import s013007174 from './set5/006-Top/ShortHairDreads01.png'; +import s013007185 from './set5/006-Top/ShortHairDreads02.png'; import s013007175 from './set5/006-Top/ShortHairDreads02-Auburn.png'; import s013007176 from './set5/006-Top/ShortHairDreads02-Black.png'; import s013007177 from './set5/006-Top/ShortHairDreads02-Blonde.png'; @@ -1317,7 +1318,7 @@ import s013007181 from './set5/006-Top/ShortHairDreads02-Pink.png'; import s013007182 from './set5/006-Top/ShortHairDreads02-Platinum.png'; import s013007183 from './set5/006-Top/ShortHairDreads02-Red.png'; import s013007184 from './set5/006-Top/ShortHairDreads02-SilverGray.png'; -import s013007185 from './set5/006-Top/ShortHairDreads02.png'; +import s013007196 from './set5/006-Top/ShortHairFrizzle.png'; import s013007186 from './set5/006-Top/ShortHairFrizzle-Auburn.png'; import s013007187 from './set5/006-Top/ShortHairFrizzle-Black.png'; import s013007188 from './set5/006-Top/ShortHairFrizzle-Blonde.png'; @@ -1328,7 +1329,7 @@ import s013007192 from './set5/006-Top/ShortHairFrizzle-Pink.png'; import s013007193 from './set5/006-Top/ShortHairFrizzle-Platinum.png'; import s013007194 from './set5/006-Top/ShortHairFrizzle-Red.png'; import s013007195 from './set5/006-Top/ShortHairFrizzle-SilverGray.png'; -import s013007196 from './set5/006-Top/ShortHairFrizzle.png'; +import s013007207 from './set5/006-Top/ShortHairShaggyMullet.png'; import s013007197 from './set5/006-Top/ShortHairShaggyMullet-Auburn.png'; import s013007198 from './set5/006-Top/ShortHairShaggyMullet-Black.png'; import s013007199 from './set5/006-Top/ShortHairShaggyMullet-Blonde.png'; @@ -1339,7 +1340,7 @@ import s013007203 from './set5/006-Top/ShortHairShaggyMullet-Pink.png'; import s013007204 from './set5/006-Top/ShortHairShaggyMullet-Platinum.png'; import s013007205 from './set5/006-Top/ShortHairShaggyMullet-Red.png'; import s013007206 from './set5/006-Top/ShortHairShaggyMullet-SilverGray.png'; -import s013007207 from './set5/006-Top/ShortHairShaggyMullet.png'; +import s013007218 from './set5/006-Top/ShortHairShortCurly.png'; import s013007208 from './set5/006-Top/ShortHairShortCurly-Auburn.png'; import s013007209 from './set5/006-Top/ShortHairShortCurly-Black.png'; import s013007210 from './set5/006-Top/ShortHairShortCurly-Blonde.png'; @@ -1350,7 +1351,7 @@ import s013007214 from './set5/006-Top/ShortHairShortCurly-Pink.png'; import s013007215 from './set5/006-Top/ShortHairShortCurly-Platinum.png'; import s013007216 from './set5/006-Top/ShortHairShortCurly-Red.png'; import s013007217 from './set5/006-Top/ShortHairShortCurly-SilverGray.png'; -import s013007218 from './set5/006-Top/ShortHairShortCurly.png'; +import s013007229 from './set5/006-Top/ShortHairShortFlat.png'; import s013007219 from './set5/006-Top/ShortHairShortFlat-Auburn.png'; import s013007220 from './set5/006-Top/ShortHairShortFlat-Black.png'; import s013007221 from './set5/006-Top/ShortHairShortFlat-Blonde.png'; @@ -1361,7 +1362,7 @@ import s013007225 from './set5/006-Top/ShortHairShortFlat-Pink.png'; import s013007226 from './set5/006-Top/ShortHairShortFlat-Platinum.png'; import s013007227 from './set5/006-Top/ShortHairShortFlat-Red.png'; import s013007228 from './set5/006-Top/ShortHairShortFlat-SilverGray.png'; -import s013007229 from './set5/006-Top/ShortHairShortFlat.png'; +import s013007240 from './set5/006-Top/ShortHairShortRound.png'; import s013007230 from './set5/006-Top/ShortHairShortRound-Auburn.png'; import s013007231 from './set5/006-Top/ShortHairShortRound-Black.png'; import s013007232 from './set5/006-Top/ShortHairShortRound-Blonde.png'; @@ -1372,7 +1373,7 @@ import s013007236 from './set5/006-Top/ShortHairShortRound-Pink.png'; import s013007237 from './set5/006-Top/ShortHairShortRound-Platinum.png'; import s013007238 from './set5/006-Top/ShortHairShortRound-Red.png'; import s013007239 from './set5/006-Top/ShortHairShortRound-SilverGray.png'; -import s013007240 from './set5/006-Top/ShortHairShortRound.png'; +import s013007251 from './set5/006-Top/ShortHairShortWaved.png'; import s013007241 from './set5/006-Top/ShortHairShortWaved-Auburn.png'; import s013007242 from './set5/006-Top/ShortHairShortWaved-Black.png'; import s013007243 from './set5/006-Top/ShortHairShortWaved-Blonde.png'; @@ -1383,7 +1384,7 @@ import s013007247 from './set5/006-Top/ShortHairShortWaved-Pink.png'; import s013007248 from './set5/006-Top/ShortHairShortWaved-Platinum.png'; import s013007249 from './set5/006-Top/ShortHairShortWaved-Red.png'; import s013007250 from './set5/006-Top/ShortHairShortWaved-SilverGray.png'; -import s013007251 from './set5/006-Top/ShortHairShortWaved.png'; +import s013007262 from './set5/006-Top/ShortHairSides.png'; import s013007252 from './set5/006-Top/ShortHairSides-Auburn.png'; import s013007253 from './set5/006-Top/ShortHairSides-Black.png'; import s013007254 from './set5/006-Top/ShortHairSides-Blonde.png'; @@ -1394,7 +1395,7 @@ import s013007258 from './set5/006-Top/ShortHairSides-Pink.png'; import s013007259 from './set5/006-Top/ShortHairSides-Platinum.png'; import s013007260 from './set5/006-Top/ShortHairSides-Red.png'; import s013007261 from './set5/006-Top/ShortHairSides-SilverGray.png'; -import s013007262 from './set5/006-Top/ShortHairSides.png'; +import s013007273 from './set5/006-Top/ShortHairTheCaesar.png'; import s013007263 from './set5/006-Top/ShortHairTheCaesar-Auburn.png'; import s013007264 from './set5/006-Top/ShortHairTheCaesar-Black.png'; import s013007265 from './set5/006-Top/ShortHairTheCaesar-Blonde.png'; @@ -1405,7 +1406,7 @@ import s013007269 from './set5/006-Top/ShortHairTheCaesar-Pink.png'; import s013007270 from './set5/006-Top/ShortHairTheCaesar-Platinum.png'; import s013007271 from './set5/006-Top/ShortHairTheCaesar-Red.png'; import s013007272 from './set5/006-Top/ShortHairTheCaesar-SilverGray.png'; -import s013007273 from './set5/006-Top/ShortHairTheCaesar.png'; +import s013007284 from './set5/006-Top/ShortHairTheCaesarSidePart.png'; import s013007274 from './set5/006-Top/ShortHairTheCaesarSidePart-Auburn.png'; import s013007275 from './set5/006-Top/ShortHairTheCaesarSidePart-Black.png'; import s013007276 from './set5/006-Top/ShortHairTheCaesarSidePart-Blonde.png'; @@ -1416,7 +1417,7 @@ import s013007280 from './set5/006-Top/ShortHairTheCaesarSidePart-Pink.png'; import s013007281 from './set5/006-Top/ShortHairTheCaesarSidePart-Platinum.png'; import s013007282 from './set5/006-Top/ShortHairTheCaesarSidePart-Red.png'; import s013007283 from './set5/006-Top/ShortHairTheCaesarSidePart-SilverGray.png'; -import s013007284 from './set5/006-Top/ShortHairTheCaesarSidePart.png'; +import s013007300 from './set5/006-Top/Turban.png'; import s013007285 from './set5/006-Top/Turban-Black.png'; import s013007286 from './set5/006-Top/Turban-Blue01.png'; import s013007287 from './set5/006-Top/Turban-Blue02.png'; @@ -1432,7 +1433,7 @@ import s013007296 from './set5/006-Top/Turban-PastelYellow.png'; import s013007297 from './set5/006-Top/Turban-Pink.png'; import s013007298 from './set5/006-Top/Turban-Red.png'; import s013007299 from './set5/006-Top/Turban-White.png'; -import s013007300 from './set5/006-Top/Turban.png'; +import s013007316 from './set5/006-Top/WinterHat1.png'; import s013007301 from './set5/006-Top/WinterHat1-Black.png'; import s013007302 from './set5/006-Top/WinterHat1-Blue01.png'; import s013007303 from './set5/006-Top/WinterHat1-Blue02.png'; @@ -1448,7 +1449,7 @@ import s013007312 from './set5/006-Top/WinterHat1-PastelRed.png'; import s013007313 from './set5/006-Top/WinterHat1-PastelYellow.png'; import s013007314 from './set5/006-Top/WinterHat1-Pink.png'; import s013007315 from './set5/006-Top/WinterHat1-White.png'; -import s013007316 from './set5/006-Top/WinterHat1.png'; +import s013007332 from './set5/006-Top/WinterHat2.png'; import s013007317 from './set5/006-Top/WinterHat2-Black.png'; import s013007318 from './set5/006-Top/WinterHat2-Blue02.png'; import s013007319 from './set5/006-Top/WinterHat2-Blue03.png'; @@ -1464,7 +1465,7 @@ import s013007328 from './set5/006-Top/WinterHat2-PastelYellow.png'; import s013007329 from './set5/006-Top/WinterHat2-Pink.png'; import s013007330 from './set5/006-Top/WinterHat2-Red.png'; import s013007331 from './set5/006-Top/WinterHat2-White.png'; -import s013007332 from './set5/006-Top/WinterHat2.png'; +import s013007348 from './set5/006-Top/WinterHat3.png'; import s013007333 from './set5/006-Top/WinterHat3-Black.png'; import s013007334 from './set5/006-Top/WinterHat3-Blue01.png'; import s013007335 from './set5/006-Top/WinterHat3-Blue02.png'; @@ -1480,7 +1481,7 @@ import s013007344 from './set5/006-Top/WinterHat3-PastelRed.png'; import s013007345 from './set5/006-Top/WinterHat3-PastelYellow.png'; import s013007346 from './set5/006-Top/WinterHat3-Pink.png'; import s013007347 from './set5/006-Top/WinterHat3-White.png'; -import s013007348 from './set5/006-Top/WinterHat3.png'; +import s013007364 from './set5/006-Top/WinterHat4.png'; import s013007349 from './set5/006-Top/WinterHat4-Black.png'; import s013007350 from './set5/006-Top/WinterHat4-Blue01.png'; import s013007351 from './set5/006-Top/WinterHat4-Blue02.png'; @@ -1496,24 +1497,23 @@ import s013007360 from './set5/006-Top/WinterHat4-PastelRed.png'; import s013007361 from './set5/006-Top/WinterHat4-PastelYellow.png'; import s013007362 from './set5/006-Top/WinterHat4-Pink.png'; import s013007363 from './set5/006-Top/WinterHat4-White.png'; -import s013007364 from './set5/006-Top/WinterHat4.png'; import s013000000 from './set5/007-Accessories/Blank.png'; +import s013000004 from './set5/007-Accessories/Kurt.png'; import s013000001 from './set5/007-Accessories/Kurt-Black.png'; import s013000002 from './set5/007-Accessories/Kurt-Brown.png'; import s013000003 from './set5/007-Accessories/Kurt-White.png'; -import s013000004 from './set5/007-Accessories/Kurt.png'; +import s013000008 from './set5/007-Accessories/Prescription01.png'; import s013000005 from './set5/007-Accessories/Prescription01-Black.png'; import s013000006 from './set5/007-Accessories/Prescription01-Brown.png'; import s013000007 from './set5/007-Accessories/Prescription01-White.png'; -import s013000008 from './set5/007-Accessories/Prescription01.png'; +import s013000012 from './set5/007-Accessories/Prescription02.png'; import s013000009 from './set5/007-Accessories/Prescription02-Black.png'; import s013000010 from './set5/007-Accessories/Prescription02-Brown.png'; import s013000011 from './set5/007-Accessories/Prescription02-White.png'; -import s013000012 from './set5/007-Accessories/Prescription02.png'; +import s013000016 from './set5/007-Accessories/Round.png'; import s013000013 from './set5/007-Accessories/Round-Black.png'; import s013000014 from './set5/007-Accessories/Round-Brown.png'; import s013000015 from './set5/007-Accessories/Round-White.png'; -import s013000016 from './set5/007-Accessories/Round.png'; import s013000017 from './set5/007-Accessories/Sunglasses.png'; import s013000018 from './set5/007-Accessories/Wayfarers.png'; diff --git a/packages/react-components/src/IdentityIcon/index.tsx b/packages/react-components/src/IdentityIcon/index.tsx index 4fbd9733a3..13fc29837a 100644 --- a/packages/react-components/src/IdentityIcon/index.tsx +++ b/packages/react-components/src/IdentityIcon/index.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { IdentityProps } from '@polkadot/react-identicon/types'; + import React, { useCallback, useContext } from 'react'; import styled from 'styled-components'; -import type { IdentityProps } from '@polkadot/react-identicon/types'; import { getSystemIcon } from '@polkadot/apps-config'; import { useApi } from '@polkadot/react-hooks'; import BaseIdentityIcon from '@polkadot/react-identicon'; diff --git a/packages/react-components/src/Input.tsx b/packages/react-components/src/Input.tsx index b5f0b3583f..752e4f8adf 100644 --- a/packages/react-components/src/Input.tsx +++ b/packages/react-components/src/Input.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { VoidFn } from './types'; + import React, { useCallback, useState } from 'react'; import SUIInput from 'semantic-ui-react/dist/commonjs/elements/Input/Input'; import { isFunction, isUndefined } from '@polkadot/util'; -import type { VoidFn } from './types'; import Labelled from './Labelled'; type Input$Type = 'number' | 'password' | 'text'; diff --git a/packages/react-components/src/InputAddress/KeyPair.tsx b/packages/react-components/src/InputAddress/KeyPair.tsx index affc521a74..0c01e1acd6 100644 --- a/packages/react-components/src/InputAddress/KeyPair.tsx +++ b/packages/react-components/src/InputAddress/KeyPair.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeProps } from '@polkadot/react-components/types'; + import React from 'react'; import styled from 'styled-components'; -import type { ThemeProps } from '@polkadot/react-components/types'; - import AccountName from '../AccountName'; import IdentityIcon from '../IdentityIcon'; diff --git a/packages/react-components/src/InputAddress/createHeader.tsx b/packages/react-components/src/InputAddress/createHeader.tsx index 589fbaaf7d..87ca76543a 100644 --- a/packages/react-components/src/InputAddress/createHeader.tsx +++ b/packages/react-components/src/InputAddress/createHeader.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { KeyringSectionOption } from '@polkadot/ui-keyring/options/types'; +import React from 'react'; + import Dropdown from '../Dropdown'; export default function createHeader (option: KeyringSectionOption): React.ReactNode { diff --git a/packages/react-components/src/InputAddress/createItem.tsx b/packages/react-components/src/InputAddress/createItem.tsx index 5849c09802..b117937750 100644 --- a/packages/react-components/src/InputAddress/createItem.tsx +++ b/packages/react-components/src/InputAddress/createItem.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { KeyringSectionOption } from '@polkadot/ui-keyring/options/types'; +import type { Option } from './types'; + import React from 'react'; -import type { KeyringSectionOption } from '@polkadot/ui-keyring/options/types'; - -import type { Option } from './types'; import KeyPair from './KeyPair'; export default function createItem (option: KeyringSectionOption, isUppercase = true): Option { diff --git a/packages/react-components/src/InputAddress/index.tsx b/packages/react-components/src/InputAddress/index.tsx index f8785e2ef6..404c91bf0b 100644 --- a/packages/react-components/src/InputAddress/index.tsx +++ b/packages/react-components/src/InputAddress/index.tsx @@ -1,17 +1,18 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { KeyringOption$Type, KeyringOptions, KeyringSectionOption, KeyringSectionOptions } from '@polkadot/ui-keyring/options/types'; +import type { Option } from './types'; + import React from 'react'; import store from 'store'; import styled from 'styled-components'; -import type { KeyringOption$Type, KeyringOptions, KeyringSectionOption, KeyringSectionOptions } from '@polkadot/ui-keyring/options/types'; import { withMulti, withObservable } from '@polkadot/react-api/hoc'; import keyring from '@polkadot/ui-keyring'; import createKeyringItem from '@polkadot/ui-keyring/options/item'; import { isNull, isUndefined } from '@polkadot/util'; -import type { Option } from './types'; import Dropdown from '../Dropdown'; import { getAddressName } from '../util'; import addressToAddress from '../util/toAddress'; diff --git a/packages/react-components/src/InputAddress/types.ts b/packages/react-components/src/InputAddress/types.ts index 53a0ca3378..3204bfcfcc 100644 --- a/packages/react-components/src/InputAddress/types.ts +++ b/packages/react-components/src/InputAddress/types.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { KeyringOption$Type, KeyringSectionOption } from '@polkadot/ui-keyring/options/types'; +import React from 'react'; + export interface Option extends KeyringSectionOption { className?: string; text: React.ReactNode; diff --git a/packages/react-components/src/InputBalance.tsx b/packages/react-components/src/InputBalance.tsx index d3834828f9..d31608657b 100644 --- a/packages/react-components/src/InputBalance.tsx +++ b/packages/react-components/src/InputBalance.tsx @@ -1,6 +1,8 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { BitLength } from './types'; + import BN from 'bn.js'; import React, { useMemo } from 'react'; import styled from 'styled-components'; @@ -8,7 +10,6 @@ import styled from 'styled-components'; import { BitLengthOption } from '@polkadot/react-components/constants'; import { BN_TEN, formatBalance, isBn } from '@polkadot/util'; -import type { BitLength } from './types'; import InputNumber from './InputNumber'; interface Props { diff --git a/packages/react-components/src/InputConsts/SelectKey.tsx b/packages/react-components/src/InputConsts/SelectKey.tsx index d83f5c37a9..0a348c018f 100644 --- a/packages/react-components/src/InputConsts/SelectKey.tsx +++ b/packages/react-components/src/InputConsts/SelectKey.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { DropdownOptions } from '../util/types'; import type { ConstValueBase } from './types'; + +import React from 'react'; + import Dropdown from '../Dropdown'; interface Props { diff --git a/packages/react-components/src/InputConsts/SelectSection.tsx b/packages/react-components/src/InputConsts/SelectSection.tsx index a036ec24f4..c545318349 100644 --- a/packages/react-components/src/InputConsts/SelectSection.tsx +++ b/packages/react-components/src/InputConsts/SelectSection.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { DropdownOptions } from '../util/types'; import type { ConstValueBase, StorageEntryPromise } from './types'; + +import React from 'react'; + import Dropdown from '../Dropdown'; interface Props { diff --git a/packages/react-components/src/InputConsts/index.tsx b/packages/react-components/src/InputConsts/index.tsx index 5e483668c2..e09e783619 100644 --- a/packages/react-components/src/InputConsts/index.tsx +++ b/packages/react-components/src/InputConsts/index.tsx @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ConstantCodec } from '@polkadot/metadata/decorate/types'; +import type { DropdownOptions } from '../util/types'; +import type { ConstValue, ConstValueBase } from './types'; + import React, { useCallback, useState } from 'react'; -import type { ConstantCodec } from '@polkadot/metadata/decorate/types'; import { ApiPromise } from '@polkadot/api'; import { useApi } from '@polkadot/react-hooks'; -import type { DropdownOptions } from '../util/types'; -import type { ConstValue, ConstValueBase } from './types'; import LinkedWrapper from '../InputExtrinsic/LinkedWrapper'; import keyOptions from './options/key'; import sectionOptions from './options/section'; diff --git a/packages/react-components/src/InputConsts/options/key.tsx b/packages/react-components/src/InputConsts/options/key.tsx index 909822d5b8..a858c01c0e 100644 --- a/packages/react-components/src/InputConsts/options/key.tsx +++ b/packages/react-components/src/InputConsts/options/key.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ConstantCodec } from '@polkadot/metadata/decorate/types'; +import type { DropdownOption, DropdownOptions } from '../../util/types'; + import React from 'react'; -import type { ConstantCodec } from '@polkadot/metadata/decorate/types'; import { ApiPromise } from '@polkadot/api'; -import type { DropdownOption, DropdownOptions } from '../../util/types'; - export default function createOptions (api: ApiPromise, sectionName: string): DropdownOptions { const section = api.consts[sectionName]; diff --git a/packages/react-components/src/InputConsts/options/section.ts b/packages/react-components/src/InputConsts/options/section.ts index ae863e39f1..3d52ff1ac0 100644 --- a/packages/react-components/src/InputConsts/options/section.ts +++ b/packages/react-components/src/InputConsts/options/section.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiPromise } from '@polkadot/api'; - import type { DropdownOptions } from '../../util/types'; +import { ApiPromise } from '@polkadot/api'; + export default function createOptions (api: ApiPromise): DropdownOptions { return Object .keys(api.consts) diff --git a/packages/react-components/src/InputExtrinsic/SelectMethod.tsx b/packages/react-components/src/InputExtrinsic/SelectMethod.tsx index e61884e9bf..2c76ab002a 100644 --- a/packages/react-components/src/InputExtrinsic/SelectMethod.tsx +++ b/packages/react-components/src/InputExtrinsic/SelectMethod.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsicFunction } from '@polkadot/api/types'; +import type { DropdownOptions } from '../util/types'; + import React, { useCallback } from 'react'; -import type { SubmittableExtrinsicFunction } from '@polkadot/api/types'; import { ApiPromise } from '@polkadot/api'; -import type { DropdownOptions } from '../util/types'; import Dropdown from '../Dropdown'; interface Props { diff --git a/packages/react-components/src/InputExtrinsic/SelectSection.tsx b/packages/react-components/src/InputExtrinsic/SelectSection.tsx index b7a37377a7..9338c75210 100644 --- a/packages/react-components/src/InputExtrinsic/SelectSection.tsx +++ b/packages/react-components/src/InputExtrinsic/SelectSection.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsicFunction } from '@polkadot/api/types'; +import type { DropdownOptions } from '../util/types'; + import React from 'react'; -import type { SubmittableExtrinsicFunction } from '@polkadot/api/types'; - -import type { DropdownOptions } from '../util/types'; import Dropdown from '../Dropdown'; interface Props { diff --git a/packages/react-components/src/InputExtrinsic/index.tsx b/packages/react-components/src/InputExtrinsic/index.tsx index 911f1a0a39..5619826d95 100644 --- a/packages/react-components/src/InputExtrinsic/index.tsx +++ b/packages/react-components/src/InputExtrinsic/index.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsicFunction } from '@polkadot/api/types'; +import type { DropdownOptions } from '../util/types'; + import React, { useCallback, useState } from 'react'; -import type { SubmittableExtrinsicFunction } from '@polkadot/api/types'; import { useApi } from '@polkadot/react-hooks'; -import type { DropdownOptions } from '../util/types'; import LinkedWrapper from './LinkedWrapper'; import methodOptions from './options/method'; import sectionOptions from './options/section'; diff --git a/packages/react-components/src/InputExtrinsic/options/method.tsx b/packages/react-components/src/InputExtrinsic/options/method.tsx index b0cc5888f9..fd3082de03 100644 --- a/packages/react-components/src/InputExtrinsic/options/method.tsx +++ b/packages/react-components/src/InputExtrinsic/options/method.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DropdownOption, DropdownOptions } from '../../util/types'; + import React from 'react'; import { ApiPromise } from '@polkadot/api'; -import type { DropdownOption, DropdownOptions } from '../../util/types'; - export default function createOptions (api: ApiPromise, sectionName: string): DropdownOptions { const section = api.tx[sectionName]; diff --git a/packages/react-components/src/InputExtrinsic/options/section.ts b/packages/react-components/src/InputExtrinsic/options/section.ts index ba910b5a6a..e2a0b2f997 100644 --- a/packages/react-components/src/InputExtrinsic/options/section.ts +++ b/packages/react-components/src/InputExtrinsic/options/section.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiPromise } from '@polkadot/api'; - import type { DropdownOptions } from '../../util/types'; +import { ApiPromise } from '@polkadot/api'; + export default function createOptions (api: ApiPromise): DropdownOptions { return Object .keys(api.tx) diff --git a/packages/react-components/src/InputFile.tsx b/packages/react-components/src/InputFile.tsx index 866dbce118..1383f92b80 100644 --- a/packages/react-components/src/InputFile.tsx +++ b/packages/react-components/src/InputFile.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeProps } from './types'; + import React, { createRef, useCallback, useState } from 'react'; import Dropzone, { DropzoneRef } from 'react-dropzone'; import styled from 'styled-components'; import { formatNumber, hexToU8a, isHex, u8aToString } from '@polkadot/util'; -import type { ThemeProps } from './types'; import Labelled from './Labelled'; import { useTranslation } from './translate'; diff --git a/packages/react-components/src/InputNumber.tsx b/packages/react-components/src/InputNumber.tsx index 27c598fd42..f5065c2ede 100644 --- a/packages/react-components/src/InputNumber.tsx +++ b/packages/react-components/src/InputNumber.tsx @@ -1,15 +1,16 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SiDef } from '@polkadot/util/types'; +import type { BitLength } from './types'; + import BN from 'bn.js'; import React, { useCallback, useEffect, useState } from 'react'; import styled from 'styled-components'; -import type { SiDef } from '@polkadot/util/types'; import { registry } from '@polkadot/react-api'; import { BN_TEN, BN_ZERO, formatBalance, isBn } from '@polkadot/util'; -import type { BitLength } from './types'; import { BitLengthOption } from './constants'; import Dropdown from './Dropdown'; import Input, { KEYS_PRE } from './Input'; diff --git a/packages/react-components/src/InputRpc/SelectMethod.tsx b/packages/react-components/src/InputRpc/SelectMethod.tsx index e22abb7558..f7ce67c09b 100644 --- a/packages/react-components/src/InputRpc/SelectMethod.tsx +++ b/packages/react-components/src/InputRpc/SelectMethod.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DefinitionRpcExt } from '@polkadot/types/types'; +import type { DropdownOption } from '../util/types'; + import React, { useCallback } from 'react'; -import type { DefinitionRpcExt } from '@polkadot/types/types'; - -import type { DropdownOption } from '../util/types'; import Dropdown from '../Dropdown'; import rpcs from './rpcs'; diff --git a/packages/react-components/src/InputRpc/SelectSection.tsx b/packages/react-components/src/InputRpc/SelectSection.tsx index 4563037da5..bd42e6c322 100644 --- a/packages/react-components/src/InputRpc/SelectSection.tsx +++ b/packages/react-components/src/InputRpc/SelectSection.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DefinitionRpcExt } from '@polkadot/types/types'; +import type { DropdownOptions } from '../util/types'; + import React from 'react'; -import type { DefinitionRpcExt } from '@polkadot/types/types'; - -import type { DropdownOptions } from '../util/types'; import Dropdown from '../Dropdown'; interface Props { diff --git a/packages/react-components/src/InputRpc/index.tsx b/packages/react-components/src/InputRpc/index.tsx index 1d6f377da7..b9368c6f67 100644 --- a/packages/react-components/src/InputRpc/index.tsx +++ b/packages/react-components/src/InputRpc/index.tsx @@ -3,12 +3,13 @@ // TODO: We have a lot shared between this and InputExtrinsic & InputStorage +import type { DefinitionRpcExt } from '@polkadot/types/types'; +import type { DropdownOptions } from '../util/types'; + import React, { useCallback, useEffect, useState } from 'react'; -import type { DefinitionRpcExt } from '@polkadot/types/types'; import { useApi } from '@polkadot/react-hooks'; -import type { DropdownOptions } from '../util/types'; import LinkedWrapper from '../InputExtrinsic/LinkedWrapper'; import methodOptions from './options/method'; import sectionOptions from './options/section'; diff --git a/packages/react-components/src/InputRpc/options/method.tsx b/packages/react-components/src/InputRpc/options/method.tsx index d8b2c47169..5cecec1eed 100644 --- a/packages/react-components/src/InputRpc/options/method.tsx +++ b/packages/react-components/src/InputRpc/options/method.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DefinitionRpcExt } from '@polkadot/types/types'; +import type { DropdownOption, DropdownOptions } from '../../util/types'; + import React from 'react'; -import type { DefinitionRpcExt } from '@polkadot/types/types'; import { ApiPromise } from '@polkadot/api'; -import type { DropdownOption, DropdownOptions } from '../../util/types'; import rpcs from '../rpcs'; export default function createOptions (api: ApiPromise, sectionName: string): DropdownOptions { diff --git a/packages/react-components/src/InputRpc/options/section.ts b/packages/react-components/src/InputRpc/options/section.ts index 69b4b42164..b77e53be09 100644 --- a/packages/react-components/src/InputRpc/options/section.ts +++ b/packages/react-components/src/InputRpc/options/section.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiPromise } from '@polkadot/api'; - import type { DropdownOptions } from '../../util/types'; +import { ApiPromise } from '@polkadot/api'; + export default function createOptions (api: ApiPromise): DropdownOptions { return Object .keys(api.rpc) diff --git a/packages/react-components/src/InputRpc/rpcs.ts b/packages/react-components/src/InputRpc/rpcs.ts index 489d957b5d..70eecf8d19 100644 --- a/packages/react-components/src/InputRpc/rpcs.ts +++ b/packages/react-components/src/InputRpc/rpcs.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { DefinitionRpc, DefinitionRpcExt } from '@polkadot/types/types'; + import { typesRpc } from '@polkadot/apps-config'; import jsonrpc from '@polkadot/types/interfaces/jsonrpc'; diff --git a/packages/react-components/src/InputStorage/SelectKey.tsx b/packages/react-components/src/InputStorage/SelectKey.tsx index 0a5dc7e092..7355223b3e 100644 --- a/packages/react-components/src/InputStorage/SelectKey.tsx +++ b/packages/react-components/src/InputStorage/SelectKey.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { QueryableStorageEntry } from '@polkadot/api/types'; +import type { DropdownOptions } from '../util/types'; + import React from 'react'; -import type { QueryableStorageEntry } from '@polkadot/api/types'; import { ApiPromise } from '@polkadot/api'; import { useApi } from '@polkadot/react-hooks'; -import type { DropdownOptions } from '../util/types'; import Dropdown from '../Dropdown'; interface Props { diff --git a/packages/react-components/src/InputStorage/SelectSection.tsx b/packages/react-components/src/InputStorage/SelectSection.tsx index f8700bee4b..9e17ca11bd 100644 --- a/packages/react-components/src/InputStorage/SelectSection.tsx +++ b/packages/react-components/src/InputStorage/SelectSection.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { QueryableStorageEntry } from '@polkadot/api/types'; +import type { DropdownOptions } from '../util/types'; + import React from 'react'; -import type { QueryableStorageEntry } from '@polkadot/api/types'; - -import type { DropdownOptions } from '../util/types'; import Dropdown from '../Dropdown'; interface Props { diff --git a/packages/react-components/src/InputStorage/index.tsx b/packages/react-components/src/InputStorage/index.tsx index 273d1c4167..245a826ccb 100644 --- a/packages/react-components/src/InputStorage/index.tsx +++ b/packages/react-components/src/InputStorage/index.tsx @@ -3,12 +3,13 @@ // TODO: We have a lot shared between this and InputExtrinsic +import type { QueryableStorageEntry } from '@polkadot/api/types'; +import type { DropdownOptions } from '../util/types'; + import React, { useCallback, useState } from 'react'; -import type { QueryableStorageEntry } from '@polkadot/api/types'; import { useApi } from '@polkadot/react-hooks'; -import type { DropdownOptions } from '../util/types'; import LinkedWrapper from '../InputExtrinsic/LinkedWrapper'; import keyOptions from './options/key'; import sectionOptions from './options/section'; diff --git a/packages/react-components/src/InputStorage/options/key.tsx b/packages/react-components/src/InputStorage/options/key.tsx index 7c39e09052..9be0e7598a 100644 --- a/packages/react-components/src/InputStorage/options/key.tsx +++ b/packages/react-components/src/InputStorage/options/key.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { StorageEntry } from '@polkadot/types/primitive/types'; +import type { DropdownOption, DropdownOptions } from '../../util/types'; + import React from 'react'; -import type { StorageEntry } from '@polkadot/types/primitive/types'; import { ApiPromise } from '@polkadot/api'; import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey'; -import type { DropdownOption, DropdownOptions } from '../../util/types'; - export default function createOptions (api: ApiPromise, sectionName: string): DropdownOptions { const section = api.query[sectionName]; diff --git a/packages/react-components/src/InputStorage/options/section.ts b/packages/react-components/src/InputStorage/options/section.ts index b89c2726a1..338f43dfa5 100644 --- a/packages/react-components/src/InputStorage/options/section.ts +++ b/packages/react-components/src/InputStorage/options/section.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { ApiPromise } from '@polkadot/api'; - import type { DropdownOptions } from '../../util/types'; +import { ApiPromise } from '@polkadot/api'; + export default function createOptions (api: ApiPromise): DropdownOptions { return Object .keys(api.query) diff --git a/packages/react-components/src/LabelHelp.tsx b/packages/react-components/src/LabelHelp.tsx index 8a126805d2..5d6bbe69a1 100644 --- a/packages/react-components/src/LabelHelp.tsx +++ b/packages/react-components/src/LabelHelp.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { IconName } from '@fortawesome/fontawesome-svg-core'; + import React, { useState } from 'react'; import styled from 'styled-components'; diff --git a/packages/react-components/src/LinkExternal.tsx b/packages/react-components/src/LinkExternal.tsx index 09a550d5a4..43b53b0a55 100644 --- a/packages/react-components/src/LinkExternal.tsx +++ b/packages/react-components/src/LinkExternal.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { LinkTypes } from '@polkadot/apps-config/links/types'; + import BN from 'bn.js'; import React, { useMemo } from 'react'; import styled from 'styled-components'; -import type { LinkTypes } from '@polkadot/apps-config/links/types'; import { externalLinks } from '@polkadot/apps-config'; import { useApi } from '@polkadot/react-hooks'; diff --git a/packages/react-components/src/LockedVote.tsx b/packages/react-components/src/LockedVote.tsx index 6f431bbb27..497d9ead60 100644 --- a/packages/react-components/src/LockedVote.tsx +++ b/packages/react-components/src/LockedVote.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; + import React from 'react'; -import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; import { LockedVote } from '@polkadot/react-query'; export interface Props { diff --git a/packages/react-components/src/Modal/Actions.tsx b/packages/react-components/src/Modal/Actions.tsx index 11565bc033..d033af6786 100644 --- a/packages/react-components/src/Modal/Actions.tsx +++ b/packages/react-components/src/Modal/Actions.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ActionsProps } from './types'; + import React from 'react'; import SUIModal from 'semantic-ui-react/dist/commonjs/modules/Modal/Modal'; -import type { ActionsProps } from './types'; import Button from '../Button'; import ButtonCancel from '../ButtonCancel'; diff --git a/packages/react-components/src/Modal/Column.tsx b/packages/react-components/src/Modal/Column.tsx index f92ad769d4..092a63f81b 100644 --- a/packages/react-components/src/Modal/Column.tsx +++ b/packages/react-components/src/Modal/Column.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ColumnProps } from './types'; + import React from 'react'; import styled from 'styled-components'; -import type { ColumnProps } from './types'; - function Column ({ children, className = '' }: ColumnProps): React.ReactElement { return (
{children}
diff --git a/packages/react-components/src/Modal/Columns.tsx b/packages/react-components/src/Modal/Columns.tsx index f3fa4656f9..abd9b53377 100644 --- a/packages/react-components/src/Modal/Columns.tsx +++ b/packages/react-components/src/Modal/Columns.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ColumnProps } from './types'; + import React from 'react'; import styled from 'styled-components'; -import type { ColumnProps } from './types'; - function Columns ({ children, className = '' }: ColumnProps): React.ReactElement { return (
{children}
diff --git a/packages/react-components/src/Modal/index.tsx b/packages/react-components/src/Modal/index.tsx index bf8b3284b6..c2e55b69a5 100644 --- a/packages/react-components/src/Modal/index.tsx +++ b/packages/react-components/src/Modal/index.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeDef } from '@polkadot/react-components/types'; +import type { ActionsProps, ColumnProps, ModalProps } from './types'; + import React, { useContext } from 'react'; import SUIModal from 'semantic-ui-react/dist/commonjs/modules/Modal/Modal'; import { ThemeContext } from 'styled-components'; -import type { ThemeDef } from '@polkadot/react-components/types'; - -import type { ActionsProps, ColumnProps, ModalProps } from './types'; import Actions from './Actions'; import Column from './Column'; import Columns from './Columns'; diff --git a/packages/react-components/src/Nonce.tsx b/packages/react-components/src/Nonce.tsx index a6d1cfbfc4..e2c5758586 100644 --- a/packages/react-components/src/Nonce.tsx +++ b/packages/react-components/src/Nonce.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; + import React from 'react'; -import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; import { Nonce } from '@polkadot/react-query'; export interface Props { diff --git a/packages/react-components/src/Params/Call.tsx b/packages/react-components/src/Params/Call.tsx index 9ed96444cc..ccaf757de1 100644 --- a/packages/react-components/src/Params/Call.tsx +++ b/packages/react-components/src/Params/Call.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-extrinsics authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { SubmittableExtrinsicFunction } from '@polkadot/api/types'; import type { Props } from '@polkadot/react-params/types'; + +import React from 'react'; + import { useApi } from '@polkadot/react-hooks'; import Extrinsic from './Extrinsic'; diff --git a/packages/react-components/src/Params/Extrinsic.tsx b/packages/react-components/src/Params/Extrinsic.tsx index 752e86dbd5..e6d0ba208f 100644 --- a/packages/react-components/src/Params/Extrinsic.tsx +++ b/packages/react-components/src/Params/Extrinsic.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-extrinsics authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback } from 'react'; - import type { SubmittableExtrinsic, SubmittableExtrinsicFunction } from '@polkadot/api/types'; import type { RawParamOnChange, RawParamOnEnter, RawParamOnEscape } from '@polkadot/react-params/types'; +import React, { useCallback } from 'react'; + import BaseExtrinsic from '../Extrinsic'; interface Props { diff --git a/packages/react-components/src/Params/OpaqueCall.tsx b/packages/react-components/src/Params/OpaqueCall.tsx index 90abc89407..f7f955f8de 100644 --- a/packages/react-components/src/Params/OpaqueCall.tsx +++ b/packages/react-components/src/Params/OpaqueCall.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-extrinsics authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback } from 'react'; - import type { SubmittableExtrinsic } from '@polkadot/api/types'; import type { Props, RawParam } from '@polkadot/react-params/types'; + +import React, { useCallback } from 'react'; + import { useApi } from '@polkadot/react-hooks'; import ExtrinsicDisplay from './Extrinsic'; diff --git a/packages/react-components/src/Params/Proposal.tsx b/packages/react-components/src/Params/Proposal.tsx index d0e9385a8e..240720fb81 100644 --- a/packages/react-components/src/Params/Proposal.tsx +++ b/packages/react-components/src/Params/Proposal.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-extrinsics authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Props, RawParam } from '@polkadot/react-params/types'; + import React, { useCallback } from 'react'; -import type { Props, RawParam } from '@polkadot/react-params/types'; import { registry } from '@polkadot/react-api'; import { useApi } from '@polkadot/react-hooks'; diff --git a/packages/react-components/src/PasswordStrength.tsx b/packages/react-components/src/PasswordStrength.tsx index edbee3f359..b7f2c0c4ef 100644 --- a/packages/react-components/src/PasswordStrength.tsx +++ b/packages/react-components/src/PasswordStrength.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeProps } from './types'; + import strengthTester from 'owasp-password-strength-test'; import React from 'react'; import styled from 'styled-components'; -import type { ThemeProps } from './types'; import { useTranslation } from './translate'; const MAX_STRENGTH = 7; // equal to number of password tests in owasp strength tester diff --git a/packages/react-components/src/Progress.tsx b/packages/react-components/src/Progress.tsx index d24195c7e9..7d2c7536ff 100644 --- a/packages/react-components/src/Progress.tsx +++ b/packages/react-components/src/Progress.tsx @@ -1,15 +1,15 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { UInt } from '@polkadot/types'; +import type { ThemeProps } from './types'; + import BN from 'bn.js'; import React from 'react'; import styled from 'styled-components'; -import type { UInt } from '@polkadot/types'; import { bnToBn } from '@polkadot/util'; -import type { ThemeProps } from './types'; - interface Props { className?: string; isDisabled?: boolean; diff --git a/packages/react-components/src/ProposedAction.tsx b/packages/react-components/src/ProposedAction.tsx index 35ef465953..a0b51bbaab 100644 --- a/packages/react-components/src/ProposedAction.tsx +++ b/packages/react-components/src/ProposedAction.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Proposal } from '@polkadot/types/interfaces'; + import BN from 'bn.js'; import React from 'react'; import styled from 'styled-components'; -import type { Proposal } from '@polkadot/types/interfaces'; import { formatNumber, isString } from '@polkadot/util'; import Call from './Call'; diff --git a/packages/react-components/src/Sidebar.tsx b/packages/react-components/src/Sidebar.tsx index 152706eb6e..689d43bbf0 100644 --- a/packages/react-components/src/Sidebar.tsx +++ b/packages/react-components/src/Sidebar.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeProps } from './types'; + import React from 'react'; import styled from 'styled-components'; -import type { ThemeProps } from './types'; import Button from './Button'; interface Props { diff --git a/packages/react-components/src/StakingBonded.tsx b/packages/react-components/src/StakingBonded.tsx index 152c8de647..9d3c22df35 100644 --- a/packages/react-components/src/StakingBonded.tsx +++ b/packages/react-components/src/StakingBonded.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveStakingAccount } from '@polkadot/api-derive/types'; + import React from 'react'; -import type { DeriveStakingAccount } from '@polkadot/api-derive/types'; import { FormatBalance } from '@polkadot/react-query'; interface Props { diff --git a/packages/react-components/src/StakingRedeemable.tsx b/packages/react-components/src/StakingRedeemable.tsx index adf2a1e245..35a6a3a012 100644 --- a/packages/react-components/src/StakingRedeemable.tsx +++ b/packages/react-components/src/StakingRedeemable.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { DeriveStakingAccount } from '@polkadot/api-derive/types'; import type { Option } from '@polkadot/types'; import type { SlashingSpans } from '@polkadot/types/interfaces'; + +import React from 'react'; + import { useAccounts, useApi, useCall } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; diff --git a/packages/react-components/src/StakingUnbonding.tsx b/packages/react-components/src/StakingUnbonding.tsx index c716ae5c16..b87b95d549 100644 --- a/packages/react-components/src/StakingUnbonding.tsx +++ b/packages/react-components/src/StakingUnbonding.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveSessionProgress, DeriveStakingAccount, DeriveUnlocking } from '@polkadot/api-derive/types'; + import BN from 'bn.js'; import React, { useMemo } from 'react'; import styled from 'styled-components'; -import type { DeriveSessionProgress, DeriveStakingAccount, DeriveUnlocking } from '@polkadot/api-derive/types'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BlockToTime, FormatBalance } from '@polkadot/react-query'; import { BN_ONE, BN_ZERO, formatBalance, formatNumber } from '@polkadot/util'; diff --git a/packages/react-components/src/Status/Context.ts b/packages/react-components/src/Status/Context.ts index e484eb1961..f5da1accf0 100644 --- a/packages/react-components/src/Status/Context.ts +++ b/packages/react-components/src/Status/Context.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { QueueProps, QueueStatus, QueueTx } from './types'; +import React from 'react'; + const defaultState: Partial = { stqueue: [] as QueueStatus[], txqueue: [] as QueueTx[] diff --git a/packages/react-components/src/Status/Queue.tsx b/packages/react-components/src/Status/Queue.tsx index 43f3f2eebf..0bb6584a1b 100644 --- a/packages/react-components/src/Status/Queue.tsx +++ b/packages/react-components/src/Status/Queue.tsx @@ -1,17 +1,18 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useRef, useState } from 'react'; - import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; import type { Bytes } from '@polkadot/types'; import type { DispatchError } from '@polkadot/types/interfaces'; import type { ITuple, SignerPayloadJSON } from '@polkadot/types/types'; +import type { ActionStatus, ActionStatusPartial, PartialQueueTxExtrinsic, PartialQueueTxRpc, QueueStatus, QueueTx, QueueTxExtrinsic, QueueTxRpc, QueueTxStatus, SignerCallback } from './types'; + +import React, { useCallback, useRef, useState } from 'react'; + import { SubmittableResult } from '@polkadot/api'; import { registry } from '@polkadot/react-api'; import jsonrpc from '@polkadot/types/interfaces/jsonrpc'; -import type { ActionStatus, ActionStatusPartial, PartialQueueTxExtrinsic, PartialQueueTxRpc, QueueStatus, QueueTx, QueueTxExtrinsic, QueueTxRpc, QueueTxStatus, SignerCallback } from './types'; import { getContractAbi } from '../util'; import { STATUS_COMPLETE } from './constants'; import { QueueProvider } from './Context'; diff --git a/packages/react-components/src/Status/index.tsx b/packages/react-components/src/Status/index.tsx index 4a543097ce..6c2de7bb57 100644 --- a/packages/react-components/src/Status/index.tsx +++ b/packages/react-components/src/Status/index.tsx @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { IconName } from '@fortawesome/fontawesome-svg-core'; +import type { QueueStatus, QueueTx, QueueTxStatus } from './types'; + import React, { useCallback, useContext, useEffect, useState } from 'react'; import styled from 'styled-components'; -import type { QueueStatus, QueueTx, QueueTxStatus } from './types'; import AddressMini from '../AddressMini'; import Button from '../Button'; import Icon from '../Icon'; diff --git a/packages/react-components/src/Table/Body.tsx b/packages/react-components/src/Table/Body.tsx index 5e15ab74d5..0a1fa2c892 100644 --- a/packages/react-components/src/Table/Body.tsx +++ b/packages/react-components/src/Table/Body.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeProps } from '../types'; + import React from 'react'; import styled from 'styled-components'; import { isString } from '@polkadot/util'; -import type { ThemeProps } from '../types'; import Spinner from '../Spinner'; interface Props { diff --git a/packages/react-components/src/Table/Foot.tsx b/packages/react-components/src/Table/Foot.tsx index 2902014632..0aee8fcb34 100644 --- a/packages/react-components/src/Table/Foot.tsx +++ b/packages/react-components/src/Table/Foot.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeProps } from '../types'; + import React from 'react'; import styled from 'styled-components'; -import type { ThemeProps } from '../types'; - interface Props { className?: string; footer?: React.ReactNode; diff --git a/packages/react-components/src/Table/Head.tsx b/packages/react-components/src/Table/Head.tsx index 06bd1166f3..3c2bfae7bf 100644 --- a/packages/react-components/src/Table/Head.tsx +++ b/packages/react-components/src/Table/Head.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeProps } from '../types'; + import React from 'react'; import styled from 'styled-components'; -import type { ThemeProps } from '../types'; - type HeaderDef = [React.ReactNode?, string?, number?, (() => void)?]; interface Props { diff --git a/packages/react-components/src/Tabs/Tab.tsx b/packages/react-components/src/Tabs/Tab.tsx index 5df0784bb4..eb77e07543 100644 --- a/packages/react-components/src/Tabs/Tab.tsx +++ b/packages/react-components/src/Tabs/Tab.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeProps } from '../types'; +import type { TabItem } from './types'; + import React from 'react'; import { NavLink } from 'react-router-dom'; import styled from 'styled-components'; -import type { ThemeProps } from '../types'; -import type { TabItem } from './types'; import Badge from '../Badge'; import Icon from '../Icon'; diff --git a/packages/react-components/src/Tabs/index.tsx b/packages/react-components/src/Tabs/index.tsx index 982c15fbdf..0e05c8ca31 100644 --- a/packages/react-components/src/Tabs/index.tsx +++ b/packages/react-components/src/Tabs/index.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeProps } from '../types'; +import type { TabItem } from './types'; + import React, { useEffect } from 'react'; import { useLocation } from 'react-router-dom'; import styled from 'styled-components'; -import type { ThemeProps } from '../types'; -import type { TabItem } from './types'; import Tab from './Tab'; interface Props { diff --git a/packages/react-components/src/Tags.tsx b/packages/react-components/src/Tags.tsx index 70d973a42f..7895ccdd8d 100644 --- a/packages/react-components/src/Tags.tsx +++ b/packages/react-components/src/Tags.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { VoidFn } from './types'; + import React, { useCallback, useMemo } from 'react'; import styled from 'styled-components'; -import type { VoidFn } from './types'; import EditButton from './EditButton'; import InputTags from './InputTags'; import Tag from './Tag'; diff --git a/packages/react-components/src/TextArea.tsx b/packages/react-components/src/TextArea.tsx index 3918d0a5e7..049175a80a 100644 --- a/packages/react-components/src/TextArea.tsx +++ b/packages/react-components/src/TextArea.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeProps } from './types'; + import React, { useCallback } from 'react'; import styled from 'styled-components'; -import type { ThemeProps } from './types'; import Labelled from './Labelled'; interface Props { diff --git a/packages/react-components/src/Toggle.tsx b/packages/react-components/src/Toggle.tsx index bbc437a3bc..3dc3edc372 100644 --- a/packages/react-components/src/Toggle.tsx +++ b/packages/react-components/src/Toggle.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeProps } from './types'; + import React, { useCallback } from 'react'; import styled from 'styled-components'; -import type { ThemeProps } from './types'; - interface Props { className?: string; isDisabled?: boolean; diff --git a/packages/react-components/src/TreasuryProposal.tsx b/packages/react-components/src/TreasuryProposal.tsx index 2bd33c1bc4..9d00fc8a76 100644 --- a/packages/react-components/src/TreasuryProposal.tsx +++ b/packages/react-components/src/TreasuryProposal.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useEffect, useState } from 'react'; - import type { Option } from '@polkadot/types'; import type { TreasuryProposal as TreasuryProposalType } from '@polkadot/types/interfaces'; + +import React, { useEffect, useState } from 'react'; + import { InputAddress, Labelled, Static } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; diff --git a/packages/react-components/src/TxButton.tsx b/packages/react-components/src/TxButton.tsx index 109a8723ac..bb653a03b4 100644 --- a/packages/react-components/src/TxButton.tsx +++ b/packages/react-components/src/TxButton.tsx @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsic } from '@polkadot/api/types'; +import type { TxButtonProps as Props } from './types'; + import React, { useCallback, useContext, useEffect, useState } from 'react'; -import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { SubmittableResult } from '@polkadot/api'; import { useApi, useIsMountedRef } from '@polkadot/react-hooks'; import { assert, isFunction } from '@polkadot/util'; -import type { TxButtonProps as Props } from './types'; import Button from './Button'; import { StatusContext } from './Status'; import { useTranslation } from './translate'; diff --git a/packages/react-components/src/TxModal.tsx b/packages/react-components/src/TxModal.tsx index bbfc91435d..efded4fad4 100644 --- a/packages/react-components/src/TxModal.tsx +++ b/packages/react-components/src/TxModal.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { I18nProps } from '@polkadot/react-components/types'; + import React from 'react'; -import type { I18nProps } from '@polkadot/react-components/types'; import { InputAddress, Modal, TxButton, TxComponent } from '@polkadot/react-components'; export interface TxModalProps extends I18nProps { diff --git a/packages/react-components/src/TxModalNew.tsx b/packages/react-components/src/TxModalNew.tsx index 57c2d8656b..85fae93424 100644 --- a/packages/react-components/src/TxModalNew.tsx +++ b/packages/react-components/src/TxModalNew.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { TxModalProps as Props } from './types'; + import React, { useEffect, useState } from 'react'; import { Button, InputAddress, Modal } from '@polkadot/react-components'; // import { useTx } from '@polkadot/react-hooks'; import { isUndefined } from '@polkadot/util'; -import type { TxModalProps as Props } from './types'; import translate from './translate'; function TxModal

({ diff --git a/packages/react-components/src/VoteValue.tsx b/packages/react-components/src/VoteValue.tsx index a0223be26e..3ec4bc7c65 100644 --- a/packages/react-components/src/VoteValue.tsx +++ b/packages/react-components/src/VoteValue.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; + import BN from 'bn.js'; import React, { useCallback, useEffect, useState } from 'react'; -import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BalanceVoting } from '@polkadot/react-query'; import { BN_ZERO } from '@polkadot/util'; diff --git a/packages/react-components/src/styles/index.ts b/packages/react-components/src/styles/index.ts index 624697abfc..9b7828ca21 100644 --- a/packages/react-components/src/styles/index.ts +++ b/packages/react-components/src/styles/index.ts @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeProps } from '../types'; + import { createGlobalStyle } from 'styled-components'; -import type { ThemeProps } from '../types'; import cssComponents from './components'; import cssForm from './form'; import cssMedia from './media'; diff --git a/packages/react-components/src/translate.ts b/packages/react-components/src/translate.ts index 154497d1ed..0471124621 100644 --- a/packages/react-components/src/translate.ts +++ b/packages/react-components/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase, withTranslation } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/react-components/src/types.ts b/packages/react-components/src/types.ts index 88892d17a4..1e6769eedf 100644 --- a/packages/react-components/src/types.ts +++ b/packages/react-components/src/types.ts @@ -2,14 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 import type { IconName } from '@fortawesome/fontawesome-svg-core'; -import type { WithTranslation } from 'react-i18next'; - -import type { Abi } from '@polkadot/api-contract'; import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; +import type { Abi } from '@polkadot/api-contract'; import type { ActionStatus } from '@polkadot/react-components/Status/types'; import type { TxState } from '@polkadot/react-hooks/types'; import type { AccountId, Index } from '@polkadot/types/interfaces'; - +import type { WithTranslation } from 'react-i18next'; import type { ButtonProps } from './Button/types'; import type { InputAddressProps } from './InputAddress/types'; import type { TxCallback, TxFailedCallback } from './Status/types'; diff --git a/packages/react-components/src/util/checkVisibility.tsx b/packages/react-components/src/util/checkVisibility.tsx index 9563ef0cd9..372e9a8f7c 100644 --- a/packages/react-components/src/util/checkVisibility.tsx +++ b/packages/react-components/src/util/checkVisibility.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { DeriveAccountInfo } from '@polkadot/api-derive/types'; + import { ApiPromise } from '@polkadot/api'; import keyring from '@polkadot/ui-keyring'; diff --git a/packages/react-components/src/util/getAddressMeta.ts b/packages/react-components/src/util/getAddressMeta.ts index 27f7321f1b..80eccc7bf1 100644 --- a/packages/react-components/src/util/getAddressMeta.ts +++ b/packages/react-components/src/util/getAddressMeta.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { KeyringItemType, KeyringJson$Meta } from '@polkadot/ui-keyring/types'; + import keyring from '@polkadot/ui-keyring'; export default function getAddressMeta (address: string, type: KeyringItemType | null = null): KeyringJson$Meta { diff --git a/packages/react-components/src/util/getContractAbi.ts b/packages/react-components/src/util/getContractAbi.ts index 9dab03dfb2..9ceff10e82 100644 --- a/packages/react-components/src/util/getContractAbi.ts +++ b/packages/react-components/src/util/getContractAbi.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { AnyJson } from '@polkadot/types/types'; + import { Abi } from '@polkadot/api-contract'; import { api } from '@polkadot/react-api'; diff --git a/packages/react-hooks/src/translate.ts b/packages/react-hooks/src/translate.ts index bf68cc3d07..c6a3c00122 100644 --- a/packages/react-hooks/src/translate.ts +++ b/packages/react-hooks/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase, withTranslation } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/react-hooks/src/types.ts b/packages/react-hooks/src/types.ts index 5c97601761..2ea334294f 100644 --- a/packages/react-hooks/src/types.ts +++ b/packages/react-hooks/src/types.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveAccountFlags, DeriveAccountRegistration } from '@polkadot/api-derive/types'; import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; +import type { DeriveAccountFlags, DeriveAccountRegistration } from '@polkadot/api-derive/types'; import type { ConstructTxFn, StringOrNull, VoidFn } from '@polkadot/react-components/types'; import type { AccountId, Balance, BlockNumber, Call, Exposure, Hash, RewardDestination, SessionIndex, StakingLedger, ValidatorPrefs } from '@polkadot/types/interfaces'; import type { IExtrinsic } from '@polkadot/types/types'; diff --git a/packages/react-hooks/src/useAccountId.ts b/packages/react-hooks/src/useAccountId.ts index ec3b9c8dd6..b3708cb9c4 100644 --- a/packages/react-hooks/src/useAccountId.ts +++ b/packages/react-hooks/src/useAccountId.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { useCallback, useState } from 'react'; - import type { StringOrNull } from '@polkadot/react-components/types'; +import { useCallback, useState } from 'react'; + export function useAccountId (initialValue: StringOrNull = null, onChangeAccountId?: (_: StringOrNull) => void): [StringOrNull, (_: StringOrNull) => void] { const [accountId, setAccountId] = useState(initialValue); diff --git a/packages/react-hooks/src/useAccountInfo.ts b/packages/react-hooks/src/useAccountInfo.ts index 3d5b56b407..857b5c9b71 100644 --- a/packages/react-hooks/src/useAccountInfo.ts +++ b/packages/react-hooks/src/useAccountInfo.ts @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { useCallback, useEffect, useState } from 'react'; - import type { DeriveAccountFlags, DeriveAccountInfo } from '@polkadot/api-derive/types'; import type { StringOrNull } from '@polkadot/react-components/types'; import type { KeyringJson$Meta } from '@polkadot/ui-keyring/types'; +import type { AddressFlags, AddressIdentity, UseAccountInfo } from './types'; + +import { useCallback, useEffect, useState } from 'react'; + import keyring from '@polkadot/ui-keyring'; -import type { AddressFlags, AddressIdentity, UseAccountInfo } from './types'; import { useAccounts } from './useAccounts'; import { useAddresses } from './useAddresses'; import { useApi } from './useApi'; diff --git a/packages/react-hooks/src/useApi.ts b/packages/react-hooks/src/useApi.ts index a6d8cbae88..ba6e6e561c 100644 --- a/packages/react-hooks/src/useApi.ts +++ b/packages/react-hooks/src/useApi.ts @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ApiProps } from '@polkadot/react-api/types'; + import { useContext } from 'react'; -import type { ApiProps } from '@polkadot/react-api/types'; import { ApiContext } from '@polkadot/react-api'; export function useApi (): ApiProps { diff --git a/packages/react-hooks/src/useAvailableSlashes.ts b/packages/react-hooks/src/useAvailableSlashes.ts index ccd6a9f778..8bea5de0d1 100644 --- a/packages/react-hooks/src/useAvailableSlashes.ts +++ b/packages/react-hooks/src/useAvailableSlashes.ts @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-council authors & contributors // SPDX-License-Identifier: Apache-2.0 -import BN from 'bn.js'; -import { useEffect, useState } from 'react'; - import type { DeriveSessionIndexes } from '@polkadot/api-derive/types'; import type { Option, Vec } from '@polkadot/types'; import type { EraIndex, UnappliedSlash } from '@polkadot/types/interfaces'; + +import BN from 'bn.js'; +import { useEffect, useState } from 'react'; + import { useApi, useCall, useIsMountedRef } from '@polkadot/react-hooks'; type Unsub = () => void; diff --git a/packages/react-hooks/src/useBlockTime.ts b/packages/react-hooks/src/useBlockTime.ts index c19577e890..ffca716636 100644 --- a/packages/react-hooks/src/useBlockTime.ts +++ b/packages/react-hooks/src/useBlockTime.ts @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Time } from '@polkadot/util/types'; + import BN from 'bn.js'; import { useMemo } from 'react'; -import type { Time } from '@polkadot/util/types'; import { useApi } from '@polkadot/react-hooks'; import { BN_ONE, extractTime } from '@polkadot/util'; diff --git a/packages/react-hooks/src/useCall.ts b/packages/react-hooks/src/useCall.ts index 585d382b85..710b94c1c0 100644 --- a/packages/react-hooks/src/useCall.ts +++ b/packages/react-hooks/src/useCall.ts @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 +// eslint-disable-next-line @typescript-eslint/no-unused-vars +import type { Codec } from '@polkadot/types/types'; +import type { CallOptions, CallParam, CallParams } from './types'; + import { useEffect, useRef, useState } from 'react'; -import type { Codec } from '@polkadot/types/types'; import { isNull, isUndefined } from '@polkadot/util'; -// eslint-disable-next-line @typescript-eslint/no-unused-vars -import type { CallOptions, CallParam, CallParams } from './types'; import { MountedRef, useIsMountedRef } from './useIsMountedRef'; type VoidFn = () => void; diff --git a/packages/react-hooks/src/useInflation.ts b/packages/react-hooks/src/useInflation.ts index 4ca9d21ffc..92e87616df 100644 --- a/packages/react-hooks/src/useInflation.ts +++ b/packages/react-hooks/src/useInflation.ts @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ApiPromise } from '@polkadot/api'; +import type { Inflation } from './types'; + import BN from 'bn.js'; import { useEffect, useState } from 'react'; -import type { ApiPromise } from '@polkadot/api'; import { getInflationParams } from '@polkadot/apps-config'; -import type { Inflation } from './types'; import { useApi } from './useApi'; import { useCall } from './useCall'; diff --git a/packages/react-hooks/src/useMembers.ts b/packages/react-hooks/src/useMembers.ts index 4248583622..6572bc616c 100644 --- a/packages/react-hooks/src/useMembers.ts +++ b/packages/react-hooks/src/useMembers.ts @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AccountId } from '@polkadot/types/interfaces'; + import { useMemo } from 'react'; -import type { AccountId } from '@polkadot/types/interfaces'; import { useAccounts, useApi, useCall } from '@polkadot/react-hooks'; interface Result { diff --git a/packages/react-hooks/src/useModal.ts b/packages/react-hooks/src/useModal.ts index 64244b52db..d6d91cb3ef 100644 --- a/packages/react-hooks/src/useModal.ts +++ b/packages/react-hooks/src/useModal.ts @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ModalState } from './types'; + import { useCallback } from 'react'; -import type { ModalState } from './types'; import { useToggle } from './useToggle'; export function useModal (defaultIsOpen?: boolean, onOpen?: () => void, onClose?: () => void): ModalState { diff --git a/packages/react-hooks/src/useOwnEraRewards.ts b/packages/react-hooks/src/useOwnEraRewards.ts index 1094e6ff27..18b6a3dad9 100644 --- a/packages/react-hooks/src/useOwnEraRewards.ts +++ b/packages/react-hooks/src/useOwnEraRewards.ts @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { useEffect, useState } from 'react'; - import type { DeriveEraPoints, DeriveEraRewards, DeriveStakerReward } from '@polkadot/api-derive/types'; import type { EraIndex } from '@polkadot/types/interfaces'; +import type { StakerState } from './types'; + +import { useEffect, useState } from 'react'; + import { registry } from '@polkadot/react-api'; import { BN_ZERO } from '@polkadot/util'; -import type { StakerState } from './types'; import { useApi } from './useApi'; import { useCall } from './useCall'; import { useIsMountedRef } from './useIsMountedRef'; diff --git a/packages/react-hooks/src/useOwnStashInfos.ts b/packages/react-hooks/src/useOwnStashInfos.ts index 7f3b8775be..bfee80c161 100644 --- a/packages/react-hooks/src/useOwnStashInfos.ts +++ b/packages/react-hooks/src/useOwnStashInfos.ts @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { useEffect, useMemo, useState } from 'react'; - import type { DeriveStakingAccount } from '@polkadot/api-derive/types'; import type { AccountId, ValidatorPrefs } from '@polkadot/types/interfaces'; import type { Codec, ITuple } from '@polkadot/types/types'; +import type { StakerState } from './types'; + +import { useEffect, useMemo, useState } from 'react'; + import { u8aConcat, u8aToHex } from '@polkadot/util'; -import type { StakerState } from './types'; import { useAccounts } from './useAccounts'; import { useApi } from './useApi'; import { useIsMountedRef } from './useIsMountedRef'; diff --git a/packages/react-hooks/src/useOwnStashes.ts b/packages/react-hooks/src/useOwnStashes.ts index 9b110b78f8..6d92d3b5eb 100644 --- a/packages/react-hooks/src/useOwnStashes.ts +++ b/packages/react-hooks/src/useOwnStashes.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { useMemo } from 'react'; - import type { Option } from '@polkadot/types'; import type { AccountId, StakingLedger } from '@polkadot/types/interfaces'; +import { useMemo } from 'react'; + import { useAccounts } from './useAccounts'; import { useApi } from './useApi'; import { useCall } from './useCall'; diff --git a/packages/react-hooks/src/useRegistrars.ts b/packages/react-hooks/src/useRegistrars.ts index eb8ec39a36..b2d96e13e9 100644 --- a/packages/react-hooks/src/useRegistrars.ts +++ b/packages/react-hooks/src/useRegistrars.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { useMemo } from 'react'; - import type { Option } from '@polkadot/types'; import type { RegistrarInfo } from '@polkadot/types/interfaces'; +import { useMemo } from 'react'; + import { useAccounts } from './useAccounts'; import { useApi } from './useApi'; import { useCall } from './useCall'; diff --git a/packages/react-hooks/src/useSudo.ts b/packages/react-hooks/src/useSudo.ts index 42d511ea86..e23bab90ae 100644 --- a/packages/react-hooks/src/useSudo.ts +++ b/packages/react-hooks/src/useSudo.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AccountId } from '@polkadot/types/interfaces'; +import type { UseSudo } from './types'; + import { useEffect, useState } from 'react'; -import type { AccountId } from '@polkadot/types/interfaces'; - -import type { UseSudo } from './types'; import { useAccounts } from './useAccounts'; import { useApi } from './useApi'; import { useCall } from './useCall'; diff --git a/packages/react-hooks/src/useVotingStatus.ts b/packages/react-hooks/src/useVotingStatus.ts index 9303122ef0..9449b295fd 100644 --- a/packages/react-hooks/src/useVotingStatus.ts +++ b/packages/react-hooks/src/useVotingStatus.ts @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { BlockNumber, Votes } from '@polkadot/types/interfaces'; + import BN from 'bn.js'; import { useMemo } from 'react'; -import type { BlockNumber, Votes } from '@polkadot/types/interfaces'; import { ApiPromise } from '@polkadot/api'; import { isFunction } from '@polkadot/util'; diff --git a/packages/react-hooks/src/useWeight.ts b/packages/react-hooks/src/useWeight.ts index 5472de3760..afe1342b18 100644 --- a/packages/react-hooks/src/useWeight.ts +++ b/packages/react-hooks/src/useWeight.ts @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Call } from '@polkadot/types/interfaces'; + import BN from 'bn.js'; import { useEffect, useState } from 'react'; -import type { Call } from '@polkadot/types/interfaces'; import { BN_ZERO } from '@polkadot/util'; import { useApi } from './useApi'; diff --git a/packages/react-params/src/Holder.tsx b/packages/react-params/src/Holder.tsx index 290aea16ff..ccdc9df92a 100644 --- a/packages/react-params/src/Holder.tsx +++ b/packages/react-params/src/Holder.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeProps } from '@polkadot/react-components/types'; + import React from 'react'; import styled from 'styled-components'; -import type { ThemeProps } from '@polkadot/react-components/types'; - interface Props { children?: React.ReactNode; className?: string; diff --git a/packages/react-params/src/Param/Account.tsx b/packages/react-params/src/Param/Account.tsx index 7272518aa8..2f95345d17 100644 --- a/packages/react-params/src/Param/Account.tsx +++ b/packages/react-params/src/Param/Account.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Props } from '../types'; + import React, { useCallback, useState } from 'react'; import { InputAddress } from '@polkadot/react-components'; import keyring from '@polkadot/ui-keyring'; -import type { Props } from '../types'; import Bare from './Bare'; function Account ({ className = '', defaultValue: { value }, isDisabled, isError, isInOption, label, onChange, withLabel }: Props): React.ReactElement { diff --git a/packages/react-params/src/Param/Amount.tsx b/packages/react-params/src/Param/Amount.tsx index 40001a3c20..d5cf11a06c 100644 --- a/packages/react-params/src/Param/Amount.tsx +++ b/packages/react-params/src/Param/Amount.tsx @@ -1,6 +1,8 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Props } from '../types'; + import BN from 'bn.js'; import React, { useCallback, useMemo } from 'react'; @@ -8,7 +10,6 @@ import { Input, InputNumber } from '@polkadot/react-components'; import { ClassOf } from '@polkadot/types/create'; import { bnToBn, formatNumber, isUndefined } from '@polkadot/util'; -import type { Props } from '../types'; import Bare from './Bare'; function Amount ({ className = '', defaultValue: { value }, isDisabled, isError, label, onChange, onEnter, registry, type, withLabel }: Props): React.ReactElement { diff --git a/packages/react-params/src/Param/Balance.tsx b/packages/react-params/src/Param/Balance.tsx index db23d11383..a18ce0eb03 100644 --- a/packages/react-params/src/Param/Balance.tsx +++ b/packages/react-params/src/Param/Balance.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Props } from '../types'; + import BN from 'bn.js'; import React, { useCallback, useState } from 'react'; import { InputBalance } from '@polkadot/react-components'; -import type { Props } from '../types'; import Bare from './Bare'; function Balance ({ className = '', defaultValue: { value }, isDisabled, isError, label, onChange, onEnter, onEscape, withLabel }: Props): React.ReactElement { diff --git a/packages/react-params/src/Param/Base.tsx b/packages/react-params/src/Param/Base.tsx index 6acd01e1f2..edfff60659 100644 --- a/packages/react-params/src/Param/Base.tsx +++ b/packages/react-params/src/Param/Base.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Size } from '../types'; + import React from 'react'; import { Labelled } from '@polkadot/react-components'; -import type { Size } from '../types'; import Bare from './Bare'; interface Props { diff --git a/packages/react-params/src/Param/BaseBytes.tsx b/packages/react-params/src/Param/BaseBytes.tsx index 0bf71749dc..7d999a654f 100644 --- a/packages/react-params/src/Param/BaseBytes.tsx +++ b/packages/react-params/src/Param/BaseBytes.tsx @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { TypeDef } from '@polkadot/types/types'; +import type { RawParam, RawParamOnChange, RawParamOnEnter, RawParamOnEscape, Size } from '../types'; + import React, { useCallback, useState } from 'react'; -import type { TypeDef } from '@polkadot/types/types'; import { CopyButton, Input } from '@polkadot/react-components'; import { compactAddLength, hexToU8a, isAscii, isHex, isU8a, stringToU8a, u8aToHex, u8aToString } from '@polkadot/util'; import { decodeAddress } from '@polkadot/util-crypto'; -import type { RawParam, RawParamOnChange, RawParamOnEnter, RawParamOnEscape, Size } from '../types'; import { useTranslation } from '../translate'; import Bare from './Bare'; diff --git a/packages/react-params/src/Param/Bool.tsx b/packages/react-params/src/Param/Bool.tsx index 543c7b098a..7343b15547 100644 --- a/packages/react-params/src/Param/Bool.tsx +++ b/packages/react-params/src/Param/Bool.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Props } from '../types'; + import React, { useCallback, useMemo, useState } from 'react'; import { Dropdown } from '@polkadot/react-components'; -import type { Props } from '../types'; import { useTranslation } from '../translate'; import Bare from './Bare'; diff --git a/packages/react-params/src/Param/Bytes.tsx b/packages/react-params/src/Param/Bytes.tsx index 0644af2ff8..4d3ef65397 100644 --- a/packages/react-params/src/Param/Bytes.tsx +++ b/packages/react-params/src/Param/Bytes.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Props } from '../types'; + import React, { useCallback, useState } from 'react'; import styled from 'styled-components'; import { Toggle } from '@polkadot/react-components'; import { compactAddLength } from '@polkadot/util'; -import type { Props } from '../types'; import { useTranslation } from '../translate'; import BaseBytes from './BaseBytes'; import File from './File'; diff --git a/packages/react-params/src/Param/Call.tsx b/packages/react-params/src/Param/Call.tsx index 5cd021ab18..1301d5e51a 100644 --- a/packages/react-params/src/Param/Call.tsx +++ b/packages/react-params/src/Param/Call.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Extrinsic } from '@polkadot/types/interfaces'; +import type { Props } from '../types'; + import React from 'react'; -import type { Extrinsic } from '@polkadot/types/interfaces'; import { Call, Static } from '@polkadot/react-components'; -import type { Props } from '../types'; import Bare from './Bare'; import Unknown from './Unknown'; diff --git a/packages/react-params/src/Param/Code.tsx b/packages/react-params/src/Param/Code.tsx index 08ab6d7d6f..6d59f78a40 100644 --- a/packages/react-params/src/Param/Code.tsx +++ b/packages/react-params/src/Param/Code.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Props } from '../types'; + import React, { useCallback, useState } from 'react'; import { isWasm } from '@polkadot/util'; -import type { Props } from '../types'; import Bytes from './Bytes'; import BytesFile from './File'; diff --git a/packages/react-params/src/Param/DispatchError.tsx b/packages/react-params/src/Param/DispatchError.tsx index 2975dde42a..d2b5438852 100644 --- a/packages/react-params/src/Param/DispatchError.tsx +++ b/packages/react-params/src/Param/DispatchError.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DispatchError } from '@polkadot/types/interfaces'; +import type { Props } from '../types'; + import React, { useEffect, useState } from 'react'; -import type { DispatchError } from '@polkadot/types/interfaces'; import { Input } from '@polkadot/react-components'; -import type { Props } from '../types'; import { useTranslation } from '../translate'; import Static from './Static'; import Unknown from './Unknown'; diff --git a/packages/react-params/src/Param/Enum.tsx b/packages/react-params/src/Param/Enum.tsx index ca772b139b..c4a45e36b4 100644 --- a/packages/react-params/src/Param/Enum.tsx +++ b/packages/react-params/src/Param/Enum.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { TypeDef } from '@polkadot/types/types'; +import type { ParamDef, Props, RawParam } from '../types'; + import React, { useCallback, useEffect, useState } from 'react'; -import type { TypeDef } from '@polkadot/types/types'; import { Dropdown } from '@polkadot/react-components'; import { Enum, getTypeDef } from '@polkadot/types'; -import type { ParamDef, Props, RawParam } from '../types'; import Params from '../'; import Bare from './Bare'; import Static from './Static'; diff --git a/packages/react-params/src/Param/Hash160.tsx b/packages/react-params/src/Param/Hash160.tsx index 1174209797..fdd1ea048b 100644 --- a/packages/react-params/src/Param/Hash160.tsx +++ b/packages/react-params/src/Param/Hash160.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Props } from '../types'; + import React from 'react'; -import type { Props } from '../types'; import BaseBytes from './BaseBytes'; function Hash160 ({ className = '', defaultValue, isDisabled, isError, label, name, onChange, onEnter, onEscape, type, withLabel }: Props): React.ReactElement { diff --git a/packages/react-params/src/Param/Hash256.tsx b/packages/react-params/src/Param/Hash256.tsx index 74b3868ba4..5ebc370e21 100644 --- a/packages/react-params/src/Param/Hash256.tsx +++ b/packages/react-params/src/Param/Hash256.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Props } from '../types'; + import React from 'react'; -import type { Props } from '../types'; import BaseBytes from './BaseBytes'; function Hash256 ({ className = '', defaultValue, isDisabled, isError, label, name, onChange, onEnter, onEscape, type, withLabel }: Props): React.ReactElement { diff --git a/packages/react-params/src/Param/Hash512.tsx b/packages/react-params/src/Param/Hash512.tsx index 3cc6c49d04..781678705d 100644 --- a/packages/react-params/src/Param/Hash512.tsx +++ b/packages/react-params/src/Param/Hash512.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Props } from '../types'; + import React from 'react'; -import type { Props } from '../types'; import BaseBytes from './BaseBytes'; function Hash512 ({ className = '', defaultValue, isDisabled, isError, label, name, onChange, onEnter, onEscape, type, withLabel }: Props): React.ReactElement { diff --git a/packages/react-params/src/Param/KeyValue.tsx b/packages/react-params/src/Param/KeyValue.tsx index b790adb42c..06539977e2 100644 --- a/packages/react-params/src/Param/KeyValue.tsx +++ b/packages/react-params/src/Param/KeyValue.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Props } from '../types'; + import React, { useCallback, useEffect, useState } from 'react'; import { Input } from '@polkadot/react-components'; import { compactAddLength, hexToU8a, u8aConcat } from '@polkadot/util'; -import type { Props } from '../types'; import Bare from './Bare'; interface StateParam { diff --git a/packages/react-params/src/Param/KeyValueArray.tsx b/packages/react-params/src/Param/KeyValueArray.tsx index fbdc68aa87..f402e40f97 100644 --- a/packages/react-params/src/Param/KeyValueArray.tsx +++ b/packages/react-params/src/Param/KeyValueArray.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useState } from 'react'; - import type { Vec } from '@polkadot/types'; import type { KeyValue as Pair } from '@polkadot/types/interfaces'; +import type { Props, RawParam } from '../types'; + +import React, { useCallback, useState } from 'react'; + import { assert, isHex, u8aToHex, u8aToString } from '@polkadot/util'; -import type { Props, RawParam } from '../types'; import { useTranslation } from '../translate'; import Base from './Base'; import Bytes from './Bytes'; diff --git a/packages/react-params/src/Param/Moment.tsx b/packages/react-params/src/Param/Moment.tsx index f8f50a5fe5..aeaed6004b 100644 --- a/packages/react-params/src/Param/Moment.tsx +++ b/packages/react-params/src/Param/Moment.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Props, RawParamOnChangeValue } from '../types'; + import React, { useCallback } from 'react'; import { Static } from '@polkadot/react-components'; -import type { Props, RawParamOnChangeValue } from '../types'; import Amount from './Amount'; function Moment ({ className = '', defaultValue, isDisabled, isError, label, onChange, onEnter, onEscape, registry, type, withLabel }: Props): React.ReactElement { diff --git a/packages/react-params/src/Param/Null.tsx b/packages/react-params/src/Param/Null.tsx index 10c7f669ca..c9d868307e 100644 --- a/packages/react-params/src/Param/Null.tsx +++ b/packages/react-params/src/Param/Null.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useEffect } from 'react'; - import type { Props } from '../types'; +import React, { useEffect } from 'react'; + function Null ({ onChange }: Props): React.ReactElement | null { useEffect((): void => { onChange && onChange({ diff --git a/packages/react-params/src/Param/OpaqueCall.tsx b/packages/react-params/src/Param/OpaqueCall.tsx index 715d9ea502..f11dca77e5 100644 --- a/packages/react-params/src/Param/OpaqueCall.tsx +++ b/packages/react-params/src/Param/OpaqueCall.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Bytes } from '@polkadot/types'; +import type { Props } from '../types'; + import React from 'react'; -import type { Bytes } from '@polkadot/types'; - -import type { Props } from '../types'; import CallDisplay from './Call'; import Unknown from './Unknown'; diff --git a/packages/react-params/src/Param/Option.tsx b/packages/react-params/src/Param/Option.tsx index 0656b1ceea..4c6088fc1d 100644 --- a/packages/react-params/src/Param/Option.tsx +++ b/packages/react-params/src/Param/Option.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { TypeDef } from '@polkadot/types/types'; +import type { Props } from '../types'; + import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; -import type { TypeDef } from '@polkadot/types/types'; import { Toggle } from '@polkadot/react-components'; -import type { Props } from '../types'; import { useTranslation } from '../translate'; import Param from './index'; diff --git a/packages/react-params/src/Param/Raw.tsx b/packages/react-params/src/Param/Raw.tsx index 51c560946a..5d5f6f30ca 100644 --- a/packages/react-params/src/Param/Raw.tsx +++ b/packages/react-params/src/Param/Raw.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Codec } from '@polkadot/types/types'; +import type { Props } from '../types'; + import React, { useCallback, useState } from 'react'; -import type { Codec } from '@polkadot/types/types'; import { Input } from '@polkadot/react-components'; -import type { Props } from '../types'; import Bare from './Bare'; function Raw ({ className = '', defaultValue: { value }, isDisabled, isError, label, onChange, onEnter, onEscape, withLabel }: Props): React.ReactElement { diff --git a/packages/react-params/src/Param/Static.tsx b/packages/react-params/src/Param/Static.tsx index 0429ab3b87..761f860a66 100644 --- a/packages/react-params/src/Param/Static.tsx +++ b/packages/react-params/src/Param/Static.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Codec } from '@polkadot/types/types'; +import type { RawParam } from '../types'; + import React from 'react'; import styled from 'styled-components'; -import type { Codec } from '@polkadot/types/types'; import { Static } from '@polkadot/react-components'; -import type { RawParam } from '../types'; import { useTranslation } from '../translate'; import Bare from './Bare'; diff --git a/packages/react-params/src/Param/Struct.tsx b/packages/react-params/src/Param/Struct.tsx index 34627f398f..69fe802d0e 100644 --- a/packages/react-params/src/Param/Struct.tsx +++ b/packages/react-params/src/Param/Struct.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Props, RawParam } from '../types'; + import React, { useCallback } from 'react'; -import type { Props, RawParam } from '../types'; import Params from '../'; import Base from './Base'; import Static from './Static'; diff --git a/packages/react-params/src/Param/Text.tsx b/packages/react-params/src/Param/Text.tsx index e79c9eb60d..0d41c2a39c 100644 --- a/packages/react-params/src/Param/Text.tsx +++ b/packages/react-params/src/Param/Text.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Props } from '../types'; + import React, { useCallback, useState } from 'react'; import { Input } from '@polkadot/react-components'; -import type { Props } from '../types'; import Bare from './Bare'; function Text ({ className = '', defaultValue: { value }, isDisabled, isError, label, onChange, onEnter, onEscape, withLabel }: Props): React.ReactElement { diff --git a/packages/react-params/src/Param/Tuple.tsx b/packages/react-params/src/Param/Tuple.tsx index 56244b56a0..ccc869a08f 100644 --- a/packages/react-params/src/Param/Tuple.tsx +++ b/packages/react-params/src/Param/Tuple.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Props, RawParam } from '../types'; + import React, { useCallback } from 'react'; -import type { Props, RawParam } from '../types'; import Params from '../'; import Base from './Base'; import Static from './Static'; diff --git a/packages/react-params/src/Param/Unknown.tsx b/packages/react-params/src/Param/Unknown.tsx index 061605903b..ae0e6c9b6d 100644 --- a/packages/react-params/src/Param/Unknown.tsx +++ b/packages/react-params/src/Param/Unknown.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Props } from '../types'; + import React from 'react'; -import type { Props } from '../types'; import BaseBytes from './BaseBytes'; import Static from './Static'; diff --git a/packages/react-params/src/Param/Vector.tsx b/packages/react-params/src/Param/Vector.tsx index 25b120e3a1..d4b919dcf6 100644 --- a/packages/react-params/src/Param/Vector.tsx +++ b/packages/react-params/src/Param/Vector.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ParamDef, Props, RawParam } from '../types'; + import React, { useCallback, useEffect, useState } from 'react'; import { Button } from '@polkadot/react-components'; import { isUndefined } from '@polkadot/util'; -import type { ParamDef, Props, RawParam } from '../types'; import Params from '../'; import getInitValue from '../initValue'; import { useTranslation } from '../translate'; diff --git a/packages/react-params/src/Param/VectorFixed.tsx b/packages/react-params/src/Param/VectorFixed.tsx index 2b28c1e165..3bc17299ff 100644 --- a/packages/react-params/src/Param/VectorFixed.tsx +++ b/packages/react-params/src/Param/VectorFixed.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ParamDef, Props, RawParam } from '../types'; + import React, { useEffect, useState } from 'react'; import { isUndefined } from '@polkadot/util'; -import type { ParamDef, Props, RawParam } from '../types'; import Params from '../'; import getInitValue from '../initValue'; import Base from './Base'; diff --git a/packages/react-params/src/Param/Vote.tsx b/packages/react-params/src/Param/Vote.tsx index 63c92e0a96..1a711d672a 100644 --- a/packages/react-params/src/Param/Vote.tsx +++ b/packages/react-params/src/Param/Vote.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Props } from '../types'; + import BN from 'bn.js'; import React, { useRef } from 'react'; import { Dropdown } from '@polkadot/react-components'; import { GenericVote } from '@polkadot/types'; -import type { Props } from '../types'; import { useTranslation } from '../translate'; import Bare from './Bare'; diff --git a/packages/react-params/src/Param/VoteThreshold.tsx b/packages/react-params/src/Param/VoteThreshold.tsx index 68995a0f10..91c5adcc21 100644 --- a/packages/react-params/src/Param/VoteThreshold.tsx +++ b/packages/react-params/src/Param/VoteThreshold.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Props } from '../types'; + import React, { useCallback } from 'react'; import { Dropdown } from '@polkadot/react-components'; import { ClassOf } from '@polkadot/types/create'; import { bnToBn } from '@polkadot/util'; -import type { Props } from '../types'; import Bare from './Bare'; type TextMap = Record; diff --git a/packages/react-params/src/Param/findComponent.ts b/packages/react-params/src/Param/findComponent.ts index 4741c854fd..6d59afbf43 100644 --- a/packages/react-params/src/Param/findComponent.ts +++ b/packages/react-params/src/Param/findComponent.ts @@ -2,11 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 import type { Registry, TypeDef } from '@polkadot/types/types'; +import type { ComponentMap, Props } from '../types'; + import { getTypeDef } from '@polkadot/types'; import { TypeDefInfo } from '@polkadot/types/types'; import { isBn } from '@polkadot/util'; -import type { ComponentMap, Props } from '../types'; import Account from './Account'; import Amount from './Amount'; import Balance from './Balance'; diff --git a/packages/react-params/src/Param/index.tsx b/packages/react-params/src/Param/index.tsx index f3fbd5410f..f45060a1dc 100644 --- a/packages/react-params/src/Param/index.tsx +++ b/packages/react-params/src/Param/index.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Props as CProps, Props } from '../types'; + import React, { useMemo, useRef } from 'react'; import { encodeTypeDef } from '@polkadot/types/create'; import { isUndefined } from '@polkadot/util'; -import type { Props as CProps, Props } from '../types'; import findComponent from './findComponent'; import Static from './Static'; diff --git a/packages/react-params/src/Param/useParamDefs.ts b/packages/react-params/src/Param/useParamDefs.ts index 44a3a86b24..bd24558b80 100644 --- a/packages/react-params/src/Param/useParamDefs.ts +++ b/packages/react-params/src/Param/useParamDefs.ts @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Registry, TypeDef } from '@polkadot/types/types'; +import type { ParamDef } from '../types'; + import { useEffect, useState } from 'react'; -import type { Registry, TypeDef } from '@polkadot/types/types'; import { getTypeDef } from '@polkadot/types/create'; -import type { ParamDef } from '../types'; - function expandDef (registry: Registry, td: TypeDef): TypeDef { try { return getTypeDef( diff --git a/packages/react-params/src/ParamComp.tsx b/packages/react-params/src/ParamComp.tsx index 9350a956e5..63798b8257 100644 --- a/packages/react-params/src/ParamComp.tsx +++ b/packages/react-params/src/ParamComp.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Registry, TypeDef } from '@polkadot/types/types'; +import type { ComponentMap, RawParam, RawParamOnChangeValue, RawParams } from './types'; + import React, { useCallback } from 'react'; -import type { Registry, TypeDef } from '@polkadot/types/types'; - -import type { ComponentMap, RawParam, RawParamOnChangeValue, RawParams } from './types'; import Param from './Param'; interface Props { diff --git a/packages/react-params/src/index.tsx b/packages/react-params/src/index.tsx index 63a5345e34..4e47c4e18a 100644 --- a/packages/react-params/src/index.tsx +++ b/packages/react-params/src/index.tsx @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { I18nProps } from '@polkadot/react-components/types'; import type { Registry } from '@polkadot/types/types'; +import type { ComponentMap, ParamDef, RawParam, RawParamOnChangeValue, RawParams } from './types'; + +import React from 'react'; + import { registry as defaultRegistry } from '@polkadot/react-api'; import { ErrorBoundary } from '@polkadot/react-components'; -import type { ComponentMap, ParamDef, RawParam, RawParamOnChangeValue, RawParams } from './types'; import Holder from './Holder'; import ParamComp from './ParamComp'; import translate from './translate'; diff --git a/packages/react-params/src/initValue.ts b/packages/react-params/src/initValue.ts index 613ae38838..384becb7ec 100644 --- a/packages/react-params/src/initValue.ts +++ b/packages/react-params/src/initValue.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Registry, TypeDef } from '@polkadot/types/types'; + import { getTypeDef } from '@polkadot/types'; import { TypeDefInfo } from '@polkadot/types/types'; import { BN_ZERO, isBn } from '@polkadot/util'; diff --git a/packages/react-params/src/translate.ts b/packages/react-params/src/translate.ts index 2c06a177f1..0438bff13d 100644 --- a/packages/react-params/src/translate.ts +++ b/packages/react-params/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase, withTranslation } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/react-params/src/valueToText.tsx b/packages/react-params/src/valueToText.tsx index 5e39c70a47..d3d4325581 100644 --- a/packages/react-params/src/valueToText.tsx +++ b/packages/react-params/src/valueToText.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { Keys, ValidatorId } from '@polkadot/types/interfaces'; import type { Codec } from '@polkadot/types/types'; + +import React from 'react'; + import { Option, Raw } from '@polkadot/types'; import { isFunction, isNull, isUndefined, u8aToHex } from '@polkadot/util'; diff --git a/packages/react-params/src/values.ts b/packages/react-params/src/values.ts index f5a164b968..a35e3009dd 100644 --- a/packages/react-params/src/values.ts +++ b/packages/react-params/src/values.ts @@ -2,9 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { Registry, TypeDef } from '@polkadot/types/types'; +import type { RawParam } from './types'; + import { isUndefined } from '@polkadot/util'; -import type { RawParam } from './types'; import getInitValue from './initValue'; export function createValue (registry: Registry, param: { type: TypeDef }): RawParam { diff --git a/packages/react-query/src/Available.tsx b/packages/react-query/src/Available.tsx index 65c79aaab1..2b46a0fe65 100644 --- a/packages/react-query/src/Available.tsx +++ b/packages/react-query/src/Available.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; + +import React from 'react'; + import { useApi, useCall } from '@polkadot/react-hooks'; import FormatBalance from './FormatBalance'; diff --git a/packages/react-query/src/Balance.tsx b/packages/react-query/src/Balance.tsx index 5cc4aca593..e6676127dc 100644 --- a/packages/react-query/src/Balance.tsx +++ b/packages/react-query/src/Balance.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; + +import React from 'react'; + import { useApi, useCall } from '@polkadot/react-hooks'; import FormatBalance from './FormatBalance'; diff --git a/packages/react-query/src/BalanceFree.tsx b/packages/react-query/src/BalanceFree.tsx index cd5b7af904..5dbbd40987 100644 --- a/packages/react-query/src/BalanceFree.tsx +++ b/packages/react-query/src/BalanceFree.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; + +import React from 'react'; + import { useApi, useCall } from '@polkadot/react-hooks'; import FormatBalance from './FormatBalance'; diff --git a/packages/react-query/src/BalanceVoting.tsx b/packages/react-query/src/BalanceVoting.tsx index 47fa00711a..514b4b566b 100644 --- a/packages/react-query/src/BalanceVoting.tsx +++ b/packages/react-query/src/BalanceVoting.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; + +import React from 'react'; + import { useApi, useCall } from '@polkadot/react-hooks'; import FormatBalance from './FormatBalance'; diff --git a/packages/react-query/src/BestFinalized.tsx b/packages/react-query/src/BestFinalized.tsx index 09c4342aab..9ed719cf57 100644 --- a/packages/react-query/src/BestFinalized.tsx +++ b/packages/react-query/src/BestFinalized.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { BlockNumber } from '@polkadot/types/interfaces'; + import React from 'react'; -import type { BlockNumber } from '@polkadot/types/interfaces'; import { useApi, useCall } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/react-query/src/BestNumber.tsx b/packages/react-query/src/BestNumber.tsx index 3e9e3bb80c..c9094cc213 100644 --- a/packages/react-query/src/BestNumber.tsx +++ b/packages/react-query/src/BestNumber.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { BlockNumber } from '@polkadot/types/interfaces'; + import React from 'react'; -import type { BlockNumber } from '@polkadot/types/interfaces'; import { useApi, useCall } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/react-query/src/BlockAuthors.tsx b/packages/react-query/src/BlockAuthors.tsx index f35f2a6004..835d7e0f9c 100644 --- a/packages/react-query/src/BlockAuthors.tsx +++ b/packages/react-query/src/BlockAuthors.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { EraRewardPoints } from '@polkadot/types/interfaces'; + import React, { useEffect, useState } from 'react'; -import type { EraRewardPoints } from '@polkadot/types/interfaces'; import { HeaderExtended } from '@polkadot/api-derive'; import { useApi, useCall } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/react-query/src/Bonded.tsx b/packages/react-query/src/Bonded.tsx index 7cca5e99af..ed9c56a340 100644 --- a/packages/react-query/src/Bonded.tsx +++ b/packages/react-query/src/Bonded.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { Option } from '@polkadot/types'; import type { AccountId, AccountIndex, Address, StakingLedger } from '@polkadot/types/interfaces'; + +import React from 'react'; + import { useApi, useCall } from '@polkadot/react-hooks'; import FormatBalance from './FormatBalance'; diff --git a/packages/react-query/src/Events.tsx b/packages/react-query/src/Events.tsx index 97ee96fe6f..1e31705306 100644 --- a/packages/react-query/src/Events.tsx +++ b/packages/react-query/src/Events.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { IndexedEvent, KeyedEvent } from './types'; + import React, { useEffect, useState } from 'react'; import { useApi } from '@polkadot/react-hooks'; import { stringToU8a } from '@polkadot/util'; import { xxhashAsHex } from '@polkadot/util-crypto'; -import type { IndexedEvent, KeyedEvent } from './types'; - type Events = KeyedEvent[]; interface Props { diff --git a/packages/react-query/src/FormatBalance.tsx b/packages/react-query/src/FormatBalance.tsx index b59233174b..f26dfbd122 100644 --- a/packages/react-query/src/FormatBalance.tsx +++ b/packages/react-query/src/FormatBalance.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { ThemeProps } from '@polkadot/react-components/types'; +import type { Compact } from '@polkadot/types'; + import BN from 'bn.js'; import React from 'react'; import styled from 'styled-components'; -import type { ThemeProps } from '@polkadot/react-components/types'; -import type { Compact } from '@polkadot/types'; import { formatBalance } from '@polkadot/util'; import { useTranslation } from './translate'; diff --git a/packages/react-query/src/LockedVote.tsx b/packages/react-query/src/LockedVote.tsx index 66f054a329..96055c7c93 100644 --- a/packages/react-query/src/LockedVote.tsx +++ b/packages/react-query/src/LockedVote.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; - import type { DeriveCouncilVote } from '@polkadot/api-derive/types'; import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; + +import React from 'react'; + import { useApi, useCall } from '@polkadot/react-hooks'; import FormatBalance from './FormatBalance'; diff --git a/packages/react-query/src/Nonce.tsx b/packages/react-query/src/Nonce.tsx index addd9376b2..3d12922282 100644 --- a/packages/react-query/src/Nonce.tsx +++ b/packages/react-query/src/Nonce.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; + import BN from 'bn.js'; import React from 'react'; -import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; import { useApi, useCall } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/react-query/src/TimeNow.tsx b/packages/react-query/src/TimeNow.tsx index 9212b2f893..79c8547d8c 100644 --- a/packages/react-query/src/TimeNow.tsx +++ b/packages/react-query/src/TimeNow.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Moment } from '@polkadot/types/interfaces'; + import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; -import type { Moment } from '@polkadot/types/interfaces'; import { useApi, useCall } from '@polkadot/react-hooks'; import Elapsed from './Elapsed'; diff --git a/packages/react-query/src/translate.ts b/packages/react-query/src/translate.ts index 0ad0ebd2d9..684f664569 100644 --- a/packages/react-query/src/translate.ts +++ b/packages/react-query/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase, withTranslation } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/react-signer/src/Address.tsx b/packages/react-signer/src/Address.tsx index bf0cb224e0..904fa2091d 100644 --- a/packages/react-signer/src/Address.tsx +++ b/packages/react-signer/src/Address.tsx @@ -1,19 +1,20 @@ // Copyright 2017-2020 @polkadot/react-signer authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useEffect, useMemo, useState } from 'react'; - import type { SubmittableExtrinsic } from '@polkadot/api/types'; import type { QueueTx } from '@polkadot/react-components/Status/types'; import type { Option, Vec } from '@polkadot/types'; import type { AccountId, BalanceOf, Call, Multisig, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces'; import type { ITuple } from '@polkadot/types/types'; +import type { AddressFlags, AddressProxy } from './types'; + +import React, { useCallback, useEffect, useMemo, useState } from 'react'; + import { ApiPromise } from '@polkadot/api'; import { InputAddress, Modal, Toggle } from '@polkadot/react-components'; import { useAccounts, useApi, useIsMountedRef } from '@polkadot/react-hooks'; import { isFunction } from '@polkadot/util'; -import type { AddressFlags, AddressProxy } from './types'; import Password from './Password'; import { useTranslation } from './translate'; import { extractExternal } from './util'; diff --git a/packages/react-signer/src/Password.tsx b/packages/react-signer/src/Password.tsx index 18b7eeb650..66dc1f27e2 100644 --- a/packages/react-signer/src/Password.tsx +++ b/packages/react-signer/src/Password.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-signer authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { KeyringPair } from '@polkadot/keyring/types'; + import React, { useEffect, useMemo, useState } from 'react'; import styled from 'styled-components'; -import type { KeyringPair } from '@polkadot/keyring/types'; import { Modal, Password, Toggle } from '@polkadot/react-components'; import keyring from '@polkadot/ui-keyring'; diff --git a/packages/react-signer/src/PaymentInfo.tsx b/packages/react-signer/src/PaymentInfo.tsx index ec3121133c..4e23566897 100644 --- a/packages/react-signer/src/PaymentInfo.tsx +++ b/packages/react-signer/src/PaymentInfo.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-signer authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; +import type { RuntimeDispatchInfo } from '@polkadot/types/interfaces'; + import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; import { Trans } from 'react-i18next'; -import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; -import type { RuntimeDispatchInfo } from '@polkadot/types/interfaces'; import { Expander } from '@polkadot/react-components'; import { useApi, useIsMountedRef } from '@polkadot/react-hooks'; import { formatBalance, isFunction } from '@polkadot/util'; diff --git a/packages/react-signer/src/SignFields.tsx b/packages/react-signer/src/SignFields.tsx index 3ed5da72fc..9967e99ba5 100644 --- a/packages/react-signer/src/SignFields.tsx +++ b/packages/react-signer/src/SignFields.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-signer authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { SignerOptions } from '@polkadot/api/submittable/types'; + import BN from 'bn.js'; import React, { useCallback, useEffect, useState } from 'react'; -import type { SignerOptions } from '@polkadot/api/submittable/types'; import { InputNumber, Modal, Output } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import { BN_ZERO } from '@polkadot/util'; diff --git a/packages/react-signer/src/Transaction.tsx b/packages/react-signer/src/Transaction.tsx index 48961dc627..3ad2422ef1 100644 --- a/packages/react-signer/src/Transaction.tsx +++ b/packages/react-signer/src/Transaction.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/react-signer authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { QueueTx } from '@polkadot/react-components/Status/types'; + import BN from 'bn.js'; import React from 'react'; import styled from 'styled-components'; -import type { QueueTx } from '@polkadot/react-components/Status/types'; import { Call, Expander, Modal } from '@polkadot/react-components'; import PaymentInfo from './PaymentInfo'; diff --git a/packages/react-signer/src/TxSigned.tsx b/packages/react-signer/src/TxSigned.tsx index 79252c3e33..ecbacc0e6c 100644 --- a/packages/react-signer/src/TxSigned.tsx +++ b/packages/react-signer/src/TxSigned.tsx @@ -1,15 +1,17 @@ // Copyright 2017-2020 @polkadot/react-signer authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useContext, useEffect, useState } from 'react'; -import styled from 'styled-components'; - import type { SignerOptions } from '@polkadot/api/submittable/types'; import type { SubmittableExtrinsic } from '@polkadot/api/types'; import type { KeyringPair } from '@polkadot/keyring/types'; import type { QueueTx, QueueTxMessageSetStatus } from '@polkadot/react-components/Status/types'; import type { Option } from '@polkadot/types'; import type { Multisig, Timepoint } from '@polkadot/types/interfaces'; +import type { AddressProxy, QrState } from './types'; + +import React, { useCallback, useContext, useEffect, useState } from 'react'; +import styled from 'styled-components'; + import { ApiPromise } from '@polkadot/api'; import { web3FromSource } from '@polkadot/extension-dapp'; import { registry } from '@polkadot/react-api'; @@ -18,7 +20,6 @@ import { useApi, useToggle } from '@polkadot/react-hooks'; import keyring from '@polkadot/ui-keyring'; import { assert, BN_ZERO } from '@polkadot/util'; -import type { AddressProxy, QrState } from './types'; import Address from './Address'; import Qr from './Qr'; import { AccountSigner, LedgerSigner, QrSigner } from './signers'; diff --git a/packages/react-signer/src/TxUnsigned.tsx b/packages/react-signer/src/TxUnsigned.tsx index 4cb6100a10..8a51036ee2 100644 --- a/packages/react-signer/src/TxUnsigned.tsx +++ b/packages/react-signer/src/TxUnsigned.tsx @@ -1,10 +1,11 @@ // Copyright 2017-2020 @polkadot/react-signer authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useCallback, useContext } from 'react'; - import type { SubmittableExtrinsic } from '@polkadot/api/types'; import type { QueueTx, QueueTxMessageSetStatus } from '@polkadot/react-components/Status/types'; + +import React, { useCallback, useContext } from 'react'; + import { Button, ErrorBoundary, Modal, StatusContext } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; diff --git a/packages/react-signer/src/index.tsx b/packages/react-signer/src/index.tsx index 597d61880d..0245fbde98 100644 --- a/packages/react-signer/src/index.tsx +++ b/packages/react-signer/src/index.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-signer authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React, { useContext, useEffect, useMemo } from 'react'; -import styled from 'styled-components'; - import type { QueueTx, QueueTxMessageSetStatus, QueueTxResult } from '@polkadot/react-components/Status/types'; import type { BareProps as Props } from '@polkadot/react-components/types'; import type { DefinitionRpcExt } from '@polkadot/types/types'; + +import React, { useContext, useEffect, useMemo } from 'react'; +import styled from 'styled-components'; + import { ApiPromise } from '@polkadot/api'; import { Modal, StatusContext } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; diff --git a/packages/react-signer/src/signers/AccountSigner.ts b/packages/react-signer/src/signers/AccountSigner.ts index 9f5ae6b3aa..3beecd5d24 100644 --- a/packages/react-signer/src/signers/AccountSigner.ts +++ b/packages/react-signer/src/signers/AccountSigner.ts @@ -4,6 +4,7 @@ import type { Signer, SignerResult } from '@polkadot/api/types'; import type { KeyringPair } from '@polkadot/keyring/types'; import type { SignerPayloadJSON } from '@polkadot/types/types'; + import { registry } from '@polkadot/react-api'; import { lockAccount } from '../util'; diff --git a/packages/react-signer/src/signers/ApiSigner.ts b/packages/react-signer/src/signers/ApiSigner.ts index 97097d463d..1def58cec7 100644 --- a/packages/react-signer/src/signers/ApiSigner.ts +++ b/packages/react-signer/src/signers/ApiSigner.ts @@ -6,6 +6,7 @@ import type { Signer, SignerResult } from '@polkadot/api/types'; import type { QueueTxMessageSetStatus, QueueTxPayloadAdd, QueueTxStatus } from '@polkadot/react-components/Status/types'; import type { Hash } from '@polkadot/types/interfaces'; import type { SignerPayloadJSON } from '@polkadot/types/types'; + import { registry } from '@polkadot/react-api'; import { ClassOf } from '@polkadot/types/create'; diff --git a/packages/react-signer/src/signers/LedgerSigner.ts b/packages/react-signer/src/signers/LedgerSigner.ts index cffb8840e0..ad791eba08 100644 --- a/packages/react-signer/src/signers/LedgerSigner.ts +++ b/packages/react-signer/src/signers/LedgerSigner.ts @@ -3,6 +3,7 @@ import type { Signer, SignerResult } from '@polkadot/api/types'; import type { SignerPayloadJSON } from '@polkadot/types/types'; + import { getLedger, registry } from '@polkadot/react-api'; let id = 0; diff --git a/packages/react-signer/src/signers/QrSigner.ts b/packages/react-signer/src/signers/QrSigner.ts index 3bdb2c3e00..b3cff3ed10 100644 --- a/packages/react-signer/src/signers/QrSigner.ts +++ b/packages/react-signer/src/signers/QrSigner.ts @@ -3,11 +3,11 @@ import type { Signer, SignerResult } from '@polkadot/api/types'; import type { SignerPayloadJSON } from '@polkadot/types/types'; +import type { QrState } from '../types'; + import { registry } from '@polkadot/react-api'; import { blake2AsU8a } from '@polkadot/util-crypto'; -import type { QrState } from '../types'; - export default class QrSigner implements Signer { readonly #setState: (state: QrState) => void; diff --git a/packages/react-signer/src/translate.ts b/packages/react-signer/src/translate.ts index ec619c0cb3..668c22ebc9 100644 --- a/packages/react-signer/src/translate.ts +++ b/packages/react-signer/src/translate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; + import { useTranslation as useTranslationBase, withTranslation } from 'react-i18next'; export function useTranslation (): UseTranslationResponse { diff --git a/packages/react-signer/src/util.ts b/packages/react-signer/src/util.ts index 48087c8005..a6a5bdf0e3 100644 --- a/packages/react-signer/src/util.ts +++ b/packages/react-signer/src/util.ts @@ -3,11 +3,11 @@ import type { KeyringPair } from '@polkadot/keyring/types'; import type { QueueTx, QueueTxMessageSetStatus, QueueTxStatus } from '@polkadot/react-components/Status/types'; +import type { AddressFlags } from './types'; + import { SubmittableResult } from '@polkadot/api'; import keyring from '@polkadot/ui-keyring'; -import type { AddressFlags } from './types'; - const NOOP = () => undefined; export const UNLOCK_MINS = 15; diff --git a/patches/eslint-plugin-simple-import-sort+6.0.1.patch b/patches/eslint-plugin-simple-import-sort+6.0.1.patch deleted file mode 100644 index 9d86f36268..0000000000 --- a/patches/eslint-plugin-simple-import-sort+6.0.1.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/node_modules/eslint-plugin-simple-import-sort/shared.js b/node_modules/eslint-plugin-simple-import-sort/shared.js -index 8012b59..4ed6327 100644 ---- a/node_modules/eslint-plugin-simple-import-sort/shared.js -+++ b/node_modules/eslint-plugin-simple-import-sort/shared.js -@@ -713,13 +713,13 @@ function sortImportExportItems(items) { - ? -1 - : itemB.isSideEffectImport - ? 1 -- : // Compare the `from` part. -- compare(itemA.source.source, itemB.source.source) || -+ : // Put type imports/exports before regular ones. -+ compare(itemA.source.kind, itemB.source.kind) || -+ // Compare the `from` part. -+ // compare(itemA.source.source, itemB.source.source) || - // The `.source` has been slightly tweaked. To stay fully deterministic, - // also sort on the original value. - compare(itemA.source.originalSource, itemB.source.originalSource) || -- // Then put type imports/exports before regular ones. -- compare(itemA.source.kind, itemB.source.kind) || - // Keep the original order if the sources are the same. It’s not worth - // trying to compare anything else, and you can use `import/no-duplicates` - // to get rid of the problem anyway. diff --git a/yarn.lock b/yarn.lock index 6558775cb6..a1b910b1e9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3972,13 +3972,6 @@ __metadata: languageName: node linkType: hard -"@yarnpkg/lockfile@npm:^1.1.0": - version: 1.1.0 - resolution: "@yarnpkg/lockfile@npm:1.1.0" - checksum: 76f3f2625334fb4d37881408643b61ae08e1cfcdeb5db3e3e92f626b3535f99e963df8bafe5c07d85aa1dd09a308939eb4d0667ed4a4e93e645417b6af6e9a2f - languageName: node - linkType: hard - "@zondax/ledger-polkadot@npm:^0.12.0": version: 0.12.0 resolution: "@zondax/ledger-polkadot@npm:0.12.0" @@ -8008,12 +8001,12 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-simple-import-sort@npm:^6.0.1": - version: 6.0.1 - resolution: "eslint-plugin-simple-import-sort@npm:6.0.1" +"eslint-plugin-simple-import-sort@npm:7.0.0-beta.1": + version: 7.0.0-beta.1 + resolution: "eslint-plugin-simple-import-sort@npm:7.0.0-beta.1" peerDependencies: eslint: ">=5.0.0" - checksum: d43a4eb603ea97b92076453be40217e3808e3f1e7901a0307c206ecff19bd85072dddfec16ec88d98bf3058781e98f62d5e929c3b0794f71d094688042714c61 + checksum: ca77161eed5babb78a55182478dcc3534ffb2f4bff543ba8746944000eb04191eb53b8c634e1b61e69ee175088e098f50290e75c9bea1db7e3d0843c4155d8e7 languageName: node linkType: hard @@ -8730,16 +8723,6 @@ __metadata: languageName: node linkType: hard -"find-yarn-workspace-root@npm:^1.2.1": - version: 1.2.1 - resolution: "find-yarn-workspace-root@npm:1.2.1" - dependencies: - fs-extra: ^4.0.3 - micromatch: ^3.1.4 - checksum: df97013b720daefe2746726144ed00b7b33a0e7f90213ba9e8e5c2c43e053903b2007b1496b7ab9a4694ca6dfae82cf97989e1d184c5e249e679412bdb215957 - languageName: node - linkType: hard - "find@npm:^0.3.0": version: 0.3.0 resolution: "find@npm:0.3.0" @@ -8891,28 +8874,6 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:^4.0.3": - version: 4.0.3 - resolution: "fs-extra@npm:4.0.3" - dependencies: - graceful-fs: ^4.1.2 - jsonfile: ^4.0.0 - universalify: ^0.1.0 - checksum: ad42def19446c82543ebfa707250de2e1adff8f1c902f9cad3946f69b3dad326696f70e86c3aebeab4bc4f19ff3ef9abee0460d7fb775122f3dc9142a4b1280f - languageName: node - linkType: hard - -"fs-extra@npm:^7.0.1": - version: 7.0.1 - resolution: "fs-extra@npm:7.0.1" - dependencies: - graceful-fs: ^4.1.2 - jsonfile: ^4.0.0 - universalify: ^0.1.0 - checksum: 0de3773953a13b517f053dbfa291166da076cc563cdd8f0ecefc64018ab15d2614f1707860b82e6b0e41695f613c1855f410749bd01bcb585f0243b1018a6595 - languageName: node - linkType: hard - "fs-extra@npm:^8.1.0": version: 8.1.0 resolution: "fs-extra@npm:8.1.0" @@ -11809,15 +11770,6 @@ fsevents@~2.1.2: languageName: node linkType: hard -"klaw-sync@npm:^6.0.0": - version: 6.0.0 - resolution: "klaw-sync@npm:6.0.0" - dependencies: - graceful-fs: ^4.1.11 - checksum: 40112f582d6b906ff556f2c8b67376bc1cad1939da981ac8265fcf6e46cad3bd521e7b9d1bd7e63016d744e7952eca4cb7a0da77466732c6b4e7fd51d42d76a4 - languageName: node - linkType: hard - "kleur@npm:^3.0.3": version: 3.0.3 resolution: "kleur@npm:3.0.3" @@ -14048,28 +14000,6 @@ fsevents@~2.1.2: languageName: node linkType: hard -"patch-package@npm:^6.2.2": - version: 6.2.2 - resolution: "patch-package@npm:6.2.2" - dependencies: - "@yarnpkg/lockfile": ^1.1.0 - chalk: ^2.4.2 - cross-spawn: ^6.0.5 - find-yarn-workspace-root: ^1.2.1 - fs-extra: ^7.0.1 - is-ci: ^2.0.0 - klaw-sync: ^6.0.0 - minimist: ^1.2.0 - rimraf: ^2.6.3 - semver: ^5.6.0 - slash: ^2.0.0 - tmp: ^0.0.33 - bin: - patch-package: index.js - checksum: 4225ee1028f387ed2c00d9c0d7ffbb03dba5b8adc26a6cc116e0f38f4cd08d232defa20dbca51bce088964d787291715f3603b496abc608f0c392643dd3d3a46 - languageName: node - linkType: hard - "path-browserify@npm:0.0.1": version: 0.0.1 resolution: "path-browserify@npm:0.0.1" @@ -14308,10 +14238,8 @@ fsevents@~2.1.2: electron: ^10.1.6 electron-builder: ^22.9.1 electron-builder-notarize: ^1.2.0 - eslint-plugin-simple-import-sort: ^6.0.1 + eslint-plugin-simple-import-sort: 7.0.0-beta.1 i18next-scanner: ^2.11.0 - patch-package: ^6.2.2 - postinstall-prepare: ^1.0.1 react: ^17.0.1 react-dom: ^17.0.1 react-is: ^17.0.1 @@ -14496,13 +14424,6 @@ fsevents@~2.1.2: languageName: node linkType: hard -"postinstall-prepare@npm:^1.0.1": - version: 1.0.1 - resolution: "postinstall-prepare@npm:1.0.1" - checksum: f514ddcaf3efac225bb12488791ec26b345a3eb6ad49ca977a8ab79bbc7c42ad9548d8c5eccbd8bff214ca9d245da272b5f2f6a3b364fcf5a8818960467d70fa - languageName: node - linkType: hard - "prebuild-install@npm:^5.3.5": version: 5.3.6 resolution: "prebuild-install@npm:5.3.6"