From 1e7ebdee4039226f4cc4e5c8d337193544a65484 Mon Sep 17 00:00:00 2001 From: Jaco Date: Fri, 19 May 2023 10:26:23 +0300 Subject: [PATCH] Break (some) circular dependencies (#9464) * Break (some) circular dependencies * Rebuild translations --- packages/apps-routing/src/transfer.ts | 2 +- .../apps/public/locales/en/app-accounts.json | 52 --- .../apps/public/locales/en/app-alliance.json | 2 - .../apps/public/locales/en/app-contracts.json | 1 - .../apps/public/locales/en/app-council.json | 3 - .../apps/public/locales/en/app-democracy.json | 3 - .../apps/public/locales/en/app-explorer.json | 1 - .../apps/public/locales/en/app-referenda.json | 1 - .../apps/public/locales/en/app-settings.json | 1 - .../apps/public/locales/en/app-staking.json | 36 -- .../apps/public/locales/en/app-staking2.json | 1 - .../apps/public/locales/en/apps-routing.json | 42 +- packages/apps/public/locales/en/index.json | 1 - .../public/locales/en/react-components.json | 59 +++ .../apps/public/locales/en/translation.json | 361 +----------------- packages/apps/src/Apps.tsx | 3 +- packages/apps/src/Content/index.tsx | 3 +- packages/apps/src/Root.tsx | 4 +- .../page-accounts/src/Accounts/Account.tsx | 5 +- .../src/CreateAccount.slow.spec.tsx | 2 +- packages/page-accounts/src/util.tsx | 7 - .../page-addresses/src/Contacts/Address.tsx | 5 +- .../page-bounties/src/Bounties.slow.spec.tsx | 2 +- .../page-bounties/test/pages/bountiesPage.tsx | 4 +- packages/page-claims/src/index.tsx | 2 +- packages/page-claims/src/util.ts | 6 +- packages/page-contracts/src/store.ts | 10 +- packages/page-contracts/src/useAbi.ts | 4 +- packages/page-explorer/src/index.tsx | 2 +- packages/page-extrinsics/src/index.tsx | 3 +- packages/react-api/src/Api.tsx | 47 +-- packages/react-api/src/hoc/api.tsx | 3 +- packages/react-api/src/index.ts | 3 +- packages/react-api/src/statics.ts | 17 + packages/react-api/src/typeRegistry.ts | 6 - packages/react-components/src/AccountName.tsx | 8 +- .../AccountSidebar}/AccountMenuButtons.tsx | 9 +- .../src/AccountSidebar}/AddressSection.tsx | 5 +- .../src/AccountSidebar}/Balances.tsx | 6 +- .../src/AccountSidebar}/Flags.tsx | 6 +- .../src/AccountSidebar}/Identity.tsx | 7 +- .../src/AccountSidebar}/JudgementTag.tsx | 16 +- .../src/AccountSidebar}/Judgements.tsx | 5 +- .../src/AccountSidebar}/Multisig.tsx | 5 +- .../AccountSidebar}/RegistrarJudgement.tsx | 8 +- .../src/AccountSidebar}/Sidebar.spec.tsx | 2 +- .../src/AccountSidebar}/Sidebar.tsx | 9 +- .../SidebarEditableSection.tsx | 2 +- .../src/AccountSidebar}/UserIcon.tsx | 2 +- .../src/AccountSidebar}/index.tsx | 8 +- .../react-components/src/BatchWarning.tsx | 2 +- packages/react-components/src/ChainLock.tsx | 2 +- packages/react-components/src/FilterInput.tsx | 2 +- packages/react-components/src/Flag.tsx | 2 +- packages/react-components/src/Forget.tsx | 2 +- .../react-components/src/InputConsts/units.ts | 10 + packages/react-components/src/InputNumber.tsx | 9 +- packages/react-components/src/InputTags.tsx | 2 +- .../react-components/src/Modal/Modal.spec.tsx | 2 +- .../react-components/src/Popup/Popup.spec.tsx | 2 +- packages/react-components/src/Sidebar.tsx | 2 +- packages/react-components/src/Tabs/Tab.tsx | 2 +- packages/react-components/src/Tabs/index.tsx | 6 +- packages/react-components/src/Tabs/types.ts | 21 - packages/react-components/src/Tag.tsx | 3 +- packages/react-components/src/index.ts | 10 +- .../src/modals/Transfer.tsx | 11 +- packages/react-components/src/modals/index.ts | 4 + .../react-components/src/styles/components.ts | 2 +- .../react-components/src/styles/semantic.ts | 2 +- .../{apps => react-components}/src/themes.ts | 4 +- packages/react-components/src/types.ts | 16 +- .../src/util/getContractAbi.ts | 4 +- .../react-hooks/src/ctx/AccountSidebar.tsx | 8 + packages/react-hooks/src/ctx/Api.tsx | 8 + packages/react-hooks/src/ctx/ApiStats.tsx | 2 +- packages/react-hooks/src/ctx/Queue.tsx | 2 +- packages/react-hooks/src/ctx/Tabs.tsx | 13 + packages/react-hooks/src/ctx/types.ts | 4 - packages/react-hooks/src/translate.ts | 2 +- packages/react-hooks/src/types.ts | 2 +- packages/react-hooks/src/useApi.ts | 3 +- packages/react-hooks/src/useApiStats.ts | 2 +- packages/react-hooks/src/useMemoValue.spec.ts | 2 +- packages/react-hooks/src/useOutsideClick.ts | 2 +- packages/react-hooks/src/useTheme.ts | 2 +- packages/react-hooks/src/useTimer.ts | 2 +- packages/react-params/src/index.tsx | 6 +- packages/react-query/src/BlockToTime.tsx | 2 +- packages/react-query/src/Elapsed.tsx | 2 +- packages/react-query/src/FormatBalance.tsx | 2 +- packages/test-support/src/mockData/index.ts | 10 +- packages/test-support/src/pages/Page.tsx | 5 +- tsconfig.base.json | 5 - 94 files changed, 311 insertions(+), 699 deletions(-) create mode 100644 packages/react-api/src/statics.ts delete mode 100644 packages/react-api/src/typeRegistry.ts rename packages/{page-accounts/src/Sidebar => react-components/src/AccountSidebar}/AccountMenuButtons.tsx (94%) rename packages/{page-accounts/src/Sidebar => react-components/src/AccountSidebar}/AddressSection.tsx (93%) rename packages/{page-accounts/src/Sidebar => react-components/src/AccountSidebar}/Balances.tsx (87%) rename packages/{page-accounts/src/Sidebar => react-components/src/AccountSidebar}/Flags.tsx (94%) rename packages/{page-accounts/src/Sidebar => react-components/src/AccountSidebar}/Identity.tsx (96%) rename packages/{page-accounts/src/Sidebar => react-components/src/AccountSidebar}/JudgementTag.tsx (66%) rename packages/{page-accounts/src/Sidebar => react-components/src/AccountSidebar}/Judgements.tsx (89%) rename packages/{page-accounts/src/Sidebar => react-components/src/AccountSidebar}/Multisig.tsx (91%) rename packages/{page-accounts/src/Sidebar => react-components/src/AccountSidebar}/RegistrarJudgement.tsx (92%) rename packages/{page-accounts/src/Sidebar => react-components/src/AccountSidebar}/Sidebar.spec.tsx (99%) rename packages/{page-accounts/src/Sidebar => react-components/src/AccountSidebar}/Sidebar.tsx (96%) rename packages/{page-accounts/src/Sidebar => react-components/src/AccountSidebar}/SidebarEditableSection.tsx (98%) rename packages/{page-accounts/src/Sidebar => react-components/src/AccountSidebar}/UserIcon.tsx (99%) rename packages/{page-accounts/src/Sidebar => react-components/src/AccountSidebar}/index.tsx (78%) create mode 100644 packages/react-components/src/InputConsts/units.ts delete mode 100644 packages/react-components/src/Tabs/types.ts rename packages/{page-accounts => react-components}/src/modals/Transfer.tsx (95%) create mode 100644 packages/react-components/src/modals/index.ts rename packages/{apps => react-components}/src/themes.ts (55%) create mode 100644 packages/react-hooks/src/ctx/AccountSidebar.tsx create mode 100644 packages/react-hooks/src/ctx/Api.tsx create mode 100644 packages/react-hooks/src/ctx/Tabs.tsx diff --git a/packages/apps-routing/src/transfer.ts b/packages/apps-routing/src/transfer.ts index d905c8c18a..b185426834 100644 --- a/packages/apps-routing/src/transfer.ts +++ b/packages/apps-routing/src/transfer.ts @@ -4,7 +4,7 @@ import type { TFunction } from 'i18next'; import type { Route } from './types.js'; -import Modal from '@polkadot/app-accounts/modals/Transfer'; +import { TransferModal as Modal } from '@polkadot/react-components'; export default function create (t: TFunction): Route { return { diff --git a/packages/apps/public/locales/en/app-accounts.json b/packages/apps/public/locales/en/app-accounts.json index 8f5a21bf67..87d7e68fdf 100644 --- a/packages/apps/public/locales/en/app-accounts.json +++ b/packages/apps/public/locales/en/app-accounts.json @@ -5,7 +5,6 @@ "//hard/soft": "//hard/soft", "//hard/soft///password": "//hard/soft///password", "": "", - "": "", "@YourTwitterName": "@YourTwitterName", "@yourname:matrix.org": "@yourname:matrix.org", "A deposit paid by the proxied account that can not be used while the proxy is in existence. The deposit is returned when the proxy is destroyed. The amount reserved is based on the base deposit and number of proxies": "A deposit paid by the proxied account that can not be used while the proxy is in existence. The deposit is returned when the proxy is destroyed. The amount reserved is based on the base deposit and number of proxies", @@ -16,7 +15,6 @@ "Add account via Ledger": "Add account via Ledger", "Add account via Qr": "Add account via Qr", "Add an account via seed {{step}}/{{STEPS_COUNT}}": "Add an account via seed {{step}}/{{STEPS_COUNT}}", - "Add identity judgment": "Add identity judgment", "Add multisig": "Add multisig", "Add proxied account": "Add proxied account", "Add proxy": "Add proxy", @@ -30,7 +28,6 @@ "Approve this call hash": "Approve this call hash", "Backup": "Backup", "Backup account": "Backup account", - "Cancel": "Cancel", "Cancel this call hash": "Cancel this call hash", "Change": "Change", "Change account password": "Change account password", @@ -42,9 +39,6 @@ "Clear expired democracy locks": "Clear expired democracy locks", "Clear expired referenda locks": "Clear expired referenda locks", "Consider storing your account in a signer such as a browser extension, hardware device, QR-capable phone wallet (non-connected) or desktop application for optimal account security.": "Consider storing your account in a signer such as a browser extension, hardware device, QR-capable phone wallet (non-connected) or desktop application for optimal account security.", - "Copied": "Copied", - "Copy": "Copy", - "Council": "Council", "Create": "Create", "Create a backup file for this account": "Create a backup file for this account", "Custom index": "Custom index", @@ -56,14 +50,11 @@ "Derive account via derivation path": "Derive account via derivation path", "Development": "Development", "Download": "Download", - "Edit": "Edit", "Ensure that the extension has accounts, some accounts are visible globally and available for this chain and that you gave the application permission to access accounts from the extension to use them.": "Ensure that the extension has accounts, some accounts are visible globally and available for this chain and that you gave the application permission to access accounts from the extension to use them.", "Ensure that you utilized the \"Save\" functionality before using a generated address to receive funds. Without saving the address and the associated seed any funds sent to it will be lost.": "Ensure that you utilized the \"Save\" functionality before using a generated address to receive funds. Without saving the address and the associated seed any funds sent to it will be lost.", "Ensure you are using a strong password for proper account protection.": "Ensure you are using a strong password for proper account protection.", "Evaluated {{count}} keys in {{elapsed}}s ({{avg}} keys/s)": "Evaluated {{count}} keys in {{elapsed}}s ({{avg}} keys/s)", "Existing approvals ({{approvals}}/{{threshold}})": "Existing approvals ({{approvals}}/{{threshold}})", - "External": "External", - "Flags": "Flags", "For approvals outstanding approvers will be shown, for hashes that should be cancelled the first approver is required.": "For approvals outstanding approvers will be shown, for hashes that should be cancelled the first approver is required.", "Forget this account": "Forget this account", "From JSON": "From JSON", @@ -74,17 +65,13 @@ "I have saved my mnemonic seed safely": "I have saved my mnemonic seed safely", "Identity": "Identity", "If the delegated account is currently voting in a referendum, the delegating vote and conviction will be added.": "If the delegated account is currently voting in a referendum, the delegating vote and conviction will be added.", - "If the recipient account is new, the balance needs to be more than the existential deposit. Likewise if the sending account balance drops below the same value, the account will be removed from the state.": "If the recipient account is new, the balance needs to be more than the existential deposit. Likewise if the sending account balance drops below the same value, the account will be removed from the state.", "If you add several proxy accounts for the same proxy type (e.g 2 accounts set as proxy for Governance), then any of those 2 accounts will be able to perform governance actions on behalf of the proxied account": "If you add several proxy accounts for the same proxy type (e.g 2 accounts set as proxy for Governance), then any of those 2 accounts will be able to perform governance actions on behalf of the proxied account", "If you are moving accounts between applications, ensure that you use the correct type.": "If you are moving accounts between applications, ensure that you use the correct type.", "Initiate account recovery": "Initiate account recovery", "Initiate recovery for another": "Initiate recovery for another", - "Injected": "Injected", "It is recommended that you create/store your accounts securely and externally from the app. On {{yourBrowser}} the following browser extensions are available for use -": "It is recommended that you create/store your accounts securely and externally from the app. On {{yourBrowser}} the following browser extensions are available for use -", - "Judge": "Judge", "Learn more...": "Learn more...", "Ledger app type (originated from)": "Ledger app type (originated from)", - "Make Transfer": "Make Transfer", "Make recoverable": "Make recoverable", "Manage delegation": "Manage delegation", "Manage proxies": "Manage proxies", @@ -98,19 +85,14 @@ "My accounts": "My accounts", "Next": "Next", "No accounts": "No accounts", - "No identity associated with account": "No identity associated with account", - "No judgements": "No judgements", "No matches found": "No matches found", "No sub identities set.": "No sub identities set.", - "Nominator": "Nominator", - "Normal transfer without keep-alive checks": "Normal transfer without keep-alive checks", "One or more extensions are detected in your browser, however no accounts has been injected.": "One or more extensions are detected in your browser, however no accounts has been injected.", "Password are ignored for hex seed": "Password are ignored for hex seed", "Pending call hashes": "Pending call hashes", "Please make sure to save this file in a secure location as it is required, together with your password, to restore your account.": "Please make sure to save this file in a secure location as it is required, together with your password, to restore your account.", "Prev": "Prev", "Private Key": "Private Key", - "Provide judgement": "Provide judgement", "Provide the account QR from the module/external application for scanning. Once detected as valid, you will be taken to the next step to add the account to your list.": "Provide the account QR from the module/external application for scanning. Once detected as valid, you will be taken to the next step to add the account to your list.", "Proxied": "Proxied", "Proxied account has no owned proxies": "Proxied account has no owned proxies", @@ -119,7 +101,6 @@ "Recovery": "Recovery", "Register identity": "Register identity", "Register sub-identities": "Register sub-identities", - "Remove": "Remove", "Remove sub": "Remove sub", "Reset": "Reset", "Restore": "Restore", @@ -128,8 +109,6 @@ "Save delegation": "Save delegation", "Save this backup file in a secure location. Additionally, the password associated with this account is needed together with this backup file in order to restore your account.": "Save this backup file in a secure location. Additionally, the password associated with this account is needed together with this backup file in order to restore your account.", "Search for": "Search for", - "Send": "Send", - "Send funds": "Send funds", "Set Identity": "Set Identity", "Set Subs": "Set Subs", "Set on-chain identity": "Set on-chain identity", @@ -138,22 +117,17 @@ "Show address on hardware device": "Show address on hardware device", "Since some extensions, such as the polkadot-js extension, protects you against all community reported phishing sites, there are valid reasons to use them for additional protection, even if you are not storing accounts in it.": "Since some extensions, such as the polkadot-js extension, protects you against all community reported phishing sites, there are valid reasons to use them for additional protection, even if you are not storing accounts in it.", "Since the multisig function like any other account, once created it is available for selection anywhere accounts are used and needs to be funded before use.": "Since the multisig function like any other account, once created it is available for selection anywhere accounts are used and needs to be funded before use.", - "Society": "Society", "Soft derivation paths are not allowed on ed25519": "Soft derivation paths are not allowed on ed25519", "Start generation": "Start generation", "Start recovery": "Start recovery", "Stop generation": "Stop generation", - "Sudo key": "Sudo key", "Supply a JSON file with the list of signatories.": "Supply a JSON file with the list of signatories.", "Supply a backed-up JSON file, encrypted with your account-specific password.": "Supply a backed-up JSON file, encrypted with your account-specific password.", "Swap to a non-executing approval type, with subsequent calls providing the actual call data.": "Swap to a non-executing approval type, with subsequent calls providing the actual call data.", - "Technical committee": "Technical committee", - "Test account": "Test account", "The account type that you wish to create. This is the top-level derivation.": "The account type that you wish to create. This is the top-level derivation.", "The address index on the account that you wish to add. This is the second-level derivation.": "The address index on the account that you wish to add. This is the second-level derivation.", "The address that has previously setup a proxy to one of the accounts that you control.": "The address that has previously setup a proxy to one of the accounts that you control.", "The amount to allocate and the conviction that will be applied to all votes made on a referendum.": "The amount to allocate and the conviction that will be applied to all votes made on a referendum.", - "The beneficiary will have access to the transferred fees when the transaction is included in a block.": "The beneficiary will have access to the transferred fees when the transaction is included in a block.", "The call data for this transaction matching the hash. Once sent, the multisig will be executed against this.": "The call data for this transaction matching the hash. Once sent, the multisig will be executed against this.", "The call hash from the list of available and unapproved calls.": "The call hash from the list of available and unapproved calls.", "The creator for this multisig call": "The creator for this multisig call", @@ -173,15 +147,11 @@ "The operation type to apply. For approvals both non-final and final approvals are supported.": "The operation type to apply. For approvals both non-final and final approvals are supported.", "The password and password confirmation for this account. This is required to authenticate any transactions made and to encrypt the keypair.": "The password and password confirmation for this account. This is required to authenticate any transactions made and to encrypt the keypair.", "The password previously used to encrypt this account.": "The password previously used to encrypt this account.", - "The recipient is associated with a known phishing site on {{url}}": "The recipient is associated with a known phishing site on {{url}}", "The recoverable account is protected against the loss of seed/access by a social process.": "The recoverable account is protected against the loss of seed/access by a social process.", "The secret seed value for this account. Ensure that you keep this in a safe place, with access to the seed you can re-create the account.": "The secret seed value for this account. Ensure that you keep this in a safe place, with access to the seed you can re-create the account.", "The signatories has the ability to create transactions using the multisig and approve transactions sent by others.Once the threshold is reached with approvals, the multisig transaction is enacted on-chain.": "The signatories has the ability to create transactions using the multisig and approve transactions sent by others.Once the threshold is reached with approvals, the multisig transaction is enacted on-chain.", "The threshold for approval should be less or equal to the number of signatories for this multisig.": "The threshold for approval should be less or equal to the number of signatories for this multisig.", "The threshold for approvals and the delay is the protection associated with the account. The delay should be such that any colluding recovery attempts does have a window to stop.": "The threshold for approvals and the delay is the protection associated with the account. The delay should be such that any colluding recovery attempts does have a window to stop.", - "The transaction, after application of the transfer fees, will drop the available balance below the existential deposit. As such the transfer will fail. The account needs more free funds to cover the transaction fees.": "The transaction, after application of the transfer fees, will drop the available balance below the existential deposit. As such the transfer will fail. The account needs more free funds to cover the transaction fees.", - "The transferred balance will be subtracted (along with fees) from the sender account.": "The transferred balance will be subtracted (along with fees) from the sender account.", - "There is an existing reference count on the sender account. As such the account cannot be reaped from the state.": "There is an existing reference count on the sender account. As such the account cannot be reaped from the state.", "These are trusted individuals that can verify and approve any recovery actions. With recovery, once the threshold is reached, the funds associated with the account can be moved to a new destination.": "These are trusted individuals that can verify and approve any recovery actions. With recovery, once the threshold is reached, the funds associated with the account can be moved to a new destination.", "This account has a governance delegation": "This account has a governance delegation", "This account has a proxy set": "This account has a proxy set", @@ -192,19 +162,15 @@ "This is a development account derived from the known development seed. Do not use for any funds on a non-development network.": "This is a development account derived from the known development seed. Do not use for any funds on a non-development network.", "This is an invalid derivation path.": "This is an invalid derivation path.", "This will apply to any future use of this account as stored on this browser. Ensure that you securely store this new password and that it is strong and unique to the account.": "This will apply to any future use of this account as stored on this browser. Ensure that you securely store this new password and that it is strong and unique to the account.", - "Transfer the full account balance, reap the sender": "Transfer the full account balance, reap the sender", - "Transfer with account keep-alive checks": "Transfer with account keep-alive checks", "Undelegate": "Undelegate", "Unlock": "Unlock", "Unlock vested amount": "Unlock vested amount", "Upload JSON file with signatories": "Upload JSON file with signatories", "Use custom address index": "Use custom address index", "Use custom derivation path": "Use custom derivation path", - "Validator": "Validator", "Vanity generator": "Vanity generator", "View pending approvals": "View pending approvals", "We will provide you with a generated backup file after your account is created. As long as you have access to your account you can always download this file later by clicking on \"Backup\" button from the Accounts section.": "We will provide you with a generated backup file after your account is created. As long as you have access to your account you can always download this file later by clicking on \"Backup\" button from the Accounts section.", - "With the keep-alive option set, the account is protected against removal due to low balances.": "With the keep-alive option set, the account is protected against removal due to low balances.", "You don't have any accounts. Some features are currently hidden and will only become available once you have accounts.": "You don't have any accounts. Some features are currently hidden and will only become available once you have accounts.", "You have 1 extension that needs to be updated with the latest chain properties in order to display the correct information for the chain you are connected to.": "You have 1 extension that needs to be updated with the latest chain properties in order to display the correct information for the chain you are connected to.", "You have {{claimCount}} accounts that need attestations. Use the Claim Tokens app on the navigation bar to complete the process. Until you do, your balances for those accounts will not be reflected.": "You have {{claimCount}} accounts that need attestations. Use the Claim Tokens app on the navigation bar to complete the process. Until you do, your balances for those accounts will not be reflected.", @@ -227,7 +193,6 @@ "address index": "address index", "address {{index}}": "address {{index}}", "all locally stored accounts": "all locally stored accounts", - "amount": "amount", "approval type": "approval type", "available signatories": "available signatories", "available social recovery helpers": "available social recovery helpers", @@ -255,18 +220,12 @@ "display name": "display name", "email": "email", "ethereum private key": "ethereum private key", - "existential deposit": "existential deposit", "extension": "extension", "filter by name or tags": "filter by name or tags", "found signatories": "found signatories", "hardware": "hardware", "https://example.com": "https://example.com", - "identity": "identity", - "identity hash": "identity hash", "include field": "include field", - "index": "index", - "invalid/unknown registrar account": "invalid/unknown registrar account", - "judgement": "judgement", "keypair crypto type": "keypair crypto type", "keypair type": "keypair type", "legal name": "legal name", @@ -279,7 +238,6 @@ "new account": "new account", "on-chain multisig accounts": "on-chain multisig accounts", "on-chain proxied accounts": "on-chain proxied accounts", - "parent": "parent", "partial seed": "partial seed", "password": "password", "password (repeat)": "password (repeat)", @@ -294,24 +252,17 @@ "recovery block delay": "recovery block delay", "recovery threshold": "recovery threshold", "redeemable": "redeemable", - "registrar account": "registrar account", - "registrar index": "registrar index", "reserved balance": "reserved balance", - "riot": "riot", "riot name": "riot name", "secret": "secret", "secret derivation path": "secret derivation path", "seed (hex or string)": "seed (hex or string)", "selected signatories": "selected signatories", "send": "send", - "send from account": "send from account", - "send to address": "send to address", - "signatories": "signatories", "signatory": "signatory", "somebody@example.com": "somebody@example.com", "sort by": "sort by", "sub name": "sub name", - "subs": "subs", "the account to make recoverable": "the account to make recoverable", "the account to recover to": "the account to recover to", "threshold": "threshold", @@ -319,15 +270,12 @@ "total deposit": "total deposit", "total locked": "total locked", "total transferrable": "total transferrable", - "transferrable": "transferrable", - "transferrable minus fees": "transferrable minus fees", "trusted social recovery helpers": "trusted social recovery helpers", "twitter": "twitter", "unbonding": "unbonding", "upload signatories list": "upload signatories list", "via qr": "via qr", "web": "web", - "website": "website", "your current password": "your current password", "your new password": "your new password" } \ No newline at end of file diff --git a/packages/apps/public/locales/en/app-alliance.json b/packages/apps/public/locales/en/app-alliance.json index edc66ecb13..8cb0d733a0 100644 --- a/packages/apps/public/locales/en/app-alliance.json +++ b/packages/apps/public/locales/en/app-alliance.json @@ -23,13 +23,11 @@ "annoucements": "annoucements", "code": "code", "codec": "codec", - "deposit": "deposit", "kicking": "kicking", "members": "members", "no": "no", "prime voter": "prime voter", "retirting": "retirting", - "role": "role", "rule": "rule", "version": "version", "voter": "voter", diff --git a/packages/apps/public/locales/en/app-contracts.json b/packages/apps/public/locales/en/app-contracts.json index 240550f7ae..6860c5b804 100644 --- a/packages/apps/public/locales/en/app-contracts.json +++ b/packages/apps/public/locales/en/app-contracts.json @@ -26,7 +26,6 @@ "Save": "Save", "The code is not recognized as being in valid WASM format": "The code is not recognized as being in valid WASM format", "The codeHash is not a valid hex hash": "The codeHash is not a valid hex hash", - "The maximum amount of gas to use for this contract call. If the call requires more, it will fail.": "The maximum amount of gas to use for this contract call. If the call requires more, it will fail.", "The value is not in a valid address format": "The value is not in a valid address format", "This operation does not impact the associated on-chain code or any of its contracts.": "This operation does not impact the associated on-chain code or any of its contracts.", "This operation does not remove the uploaded code WASM and ABI from the chain, nor any deployed contracts. The forget operation only limits your access to the code on this browser.": "This operation does not remove the uploaded code WASM and ABI from the chain, nor any deployed contracts. The forget operation only limits your access to the code on this browser.", diff --git a/packages/apps/public/locales/en/app-council.json b/packages/apps/public/locales/en/app-council.json index bab14846b3..223074a7ad 100644 --- a/packages/apps/public/locales/en/app-council.json +++ b/packages/apps/public/locales/en/app-council.json @@ -3,7 +3,6 @@ "Cancel slashes": "Cancel slashes", "Close": "Close", "Close proposal": "Close proposal", - "Current prime member, default voting": "Current prime member, default voting", "In calculating the election outcome, this prioritized vote ordering will be used to determine the final score for the candidates.": "In calculating the election outcome, this prioritized vote ordering will be used to determine the final score for the candidates.", "Motions": "Motions", "Nay {{count}}": "Nay {{count}}", @@ -44,7 +43,6 @@ "Vote for current candidates": "Vote for current candidates", "Vote on proposal": "Vote on proposal", "You are voting with this collective's prime account. The vote will be the default outcome in case of any abstentions.": "You are voting with this collective's prime account. The vote will be the default outcome in case of any abstentions.", - "backing": "backing", "candidacy bond": "candidacy bond", "candidate account": "candidate account", "candidates": "candidates", @@ -58,7 +56,6 @@ "preimage hash": "preimage hash", "preimage length": "preimage length", "prime": "prime", - "prime voter": "prime voter", "proposal": "proposal", "propose from account": "propose from account", "runners up": "runners up", diff --git a/packages/apps/public/locales/en/app-democracy.json b/packages/apps/public/locales/en/app-democracy.json index 6a5c8ad71c..c24020ea8c 100644 --- a/packages/apps/public/locales/en/app-democracy.json +++ b/packages/apps/public/locales/en/app-democracy.json @@ -21,8 +21,6 @@ "Submit an Aye vote alongside the proposal as part of a batch": "Submit an Aye vote alongside the proposal as part of a batch", "Submit preimage": "Submit preimage", "Submit proposal": "Submit proposal", - "The amount this total can be reduced by to change the referendum outcome. This assumes changes to the convictions of the existing votes, with no additional turnout.": "The amount this total can be reduced by to change the referendum outcome. This assumes changes to the convictions of the existing votes, with no additional turnout.", - "The amount this total should be increased by to change the referendum outcome. This assumes additional turnout with new votes at 1x conviction.": "The amount this total should be increased by to change the referendum outcome. This assumes additional turnout with new votes at 1x conviction.", "The associated deposit for this proposal should be more then the minimum on-chain deposit required. It will be locked until the proposal passes.": "The associated deposit for this proposal should be more then the minimum on-chain deposit required. It will be locked until the proposal passes.", "The balance associated with the vote will be locked as per the conviction specified and will not be available for transfer during this period.": "The balance associated with the vote will be locked as per the conviction specified and will not be available for transfer during this period.", "The calculated storage costs based on the size and the per-bytes fee.": "The calculated storage costs based on the size and the per-bytes fee.", @@ -62,7 +60,6 @@ "referenda": "referenda", "remaining": "remaining", "send from account": "send from account", - "support": "support", "threshold": "threshold", "total": "total", "transferrable": "transferrable", diff --git a/packages/apps/public/locales/en/app-explorer.json b/packages/apps/public/locales/en/app-explorer.json index 9ed05dc6ac..be74201bb1 100644 --- a/packages/apps/public/locales/en/app-explorer.json +++ b/packages/apps/public/locales/en/app-explorer.json @@ -78,7 +78,6 @@ "total peers": "total peers", "total req": "total req", "total sub": "total sub", - "transfer": "transfer", "transfers": "transfers", "weight": "weight", "yes": "yes" diff --git a/packages/apps/public/locales/en/app-referenda.json b/packages/apps/public/locales/en/app-referenda.json index aa43694829..e856227559 100644 --- a/packages/apps/public/locales/en/app-referenda.json +++ b/packages/apps/public/locales/en/app-referenda.json @@ -101,7 +101,6 @@ "total": "total", "total issuance": "total issuance", "track origin": "track origin", - "track overview": "track overview", "transferrable": "transferrable", "vote": "vote", "votes": "votes", diff --git a/packages/apps/public/locales/en/app-settings.json b/packages/apps/public/locales/en/app-settings.json index a817473f63..13b17c0ca9 100644 --- a/packages/apps/public/locales/en/app-settings.json +++ b/packages/apps/public/locales/en/app-settings.json @@ -25,7 +25,6 @@ "Save": "Save", "Save & Reload": "Save & Reload", "Share": "Share", - "This is not a valid JSON object.": "This is not a valid JSON object.", "Translate": "Translate", "UI options": "UI options", "Unit": "Unit", diff --git a/packages/apps/public/locales/en/app-staking.json b/packages/apps/public/locales/en/app-staking.json index 4ff657a7ac..ae34f04f6f 100644 --- a/packages/apps/public/locales/en/app-staking.json +++ b/packages/apps/public/locales/en/app-staking.json @@ -4,9 +4,7 @@ "Accounts": "Accounts", "Active": "Active", "Active nominations ({{count}})": "Active nominations ({{count}})", - "Add pool": "Add pool", "All bags": "All bags", - "All pools": "All pools", "All rewards will go towards the selected output destination when a payout is made.": "All rewards will go towards the selected output destination when a payout is made.", "All stashes": "All stashes", "All the listed validators and all their nominators will receive their rewards.": "All the listed validators and all their nominators will receive their rewards.", @@ -33,8 +31,6 @@ "Change validator preferences": "Change validator preferences", "Chilled": "Chilled", "Controller account": "Controller account", - "Create": "Create", - "Create nomination pool": "Create nomination pool", "Distinct stash and controller accounts are recommended to ensure fund security. You will be allowed to make the transaction, but take care to not tie up all funds, only use a portion of the available funds during this period.": "Distinct stash and controller accounts are recommended to ensure fund security. You will be allowed to make the transaction, but take care to not tie up all funds, only use a portion of the available funds during this period.", "Era points": "Era points", "For fund security, your session key should not match your stash key.": "For fund security, your session key should not match your stash key.", @@ -46,11 +42,8 @@ "Inactive nominations ({{count}})": "Inactive nominations ({{count}})", "Inject Keys": "Inject Keys", "Inject session keys (advanced)": "Inject session keys (advanced)", - "Join": "Join", - "Join nomination pool": "Join nomination pool", "Keys from rotateKeys": "Keys from rotateKeys", "Max, {{eras}} eras": "Max, {{eras}} eras", - "Members ({{count}})": "Members ({{count}})", "Most profitable": "Most profitable", "Move up {{jumpCount}}": "Move up {{jumpCount}}", "My bags": "My bags", @@ -58,10 +51,7 @@ "No active validators found": "No active validators found", "No active validators to check": "No active validators to check", "No available bags": "No available bags", - "No available nomination pools": "No available nomination pools", "No funds staked yet. Bond funds to validate or nominate a validator": "No funds staked yet. Bond funds to validate or nominate a validator", - "No members": "No members", - "No nominees": "No nominees", "No pending payouts for your stashes": "No pending payouts for your stashes", "No pending payouts for your validators": "No pending payouts for your validators", "No waiting validators found": "No waiting validators found", @@ -76,7 +66,6 @@ "Nominators": "Nominators", "Nominators ({{count}})": "Nominators ({{count}})", "Nominators can be selected manually from the list of all currently available validators.": "Nominators can be selected manually from the list of all currently available validators.", - "Nominees ({{count}})": "Nominees ({{count}})", "Not participating in any pools. Join a pool first.": "Not participating in any pools. Join a pool first.", "Once bonded, it will need to be unlocked/withdrawn and will be locked for at least the bonding duration.": "Once bonded, it will need to be unlocked/withdrawn and will be locked for at least the bonding duration.", "Once transmitted the new selection will only take effect in 2 eras since the selection criteria for the next era was done at the end of the previous era. Until then, the nominations will show as inactive.": "Once transmitted the new selection will only take effect in 2 eras since the selection criteria for the next era was done at the end of the previous era. Until then, the nominations will show as inactive.", @@ -86,7 +75,6 @@ "Oversubscribed": "Oversubscribed", "Oversubscribed nominations ({{count}})": "Oversubscribed nominations ({{count}})", "Overview": "Overview", - "Own pools": "Own pools", "Own stashes": "Own stashes", "Own validators": "Own validators", "Para validator": "Para validator", @@ -113,7 +101,6 @@ "Retrieving active nominators": "Retrieving active nominators", "Retrieving all available bags, this will take some time": "Retrieving all available bags, this will take some time", "Retrieving info for the selected eras, this will take some time": "Retrieving info for the selected eras, this will take some time", - "Retrieving nomination pools": "Retrieving nomination pools", "Retrieving nominators": "Retrieving nominators", "Retrieving online status": "Retrieving online status", "Retrieving validator info": "Retrieving validator info", @@ -143,7 +130,6 @@ "The Threshold must be a positive number": "The Threshold must be a positive number", "The Threshold must lower than 11": "The Threshold must lower than 11", "The UI puts a limit of 40 payouts at a time, where each payout is a single validator for a single era.": "The UI puts a limit of 40 payouts at a time, where each payout is a single validator for a single era.", - "The account that will join the pool.": "The account that will join the pool.", "The account that will submit the rebag transaction.": "The account that will submit the rebag transaction.", "The accounts that will be rebagged as a result of this operation.": "The accounts that will be rebagged as a result of this operation.", "The amount placed at-stake should allow some free funds for future transactions.": "The amount placed at-stake should allow some free funds for future transactions.", @@ -159,12 +145,7 @@ "The controller does not have sufficient funds available to cover transaction fees. Ensure that a funded controller is used.": "The controller does not have sufficient funds available to cover transaction fees. Ensure that a funded controller is used.", "The funds will only be available for withdrawal after the unbonding period, however will not be part of the staked amount after the next validator election. You can follow the unlock countdown in the UI.": "The funds will only be available for withdrawal after the unbonding period, however will not be part of the staked amount after the next validator election. You can follow the unlock countdown in the UI.", "The hex output from author_rotateKeys, as executed on the validator node. The keys will show as pending until applied at the start of a new session.": "The hex output from author_rotateKeys, as executed on the validator node. The keys will show as pending until applied at the start of a new session.", - "The id that will be assigned to this nomination pool.": "The id that will be assigned to this nomination pool.", - "The initial value to assign to the pool. It is set to the maximum of the minimum bond and the minium nomination value.": "The initial value to assign to the pool. It is set to the maximum of the minimum bond and the minium nomination value.", - "The initial value to assign to the pool. It is set to the minimum value required to join a pool.": "The initial value to assign to the pool. It is set to the minimum value required to join a pool.", "The key type and crypto type to use for this key. Be aware that different keys have different crypto requirements. You should be familiar with the type requirements for the different keys.": "The key type and crypto type to use for this key. Be aware that different keys have different crypto requirements. You should be familiar with the type requirements for the different keys.", - "The metadata description to set for this pool": "The metadata description to set for this pool", - "The origin account will also be set as the pool admin, nominator and state toggler.": "The origin account will also be set as the pool admin, nominator and state toggler.", "The pool and pool member that is to be affected. The transaction will be sent from the associated pool member account.": "The pool and pool member that is to be affected. The transaction will be sent from the associated pool member account.", "The seed and derivation path will be submitted to the validator node. this is an advanced operation, only to be performed when you are sure of the security and connection risks.": "The seed and derivation path will be submitted to the validator node. this is an advanced operation, only to be performed when you are sure of the security and connection risks.", "The selected controller tied to this stash. Once set, this account will be able to control the actions performed by the stash account.": "The selected controller tied to this stash. Once set, this account will be able to control the actions performed by the stash account.", @@ -172,10 +153,6 @@ "The selected validators to nominate, either via the \"currently best algorithm\" or via a manual selection.": "The selected validators to nominate, either via the \"currently best algorithm\" or via a manual selection.", "The specified value is large and may not allow enough funds to pay future transaction fees.": "The specified value is large and may not allow enough funds to pay future transaction fees.", "The stash account that is used. This will allow the controller to perform all non-funds related operations on behalf of the account.": "The stash account that is used. This will allow the controller to perform all non-funds related operations on behalf of the account.", - "The stash and controller pair as linked. This operation will be performed via the controller.": "The stash and controller pair as linked. This operation will be performed via the controller.", - "The stash and controller pair, here the controller will be used to send the transaction.": "The stash and controller pair, here the controller will be used to send the transaction.", - "The stash and controller pair. This transaction, managing preferences, will be sent from the controller.": "The stash and controller pair. This transaction, managing preferences, will be sent from the controller.", - "The stash and controller pair. This transaction, setting the session keys, will be sent from the controller.": "The stash and controller pair. This transaction, setting the session keys, will be sent from the controller.", "The stash should be treated as a cold wallet.": "The stash should be treated as a cold wallet.", "The stash that is to be affected.": "The stash that is to be affected.", "The stash that is to be affected. The transaction will be sent from the associated controller account.": "The stash that is to be affected. The transaction will be sent from the associated controller account.", @@ -209,7 +186,6 @@ "active / nominators": "active / nominators", "additional free funds to bond": "additional free funds to bond", "additional funds to bond": "additional funds to bond", - "all bonded": "all bonded", "allows new nominations": "allows new nominations", "amount to unbond": "amount to unbond", "apply": "apply", @@ -226,12 +202,9 @@ "commission": "commission", "controller": "controller", "controller account": "controller account", - "create pool from": "create pool from", - "creator": "creator", "crypto type to use": "crypto type to use", "currently elected": "currently elected", "defer": "defer", - "description": "description", "ed25519, Edwards": "ed25519, Edwards", "elected stake": "elected stake", "era points": "era points", @@ -246,17 +219,13 @@ "historic results": "historic results", "ideal staked": "ideal staked", "inflation": "inflation", - "initial value": "initial value", "intentions": "intentions", - "join pool from": "join pool from", "key type to set": "key type to set", "last": "last", "last #": "last #", "last reward": "last reward", "lowest / avg staked": "lowest / avg staked", "max": "max", - "max. members": "max. members", - "max. members / pool": "max. members / pool", "member account": "member account", "min": "min", "min nominated": "min nominated", @@ -265,7 +234,6 @@ "next": "next", "nodes": "nodes", "nominated accounts": "nominated accounts", - "nominator": "nominator", "nominators": "nominators", "nominators to be removed": "nominators to be removed", "on-chain bonding duration": "on-chain bonding duration", @@ -296,20 +264,16 @@ "reward commission percentage": "reward commission percentage", "rewards": "rewards", "rewards & slashes": "rewards & slashes", - "root": "root", "selected validators": "selected validators", "sr15519, Schnorrkel": "sr15519, Schnorrkel", "staked": "staked", - "stash": "stash", "stash account": "stash account", "stashes": "stashes", - "state": "state", "suri (seed & derivation)": "suri (seed & derivation)", "the associated controller": "the associated controller", "the payment account": "the payment account", "the stash account to nominate with": "the stash account to nominate with", "to rebag": "to rebag", - "toggler": "toggler", "total": "total", "total bags": "total bags", "total nodes": "total nodes", diff --git a/packages/apps/public/locales/en/app-staking2.json b/packages/apps/public/locales/en/app-staking2.json index 3c1cfb7ca6..d432e8cfe4 100644 --- a/packages/apps/public/locales/en/app-staking2.json +++ b/packages/apps/public/locales/en/app-staking2.json @@ -30,7 +30,6 @@ "create pool from": "create pool from", "creator": "creator", "description": "description", - "favorites": "favorites", "initial value": "initial value", "join pool from": "join pool from", "max. members": "max. members", diff --git a/packages/apps/public/locales/en/apps-routing.json b/packages/apps/public/locales/en/apps-routing.json index 4d30a7604b..9e26dfeeb6 100644 --- a/packages/apps/public/locales/en/apps-routing.json +++ b/packages/apps/public/locales/en/apps-routing.json @@ -1,41 +1 @@ -{ - "nav.accounts": "Accounts", - "nav.addresses": "Address book", - "nav.alliance": "Alliance", - "nav.assets": "Assets", - "nav.bounties": "Bounties", - "nav.calendar": "Event calendar", - "nav.claims": "Claim Tokens", - "nav.collator": "Collators", - "nav.contracts": "Contracts", - "nav.council": "Council", - "nav.democracy": "Democracy", - "nav.explorer": "Explorer", - "nav.extrinsics": "Extrinsics", - "nav.fellowship": "Fellowship", - "nav.files": "Files (IPFS)", - "nav.gilt": "Gilt", - "nav.js": "JavaScript", - "nav.membership": "Membership", - "nav.nfts": "NFTs", - "nav.parachains": "Parachains", - "nav.poll": "Token poll", - "nav.preimages": "Preimages", - "nav.ranked": "Ranked collective", - "nav.referenda": "Referenda", - "nav.rpc": "RPC calls", - "nav.runtime": "Runtime calls", - "nav.scheduler": "Scheduler", - "nav.settings": "Settings", - "nav.signing": "Sign and verify", - "nav.society": "Society", - "nav.staking": "Staking", - "nav.storage": "Chain state", - "nav.sudo": "Sudo", - "nav.tech-comm": "Tech. comm.", - "nav.teleport": "Teleport", - "nav.transfer": "Transfer", - "nav.treasury": "Treasury", - "nav.utilities": "Utilities", - "nav.whitelist": "Whitelist" -} \ No newline at end of file +{} \ No newline at end of file diff --git a/packages/apps/public/locales/en/index.json b/packages/apps/public/locales/en/index.json index 346a9663cd..c97e1861c7 100644 --- a/packages/apps/public/locales/en/index.json +++ b/packages/apps/public/locales/en/index.json @@ -37,7 +37,6 @@ "app-utilities.json", "app-whitelist.json", "apps-config.json", - "apps-routing.json", "apps.json", "react-components.json", "react-params.json", diff --git a/packages/apps/public/locales/en/react-components.json b/packages/apps/public/locales/en/react-components.json index f27bb6ae31..958b6c3d56 100644 --- a/packages/apps/public/locales/en/react-components.json +++ b/packages/apps/public/locales/en/react-components.json @@ -1,32 +1,70 @@ { "0.1x voting balance, no lockup period": "0.1x voting balance, no lockup period", + "": "", + "Add identity judgment": "Add identity judgment", "Cancel": "Cancel", "Confirm account removal": "Confirm account removal", "Confirm address removal": "Confirm address removal", "Confirm code removal": "Confirm code removal", "Confirm contract removal": "Confirm contract removal", + "Copied": "Copied", + "Copy": "Copy", + "Council": "Council", + "Edit": "Edit", "Era is overdue for completion due to current network operating conditions": "Era is overdue for completion due to current network operating conditions", + "External": "External", + "Flags": "Flags", "Forget": "Forget", + "If the recipient account is new, the balance needs to be more than the existential deposit. Likewise if the sending account balance drops below the same value, the account will be removed from the state.": "If the recipient account is new, the balance needs to be more than the existential deposit. Likewise if the sending account balance drops below the same value, the account will be removed from the state.", + "Injected": "Injected", + "Judge": "Judge", + "Make Transfer": "Make Transfer", + "Multisig": "Multisig", "No execution details available for this proposal": "No execution details available for this proposal", + "No identity associated with account": "No identity associated with account", + "No judgements": "No judgements", + "Nominator": "Nominator", + "Normal transfer without keep-alive checks": "Normal transfer without keep-alive checks", "Positive number": "Positive number", "Prior locked voting": "Prior locked voting", + "Provide judgement": "Provide judgement", + "Proxied": "Proxied", + "Remove": "Remove", "Retrieving data": "Retrieving data", + "Save": "Save", + "Send": "Send", + "Send funds": "Send funds", + "Society": "Society", "Submit": "Submit", + "Sudo key": "Sudo key", "Tags": "Tags", + "Technical committee": "Technical committee", + "Test account": "Test account", + "The beneficiary will have access to the transferred fees when the transaction is included in a block.": "The beneficiary will have access to the transferred fees when the transaction is included in a block.", + "The recipient is associated with a known phishing site on {{url}}": "The recipient is associated with a known phishing site on {{url}}", + "The transaction, after application of the transfer fees, will drop the available balance below the existential deposit. As such the transfer will fail. The account needs more free funds to cover the transaction fees.": "The transaction, after application of the transfer fees, will drop the available balance below the existential deposit. As such the transfer will fail. The account needs more free funds to cover the transaction fees.", + "The transferred balance will be subtracted (along with fees) from the sender account.": "The transferred balance will be subtracted (along with fees) from the sender account.", + "There is an existing reference count on the sender account. As such the account cannot be reaped from the state.": "There is an existing reference count on the sender account. As such the account cannot be reaped from the state.", "This chain does not yet support atomic batch operations. This means that if the transaction gets executed and one of the operations do fail (due to invalid data or lack of available funds) some of the changes made may not be applied.": "This chain does not yet support atomic batch operations. This means that if the transaction gets executed and one of the operations do fail (due to invalid data or lack of available funds) some of the changes made may not be applied.", "This operation does not remove the history of the account from the chain, nor any associated funds from the account. The forget operation only limits your access to the account on this browser.": "This operation does not remove the history of the account from the chain, nor any associated funds from the account. The forget operation only limits your access to the account on this browser.", "This operation does not remove the history of the account from the chain, nor any associated funds from the account. The forget operation only limits your access to the address on this browser.": "This operation does not remove the history of the account from the chain, nor any associated funds from the account. The forget operation only limits your access to the address on this browser.", "This operation does not remove the history of the contract from the chain, nor any associated funds from its account. The forget operation only limits your access to the contract on this browser.": "This operation does not remove the history of the contract from the chain, nor any associated funds from its account. The forget operation only limits your access to the contract on this browser.", + "Transfer the full account balance, reap the sender": "Transfer the full account balance, reap the sender", + "Transfer with account keep-alive checks": "Transfer with account keep-alive checks", "Unbonding {{value}}": "Unbonding {{value}}", "Uncaught error. Something went wrong with the query and rendering of this component. Please supply all the details below when logging an issue, it may help in tracing the cause.": "Uncaught error. Something went wrong with the query and rendering of this component. Please supply all the details below when logging an issue, it may help in tracing the cause.", "Valid number": "Valid number", + "Validator": "Validator", "View this externally": "View this externally", + "With the keep-alive option set, the account is protected against removal due to low balances.": "With the keep-alive option set, the account is protected against removal due to low balances.", "Withdraw these unbonded funds": "Withdraw these unbonded funds", "You are about to remove this account from your list of available accounts. Once completed, should you need to access it again, you will have to re-create the account either via seed or via a backup file.": "You are about to remove this account from your list of available accounts. Once completed, should you need to access it again, you will have to re-create the account either via seed or via a backup file.", "You are about to remove this address from your address book. Once completed, should you need to access it again, you will have to re-add the address.": "You are about to remove this address from your address book. Once completed, should you need to access it again, you will have to re-add the address.", "You are about to remove this contract from your list of available contracts. Once completed, should you need to access it again, you will have to manually add the contract's address in the Instantiate tab.": "You are about to remove this contract from your list of available contracts. Once completed, should you need to access it again, you will have to manually add the contract's address in the Instantiate tab.", "address copied": "address copied", + "amount": "amount", "available to be unlocked": "available to be unlocked", + "balance": "balance", "beneficiary": "beneficiary", "blocks": "blocks", "bond": "bond", @@ -36,32 +74,52 @@ "commission": "commission", "contract event": "contract event", "democracy": "democracy", + "discord": "discord", + "email": "email", "everything": "everything", + "existential deposit": "existential deposit", "external links": "external links", "extrinsic hash": "extrinsic hash", "filter by name, address, or account index": "filter by name, address, or account index", + "identity": "identity", + "identity hash": "identity hash", + "index": "index", + "invalid/unknown registrar account": "invalid/unknown registrar account", + "judgement": "judgement", "lifetime": "lifetime", "link": "link", "lock expired": "lock expired", "locked": "locked", + "multisig": "multisig", "none": "none", "of {{locked}} vested": "of {{locked}} vested", "ongoing referendum": "ongoing referendum", "only this network": "only this network", + "parent": "parent", "per block": "per block", "preimage": "preimage", "proposed by": "proposed by", "redeemable": "redeemable", "referenda": "referenda", + "registrar account": "registrar account", + "registrar index": "registrar index", "reserved": "reserved", + "riot": "riot", + "send from account": "send from account", + "send to address": "send to address", "session keys": "session keys", "session next": "session next", + "signatories": "signatories", "signature {{type}}": "signature {{type}}", "strong": "strong", + "subs": "subs", + "threshold": "threshold", "tip": "tip", "total": "total", "transactions": "transactions", "transferrable": "transferrable", + "transferrable minus fees": "transferrable minus fees", + "twitter": "twitter", "type": "type", "unbonding": "unbonding", "unstake threshold": "unstake threshold", @@ -77,6 +135,7 @@ "vote with account": "vote with account", "voting balance": "voting balance", "weak": "weak", + "website": "website", "{{blocks}} blocks": "{{blocks}} blocks", "{{eras}} eras remaining": "{{eras}} eras remaining", "{{name}} ({{size}} bytes)": "{{name}} ({{size}} bytes)", diff --git a/packages/apps/public/locales/en/translation.json b/packages/apps/public/locales/en/translation.json index 15f890360b..d50969c724 100644 --- a/packages/apps/public/locales/en/translation.json +++ b/packages/apps/public/locales/en/translation.json @@ -1,387 +1,28 @@ { - "@YourTwitterName": "", - "@yourname:matrix.org": "", - "A controller account should not be set to manage multiple stashes. The selected controller is already controlling {{stashId}}": "", - "A controller account should not map to another stash. This selected controller is a stash, controlled by {{bondedId}}": "", - "Account type {{index}}": "", - "Accounts": "", - "Active": "", - "Add an existing code hash": "", - "Add an existing contract": "", - "Add proxy": "", - "Address index {{index}}": "", - "All bags": "", - "All pools": "", - "All stashes": "", - "All validators": "", - "All voters may alter their votes any number of times prior to the close of the poll.": "", - "Allow local in-browser account storage": "", - "Any combination of the four options may be approved of by the voter. There is no need to select only one option!": "", - "Approving of all or none of the options is equivalent and will not affect the outcome of the poll.": "", "Authorize transaction": "", - "Aye": "", - "Aye: {{count}}": "", - "Backup": "", - "Berlin": "", - "Blocks nominations": "", - "Bond": "", - "Bounty approval under voting": "", - "Bounty rejection under voting": "", - "Cancel": "", - "Cancel all": "", - "Cancel selected": "", - "Candidate": "", - "Change democracy delegation": "", "Change this account's password": "", - "Chilled": "", - "Claim": "", - "Clear expired democracy locks": "", - "Clear expired referenda locks": "", - "Close": "", - "Confirmation period": "", - "Contracts": "", - "Controller account": "", - "Create a backup file for this account": "", - "Crust Network": "", - "Curator proposal under voting": "", - "Curator slash under voting": "", "Curator's deposit": "", "Curator's deposit will be slashed and curator will be unassigned. Bounty will return to the Funded state.": "", "Curator's fee": "", - "DCF": "", - "Dark theme": "", - "Defender": "", - "Delegate": "", - "Delegate democracy votes": "", - "Deploy": "", - "Deploy a contract": "", - "Derive": "", - "Derive account via derivation path": "", - "Developer": "", - "Distinct stash and controller accounts are recommended to ensure fund security. You will be allowed to make the transaction, but take care to not tie up all funds, only use a portion of the available funds during this period.": "", - "Do not allow local in-browser account storage": "", - "Enactment period": "", - "Era points": "", - "Evaluated {{count}} keys in {{elapsed}}s ({{avg}} keys/s)": "", - "Execute": "", - "Export": "", - "Extensions": "", - "File": "", - "Files": "", - "Folder": "", - "For approvals outstanding approvers will be shown, for hashes that should be cancelled the first approver is required.": "", - "Forget this account": "", - "Frozen": "", - "Full Legal Name": "", - "Governance": "", - "Identity": "", "If the motion is approved, Curator's deposit will be slashed and Curator will be unassigned. Bounty will return to the Funded state.": "", - "If the motion is approved, the current Curator will be unassigned and the Bounty will return to the Funded state.": "", - "If you have not claimed rewards straight after the end of the era, the validator is in the active set and you are seeing no rewards, this would mean that the reward payout transaction was made by another account on your behalf. Always check your favorite explorer to see any historic payouts made to your accounts.": "", - "Import": "", - "Import Success": "", - "Import files": "", - "Importing": "", - "Inactive": "", - "Initiate recovery for another": "", - "Ledger app type (originated from)": "", - "Light theme": "", - "Locked funds (e.g. for staking) are counted.": "", - "Make recoverable": "", - "Manage proxies": "", - "Multisig": "", - "Multisig approvals": "", - "My On-Chain Name": "", - "My bags": "", - "Nay": "", - "Nay: {{count}}": "", - "Network": "", - "Never execute JS snippets from untrusted sources.": "", - "Next session": "", - "No change": "", - "No change from the original 2017 sale definitions; will mean a total of 10 million DOT from genesis.": "", - "No discretionary lock-voting is in place; all DOT used to vote counts the same.": "", - "No sub identities set.": "", - "No, block all nominations": "", - "Nominating": "", - "Nominators": "", - "None": "", - "Note: The file list is cached locally, switching browsers or devices will not keep displaying the original browser information.": "", - "Online message": "", "Override any applicable values for the specific signed output. These will be used to construct and display the signed transaction.": "", - "Oversubscribed": "", - "Own pools": "", - "Own stashes": "", - "Own validators": "", - "Para validator": "", - "Payouts of rewards for a validator can be initiated by any account. This means that as soon as a validator or nominator requests a payout for an era, all the nominators for that validator will be rewarded. Each user does not need to claim individually and the suggestion is that validators should claim rewards for everybody as soon as an era ends.": "", - "Please do not upload more than 2000 files": "", - "Please read these terms and conditions carefully. By submitting this statement, you are deemed to have accepted these Terms and Conditions. If you do not agree to these terms, please refrain from accessing or proceeding. You can also find them at:": "", - "Please select non-empty folder": "", - "Preparing target display": "", "Prior locked voting": "", - "Produced blocks": "", - "Proposer": "", - "Recovery": "", - "Retrieving data": "", - "Retrieving nominators": "", - "Retrieving validators": "", - "Save": "", - "Seattle": "", - "Set on-chain identity": "", - "Set on-chain sub-identities": "", - "Settings": "", - "Show address on hardware device": "", - "Singapore": "", - "Slash curator": "", - "Slash curator (Council)": "", - "Slashed": "", - "Specified payment account": "", - "Split of 1000x": "", - "Split of 1000x from the original sale; will mean a total of 10 billion DOT from genesis. Apparent DOT price would be 1000x lower and apparent account balances 1000x higher.": "", - "Split of 100x": "", - "Split of 100x from the original sale; will mean a total of 1 billion DOT from genesis. Apparent DOT price would be 100x lower and apparent account balances 100x higher.": "", - "Split of 10x": "", - "Split of 10x from the original sale; will mean a total of 100 million DOT from genesis. Apparent DOT price would be 10x lower and apparent account balances 10x higher.": "", - "Stash account (do not increase the amount at stake)": "", - "Stash account (increase the amount at stake)": "", "Submit (no signature)": "", - "Swap to a non-executing approval type, with subsequent calls providing the actual call data.": "", - "The All bags list is composed of bags that each describe a range of active bonded funds of the nominators. In each bag is a list of nodes that correspond to a nominator and their staked funds.": "", - "The account that will create the transaction.": "", - "The account type that you wish to create. This is the top-level derivation.": "", "The actual fully constructed signed output. This can be used for submission via other channels.": "", - "The address index on the account that you wish to add. This is the second-level derivation.": "", - "The amount to allocate and the conviction that will be applied to all votes made on a referendum.": "", - "The amount will be reserved for the duration of your vote": "", - "The bond will be reserved for the duration of your alliance membership.": "", - "The bond will be reserved for the duration of your candidacy and membership.": "", - "The bonded amount is less than the current active minimum nominated amount of {{minNomination}} and depending on the network state, may not be selected to participate": "", - "The bonded amount is less than the minimum bond amount of {{existentialDeposit}}": "", - "The bonded amount is less than the minimum threshold of {{minBond}} for nominators": "", - "The bonded amount is less than the minimum threshold of {{minBond}} for validators": "", - "The call data for this transaction matching the hash. Once sent, the multisig will be executed against this.": "", "The call hash as calculated for this transaction": "", - "The call hash from the list of available and unapproved calls.": "", - "The codeHash is not a valid hex hash": "", - "The controller does not have sufficient funds available to cover transaction fees. Ensure that a funded controller is used.": "", - "The council member that will create the motion, submission equates to an \"aye\" vote.": "", "The full call data that can be supplied to a final call to multi approvals": "", - "The maximum amount you can delegate is the amount of funds available on the delegating account.": "", - "The operation type to apply. For approvals both non-final and final approvals are supported.": "", "The proxy is one of the allowed proxies on the account, as set and filtered by the transaction type.": "", "The sending account that will be used to send this transaction. Any applicable fees will be paid by this account.": "", "The signatory is one of the allowed accounts on the multisig, making a recorded approval for the transaction.": "", - "The specified value is large and may not allow enough funds to pay future transaction fees.": "", - "This action will Slash the Curator.": "", - "This action will create a Council motion to slash the Curator.": "", - "This action will create a Council motion to unassign the Curator.": "", "This could either be an approval for the hash or with full call details. The call as last approval triggers execution.": "", - "This is a developer tool that allows you to execute selected snippets in a limited context.": "", - "This is not a valid JSON object.": "", - "This vote does not affect any economics of the Polkadot platform. Staking rewards, inflation, effective market capitalisation and the underlying balances of every account remain completely unchanged. It is \"merely\" about what units we use to denominate the balances into \"DOT\" for the purpose of display.": "", - "Unable to find on-chain WASM code for the supplied codeHash": "", - "Unassign curator": "", - "Unassign curator under voting": "", - "Undelegate": "", - "Unknown": "", - "Unless you are a developer with insight into what the specific script does to your environment (based on reading the code being executed) generally the advice would be to not use this environment.": "", "Unlock the sending account to allow signing of this transaction.": "", - "Unlock vested amount": "", - "Upload": "", - "Upload & deploy code": "", - "Upload & deploy code {{info}}": "", - "Validators": "", - "View status in Crust": "", - "Vote": "", - "Voting": "", - "Voting costs nothing other than the transaction fee and can be done from all accounts with a non-zero spendable balance.": "", - "Voting is made on a per-account basis; a single account must all vote the same way and cannot split its vote.": "", - "Waiting": "", - "Warning: we did not find any attest statement for {{chain}}": "", - "With the keep-alive option set, the account is protected against removal due to low balances.": "", - "Within the context of a single bag, nodes are not sorted by their stake, but instead placed in insertion order. In other words, the most recently inserted node will be the last node in the bag, regardless of stake. Events like staking rewards or slashes do not automatically put you in a different bag. The bags-list pallet comes with an important permissionless extrinsic: rebag. This allows anyone to specify another account that is in the wrong bag, and place it in the correct one.": "", - "Yes, allow nominations": "", - "You need to sign an attestation for the following account:": "", - "You need to sign an attestation for the following accounts:": "", - "YourDiscordHandle": "", - "account": "", - "account type": "", - "accounts": "", - "action": "", - "activate": "", - "address copied": "", - "address index": "", - "admin": "", - "apply": "", - "assets": "", "available to be unlocked": "", - "aye": "", - "backed": "", - "backing": "", - "bags": "", - "balance": "", - "best #": "", - "best hash": "", - "bid kind": "", - "bidder": "", - "bids": "", "blocks": "", - "bonded": "", - "bounties": "", - "call data for final approval": "", - "calls": "", - "candidates": "", - "chain": "", - "chain specifications": "", - "claimable": "", - "clipboard": "", - "code hash": "", - "code hashes": "", - "collections": "", - "comm.": "", - "commission": "", - "completed": "", - "connected peers": "", - "contacts": "", - "contracts": "", - "controller": "", - "count": "", - "creator": "", - "crowdloan": "", - "curator": "", - "defender": "", - "denomination vote": "", - "deploy": "", - "deployment account": "", - "deployment constructor": "", - "design samples": "", - "development": "", - "dispatch queue": "", - "elapsed": "", - "enact": "", - "ending": "", - "era {{era}}/unapplied": "", - "eras": "", - "events": "", - "extension": "", - "external": "", "external links": "", - "extrinsics": "", - "file cid": "", - "file content error": "", - "file error": "", - "file size": "", - "files": "", - "finder": "", - "first": "", - "freezer": "", - "frozen": "", - "hardware": "", - "hash": "", - "head": "", - "https://example.com": "", - "id": "", - "in/out": "", - "included": "", - "initial state": "", - "intentions": "", - "issuer": "", - "items": "", - "justifications": "", - "last": "", - "last #": "", - "leases": "", - "length": "", - "lifecycle": "", - "lock expired": "", - "locked": "", - "logs": "", - "matches": "", - "max": "", - "members": "", - "min": "", - "motions": "", - "multisig": "", "multisig signatory": "", - "nay": "", - "next action": "", - "no": "", - "no name": "", - "nodes": "", - "nominator": "", - "nominators": "", "of {{locked}} vested": "", - "ongoing": "", - "ongoing referendum": "", - "other": "", - "other stake": "", - "overall/validator": "", - "own": "", - "owner": "", - "parachains": "", - "parathreads": "", - "parent": "", - "participants": "", - "payout": "", - "payout/stash": "", - "payout/validator": "", "per block": "", - "period": "", - "points": "", - "pools": "", - "preimages": "", - "proposals": "", - "proposer": "", - "proxied": "", "proxy account": "", - "queues": "", - "raised": "", - "reason": "", - "recent blocks": "", - "recently": "", - "referenda": "", - "remaining": "", - "reporters": "", - "rewards": "", - "root": "", - "runners up": "", - "scheduled": "", - "secret": "", "sending from my account": "", - "somebody@example.com": "", - "stash": "", - "stashes": "", - "state": "", - "status": "", - "strikes": "", - "sufficient": "", - "supply": "", - "the payment account": "", - "threshold": "", - "timeout": "", - "tip": "", - "tips": "", - "toggler": "", - "total": "", - "turnout": "", - "unapplied": "", - "until block": "", - "validator {{index}}": "", - "validators": "", - "value": "", - "via qr": "", - "vote using my account": "", - "voted on": "", - "votes": "", - "voting end": "", - "weight": "", - "yes": "", - "yesterday": "", - "{{balance}} voted": "", - "{{count}} key/value pairs encoded for submission": "", - "{{days}} days": "", - "{{percentage}}% turnout": "", - "{{when}} (est.)": "", - "⚡️ Thunder Gateway": "" + "until block": "" } \ No newline at end of file diff --git a/packages/apps/src/Apps.tsx b/packages/apps/src/Apps.tsx index 5f850b36d5..020de80be1 100644 --- a/packages/apps/src/Apps.tsx +++ b/packages/apps/src/Apps.tsx @@ -5,8 +5,7 @@ import type { BareProps as Props } from '@polkadot/react-components/types'; import React, { useMemo } from 'react'; -import AccountSidebar from '@polkadot/app-accounts/Sidebar'; -import { styled } from '@polkadot/react-components/styled'; +import { AccountSidebar, styled } from '@polkadot/react-components'; import GlobalStyle from '@polkadot/react-components/styles'; import { useApi, useTheme } from '@polkadot/react-hooks'; import Signer from '@polkadot/react-signer'; diff --git a/packages/apps/src/Content/index.tsx b/packages/apps/src/Content/index.tsx index 9edc4586d6..98d6c5a18e 100644 --- a/packages/apps/src/Content/index.tsx +++ b/packages/apps/src/Content/index.tsx @@ -7,8 +7,9 @@ import React, { Suspense, useMemo } from 'react'; import { useLocation } from 'react-router-dom'; import createRoutes from '@polkadot/apps-routing'; -import { ErrorBoundary, Spinner, styled, TabsCtx } from '@polkadot/react-components'; +import { ErrorBoundary, Spinner, styled } from '@polkadot/react-components'; import { useApi, useQueue } from '@polkadot/react-hooks'; +import { TabsCtx } from '@polkadot/react-hooks/ctx/Tabs'; import { findMissingApis } from '../endpoint.js'; import { useTranslation } from '../translate.js'; diff --git a/packages/apps/src/Root.tsx b/packages/apps/src/Root.tsx index 2ed836bf74..b33943623d 100644 --- a/packages/apps/src/Root.tsx +++ b/packages/apps/src/Root.tsx @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeDef } from '@polkadot/react-hooks/ctx/types'; +import type { ThemeDef } from '@polkadot/react-components/types'; import type { KeyringStore } from '@polkadot/ui-keyring/types'; import React, { Suspense, useEffect, useState } from 'react'; @@ -9,11 +9,11 @@ import { HashRouter } from 'react-router-dom'; import { ThemeProvider } from 'styled-components'; import { ApiCtxRoot } from '@polkadot/react-api'; +import { darkTheme, lightTheme } from '@polkadot/react-components'; import { ApiStatsCtxRoot, BlockAuthorsCtxRoot, BlockEventsCtxRoot, KeyringCtxRoot, QueueCtxRoot, WindowSizeCtxRoot } from '@polkadot/react-hooks'; import { settings } from '@polkadot/ui-settings'; import Apps from './Apps.js'; -import { darkTheme, lightTheme } from './themes.js'; interface Props { isElectron: boolean; diff --git a/packages/page-accounts/src/Accounts/Account.tsx b/packages/page-accounts/src/Accounts/Account.tsx index 315892a496..a97fe4b945 100644 --- a/packages/page-accounts/src/Accounts/Account.tsx +++ b/packages/page-accounts/src/Accounts/Account.tsx @@ -14,7 +14,7 @@ import type { AccountBalance, Delegation } from '../types.js'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; import useAccountLocks from '@polkadot/app-referenda/useAccountLocks'; -import { AddressInfo, AddressSmall, Badge, Button, ChainLock, Columar, CryptoType, Forget, LinkExternal, Menu, Popup, styled, Table, Tags } from '@polkadot/react-components'; +import { AddressInfo, AddressSmall, Badge, Button, ChainLock, Columar, CryptoType, Forget, LinkExternal, Menu, Popup, styled, Table, Tags, TransferModal } from '@polkadot/react-components'; import { useAccountInfo, useApi, useBalancesAll, useBestNumber, useCall, useLedger, useQueue, useStakingInfo, useToggle } from '@polkadot/react-hooks'; import { keyring } from '@polkadot/ui-keyring'; import { BN, BN_ZERO, formatBalance, formatNumber, isFunction } from '@polkadot/util'; @@ -29,7 +29,6 @@ import MultisigApprove from '../modals/MultisigApprove.js'; import ProxyOverview from '../modals/ProxyOverview.js'; import RecoverAccount from '../modals/RecoverAccount.js'; import RecoverSetup from '../modals/RecoverSetup.js'; -import Transfer from '../modals/Transfer.js'; import UndelegateModal from '../modals/Undelegate.js'; import { useTranslation } from '../translate.js'; import { createMenuGroup } from '../util.js'; @@ -530,7 +529,7 @@ function Account ({ account: { address, meta }, className = '', delegation, filt /> )} {isTransferOpen && ( - )} {isTransferOpen && ( - ): void { - const codeHash = (isString(_codeHash) ? api.registry.createType('Hash', _codeHash) : _codeHash).toHex(); + const codeHash = (isString(_codeHash) ? statics.api.registry.createType('Hash', _codeHash) : _codeHash).toHex(); const existing = this.getCode(codeHash); const json = { ...(existing ? existing.json : {}), ...partial, codeHash, - genesisHash: api.genesisHash.toHex(), + genesisHash: statics.api.genesisHash.toHex(), whenCreated: existing?.json.whenCreated || Date.now() }; const key = `${KEY_CODE}${json.codeHash}`; @@ -50,7 +50,7 @@ class Store extends EventEmitter { public loadAll (onLoaded?: () => void): void { try { - const genesisHash = api.genesisHash.toHex(); + const genesisHash = statics.api.genesisHash.toHex(); store.each((json: CodeJson, key: string): void => { if (json && json.genesisHash === genesisHash && key.startsWith(KEY_CODE)) { @@ -68,7 +68,7 @@ class Store extends EventEmitter { try { this.#allCode[json.codeHash] = { contractAbi: json.abi - ? new Abi(json.abi, api.registry.getChainProperties()) + ? new Abi(json.abi, statics.api.registry.getChainProperties()) : undefined, json }; diff --git a/packages/page-contracts/src/useAbi.ts b/packages/page-contracts/src/useAbi.ts index 82707d9836..f76382b850 100644 --- a/packages/page-contracts/src/useAbi.ts +++ b/packages/page-contracts/src/useAbi.ts @@ -4,7 +4,7 @@ import { useCallback, useEffect, useState } from 'react'; import { Abi } from '@polkadot/api-contract'; -import { api } from '@polkadot/react-api'; +import { statics } from '@polkadot/react-api'; import { createNamedHook } from '@polkadot/react-hooks'; import { u8aToString } from '@polkadot/util'; @@ -67,7 +67,7 @@ function useAbiImpl (initialValue: [string | null | undefined, Abi | null | unde setAbi({ abi: json, abiName: name.replace('.contract', '').replace('.json', '').replace('_', ' '), - contractAbi: new Abi(json, api.registry.getChainProperties()), + contractAbi: new Abi(json, statics.api.registry.getChainProperties()), errorText: null, isAbiError: false, isAbiSupplied: true, diff --git a/packages/page-explorer/src/index.tsx b/packages/page-explorer/src/index.tsx index 90e4143e75..7af3a8c91f 100644 --- a/packages/page-explorer/src/index.tsx +++ b/packages/page-explorer/src/index.tsx @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { TabItem } from '@polkadot/react-components/Tabs/types'; +import type { TabItem } from '@polkadot/react-components/types'; import type { KeyedEvent } from '@polkadot/react-hooks/ctx/types'; import React, { useMemo, useRef } from 'react'; diff --git a/packages/page-extrinsics/src/index.tsx b/packages/page-extrinsics/src/index.tsx index 23b965ffb2..41b9937840 100644 --- a/packages/page-extrinsics/src/index.tsx +++ b/packages/page-extrinsics/src/index.tsx @@ -2,8 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { TabItem } from '@polkadot/react-components/Tabs/types'; -import type { AppProps as Props } from '@polkadot/react-components/types'; +import type { AppProps as Props, TabItem } from '@polkadot/react-components/types'; import type { DecodedExtrinsic } from './types.js'; import React, { useRef, useState } from 'react'; diff --git a/packages/react-api/src/Api.tsx b/packages/react-api/src/Api.tsx index a6e351d85e..3e2d6f94f9 100644 --- a/packages/react-api/src/Api.tsx +++ b/packages/react-api/src/Api.tsx @@ -15,8 +15,9 @@ import { ApiPromise, ScProvider, WsProvider } from '@polkadot/api'; import { deriveMapCache, setDeriveCache } from '@polkadot/api-derive/util'; import { ethereumChains, typesBundle } from '@polkadot/apps-config'; import { web3Accounts, web3Enable } from '@polkadot/extension-dapp'; -import { TokenUnit } from '@polkadot/react-components/InputNumber'; +import { TokenUnit } from '@polkadot/react-components/InputConsts/units'; import { useApiUrl, useEndpoint, useQueue } from '@polkadot/react-hooks'; +import { ApiCtx } from '@polkadot/react-hooks/ctx/Api'; import { ApiSigner } from '@polkadot/react-signer'; import { keyring } from '@polkadot/ui-keyring'; import { settings } from '@polkadot/ui-settings'; @@ -24,7 +25,7 @@ import { formatBalance, isNumber, isTestChain, objectSpread, stringify } from '@ import { defaults as addressDefaults } from '@polkadot/util-crypto/address/defaults'; import { lightSpecs, relaySpecs } from './light/index.js'; -import { registry } from './typeRegistry.js'; +import { statics } from './statics.js'; import { decodeUrlTypes } from './urlTypes.js'; interface Props { @@ -52,19 +53,13 @@ interface ChainData { systemVersion: string; } -export const DEFAULT_DECIMALS = registry.createType('u32', 12); -export const DEFAULT_SS58 = registry.createType('u32', addressDefaults.prefix); +export const DEFAULT_DECIMALS = statics.registry.createType('u32', 12); +export const DEFAULT_SS58 = statics.registry.createType('u32', addressDefaults.prefix); export const DEFAULT_AUX = ['Aux1', 'Aux2', 'Aux3', 'Aux4', 'Aux5', 'Aux6', 'Aux7', 'Aux8', 'Aux9']; -export const ApiCtx = React.createContext({} as unknown as ApiProps); - const DISALLOW_EXTENSIONS: string[] = []; const EMPTY_STATE = { hasInjectedAccounts: false, isApiReady: false } as unknown as ApiState; -let api: ApiPromise; - -export { api, registry }; - function isKeyringLoaded () { try { return !!keyring.keyring; @@ -115,7 +110,7 @@ async function retrieve (api: ApiPromise, injectedPromise: Promise !DISALLOW_EXTENSIONS.includes(source) ), - properties: registry.createType('ChainProperties', { + properties: statics.registry.createType('ChainProperties', { ss58Format: api.registry.chainSS58, tokenDecimals: api.registry.chainDecimals, tokenSymbol: api.registry.chainTokens @@ -138,7 +133,7 @@ async function retrieve (api: ApiPromise, injectedPromise: Promise, store: KeyringStore | undefined, types: Record>): Promise { - registry.register(types); + statics.registry.register(types); const { injectedAccounts, properties, systemChain, systemChainType, systemName, systemVersion } = await retrieve(api, injectedPromise); const chainSS58 = properties.ss58Format.unwrapOr(DEFAULT_SS58).toNumber(); @@ -153,7 +148,13 @@ async function loadOnReady (api: ApiPromise, endpoint: LinkOption | null, inject console.log(`chain: ${systemChain} (${systemChainType.toString()}), ${stringify(properties)}`); // explicitly override the ss58Format as specified - registry.setChainProperties(registry.createType('ChainProperties', { ss58Format, tokenDecimals, tokenSymbol })); + statics.registry.setChainProperties( + statics.registry.createType('ChainProperties', { + ss58Format, + tokenDecimals, + tokenSymbol + }) + ); // first setup the UI helpers formatBalance.setDefaults({ @@ -235,9 +236,9 @@ async function createApi (apiUrl: string, signer: ApiSigner, onError: (error: un ? await getLightProvider(apiUrl.replace('light://', '')) : new WsProvider(apiUrl); - api = new ApiPromise({ + statics.api = new ApiPromise({ provider, - registry, + registry: statics.registry, signer, types, typesBundle @@ -274,7 +275,7 @@ export function ApiCtxRoot ({ apiUrl, children, isElectron, store }: Props): Rea [apiUrl, isElectron] ); const value = useMemo( - () => objectSpread({}, state, { api, apiEndpoint, apiError, apiRelay, apiUrl, createLink, extensions, isApiConnected, isApiInitialized, isElectron, isWaitingInjected: !extensions }), + () => objectSpread({}, state, { api: statics.api, apiEndpoint, apiError, apiRelay, apiUrl, createLink, extensions, isApiConnected, isApiInitialized, isElectron, isWaitingInjected: !extensions }), [apiError, createLink, extensions, isApiConnected, isApiInitialized, isElectron, state, apiEndpoint, apiRelay, apiUrl] ); @@ -286,19 +287,19 @@ export function ApiCtxRoot ({ apiUrl, children, isElectron, store }: Props): Rea setApiError((error as Error).message); }; - createApi(apiUrl, new ApiSigner(registry, queuePayload, queueSetTxStatus), onError) + createApi(apiUrl, new ApiSigner(statics.registry, queuePayload, queueSetTxStatus), onError) .then((types): void => { - api.on('connected', () => setIsApiConnected(true)); - api.on('disconnected', () => setIsApiConnected(false)); - api.on('error', onError); - api.on('ready', (): void => { + statics.api.on('connected', () => setIsApiConnected(true)); + statics.api.on('disconnected', () => setIsApiConnected(false)); + statics.api.on('error', onError); + statics.api.on('ready', (): void => { const injectedPromise = web3Enable('polkadot-js/apps'); injectedPromise .then(setExtensions) .catch(console.error); - loadOnReady(api, apiEndpoint, injectedPromise, store, types) + loadOnReady(statics.api, apiEndpoint, injectedPromise, store, types) .then(setState) .catch(onError); }); diff --git a/packages/react-api/src/hoc/api.tsx b/packages/react-api/src/hoc/api.tsx index df7873f6e7..3f2cc1a1a0 100644 --- a/packages/react-api/src/hoc/api.tsx +++ b/packages/react-api/src/hoc/api.tsx @@ -6,10 +6,9 @@ import type { DefaultProps } from './types.js'; import React from 'react'; +import { ApiCtx } from '@polkadot/react-hooks/ctx/Api'; import { assert } from '@polkadot/util'; -import { ApiCtx } from '../Api.js'; - export default function withApi

(Inner: React.ComponentType

, defaultProps: DefaultProps = {}): React.ComponentType { class WithApi extends React.PureComponent> { private component: any = React.createRef(); diff --git a/packages/react-api/src/index.ts b/packages/react-api/src/index.ts index d06ae8dea3..26f7780943 100644 --- a/packages/react-api/src/index.ts +++ b/packages/react-api/src/index.ts @@ -1,5 +1,6 @@ // Copyright 2017-2023 @polkadot/react-api authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { api, ApiCtx, ApiCtxRoot, DEFAULT_DECIMALS, DEFAULT_SS58, registry } from './Api.js'; +export { ApiCtxRoot, DEFAULT_DECIMALS, DEFAULT_SS58 } from './Api.js'; export { withApi, withCallDiv, withCalls, withMulti, withObservable } from './hoc/index.js'; +export { statics } from './statics.js'; diff --git a/packages/react-api/src/statics.ts b/packages/react-api/src/statics.ts new file mode 100644 index 0000000000..5bc041eb45 --- /dev/null +++ b/packages/react-api/src/statics.ts @@ -0,0 +1,17 @@ +// Copyright 2017-2023 @polkadot/react-api authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { ApiPromise } from '@polkadot/api'; + +import { TypeRegistry } from '@polkadot/types/create'; + +interface Statics { + api: ApiPromise; + registry: TypeRegistry; +} + +// NOTE We are assuming that the Api class _will_ set it correctly +export const statics = { + api: undefined, + registry: new TypeRegistry() +} as unknown as Statics; diff --git a/packages/react-api/src/typeRegistry.ts b/packages/react-api/src/typeRegistry.ts deleted file mode 100644 index b34d4a11f6..0000000000 --- a/packages/react-api/src/typeRegistry.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright 2017-2023 @polkadot/react-api authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import { TypeRegistry } from '@polkadot/types/create'; - -export const registry = new TypeRegistry(); diff --git a/packages/react-components/src/AccountName.tsx b/packages/react-components/src/AccountName.tsx index f20ecacc97..d454e54bb6 100644 --- a/packages/react-components/src/AccountName.tsx +++ b/packages/react-components/src/AccountName.tsx @@ -7,9 +7,9 @@ import type { AccountId, AccountIndex, Address } from '@polkadot/types/interface import React, { useCallback, useContext, useEffect, useState } from 'react'; -import { AccountSidebarCtx } from '@polkadot/app-accounts/Sidebar'; -import { registry } from '@polkadot/react-api'; +import { statics } from '@polkadot/react-api'; import { useDeriveAccountInfo, useSystemApi } from '@polkadot/react-hooks'; +import { AccountSidebarCtx } from '@polkadot/react-hooks/ctx/AccountSidebar'; import { formatNumber, isCodec, isFunction, stringToU8a, u8aEmpty, u8aEq, u8aToBn } from '@polkadot/util'; import { getAddressName } from './util/index.js'; @@ -32,7 +32,7 @@ interface Props { type AddrMatcher = (addr: unknown) => string | null; function createAllMatcher (prefix: string, name: string): AddrMatcher { - const test = registry.createType('AccountId', stringToU8a(prefix.padEnd(32, '\0'))); + const test = statics.registry.createType('AccountId', stringToU8a(prefix.padEnd(32, '\0'))); return (addr: unknown) => test.eq(addr) @@ -49,7 +49,7 @@ function createNumMatcher (prefix: string, name: string, add?: string): AddrMatc return (addr: unknown): string | null => { const u8a = isCodec(addr) ? addr.toU8a() - : registry.createType('AccountId', addr as string).toU8a(); + : statics.registry.createType('AccountId', addr as string).toU8a(); return (u8a.length >= minLength) && u8aEq(test, u8a.subarray(0, test.length)) && u8aEmpty(u8a.subarray(minLength)) ? `${name} ${formatNumber(u8aToBn(u8a.subarray(test.length, minLength)))}${add ? ` (${add})` : ''}` diff --git a/packages/page-accounts/src/Sidebar/AccountMenuButtons.tsx b/packages/react-components/src/AccountSidebar/AccountMenuButtons.tsx similarity index 94% rename from packages/page-accounts/src/Sidebar/AccountMenuButtons.tsx rename to packages/react-components/src/AccountSidebar/AccountMenuButtons.tsx index 8d45455987..0f637e54e3 100644 --- a/packages/page-accounts/src/Sidebar/AccountMenuButtons.tsx +++ b/packages/react-components/src/AccountSidebar/AccountMenuButtons.tsx @@ -1,15 +1,16 @@ -// Copyright 2017-2023 @polkadot/app-accounts authors & contributors +// Copyright 2017-2023 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 import type { AddressFlags } from '@polkadot/react-hooks/types'; import React, { useCallback } from 'react'; -import { Button, styled } from '@polkadot/react-components'; import { useApi, useToggle } from '@polkadot/react-hooks'; import { isFunction } from '@polkadot/util'; -import Transfer from '../modals/Transfer.js'; +import Button from '../Button/index.js'; +import { TransferModal } from '../modals/index.js'; +import { styled } from '../styled.js'; import { useTranslation } from '../translate.js'; interface Props { @@ -122,7 +123,7 @@ function AccountMenuButtons ({ className = '', flags, isEditing, isEditingName, ) } {isTransferOpen && ( - { const judgementColor = useMemo(() => getJudgementColor(judgementName), [judgementName]); diff --git a/packages/page-accounts/src/Sidebar/Judgements.tsx b/packages/react-components/src/AccountSidebar/Judgements.tsx similarity index 89% rename from packages/page-accounts/src/Sidebar/Judgements.tsx rename to packages/react-components/src/AccountSidebar/Judgements.tsx index 0718042e83..720cf00fdd 100644 --- a/packages/page-accounts/src/Sidebar/Judgements.tsx +++ b/packages/react-components/src/AccountSidebar/Judgements.tsx @@ -1,11 +1,12 @@ -// Copyright 2017-2023 @polkadot/app-accounts authors & contributors +// Copyright 2017-2023 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 import React from 'react'; -import { styled, Tag } from '@polkadot/react-components'; import { useJudgements } from '@polkadot/react-hooks'; +import { styled } from '../styled.js'; +import Tag from '../Tag.js'; import { useTranslation } from '../translate.js'; import JudgementTag from './JudgementTag.js'; diff --git a/packages/page-accounts/src/Sidebar/Multisig.tsx b/packages/react-components/src/AccountSidebar/Multisig.tsx similarity index 91% rename from packages/page-accounts/src/Sidebar/Multisig.tsx rename to packages/react-components/src/AccountSidebar/Multisig.tsx index 576fcbd7af..c2a7e806c5 100644 --- a/packages/page-accounts/src/Sidebar/Multisig.tsx +++ b/packages/react-components/src/AccountSidebar/Multisig.tsx @@ -1,12 +1,11 @@ -// Copyright 2017-2023 @polkadot/app-accounts authors & contributors +// Copyright 2017-2023 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 import type { KeyringJson$Meta } from '@polkadot/ui-keyring/types'; import React from 'react'; -import { AddressMini } from '@polkadot/react-components'; - +import AddressMini from '../AddressMini.js'; import { useTranslation } from '../translate.js'; interface Props { diff --git a/packages/page-accounts/src/Sidebar/RegistrarJudgement.tsx b/packages/react-components/src/AccountSidebar/RegistrarJudgement.tsx similarity index 92% rename from packages/page-accounts/src/Sidebar/RegistrarJudgement.tsx rename to packages/react-components/src/AccountSidebar/RegistrarJudgement.tsx index d8e86b4bef..3460547ab2 100644 --- a/packages/page-accounts/src/Sidebar/RegistrarJudgement.tsx +++ b/packages/react-components/src/AccountSidebar/RegistrarJudgement.tsx @@ -7,10 +7,16 @@ import type { HexString } from '@polkadot/util/types'; import React, { useEffect, useState } from 'react'; -import { Dropdown, Input, InputAddress, MarkError, Modal, Spinner, TxButton } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; +import Dropdown from '../Dropdown.js'; +import Input from '../Input.js'; +import InputAddress from '../InputAddress/index.js'; +import MarkError from '../MarkError.js'; +import Modal from '../Modal/index.js'; +import Spinner from '../Spinner.js'; import { useTranslation } from '../translate.js'; +import TxButton from '../TxButton.js'; interface Props { address: string; diff --git a/packages/page-accounts/src/Sidebar/Sidebar.spec.tsx b/packages/react-components/src/AccountSidebar/Sidebar.spec.tsx similarity index 99% rename from packages/page-accounts/src/Sidebar/Sidebar.spec.tsx rename to packages/react-components/src/AccountSidebar/Sidebar.spec.tsx index e34a6ab264..5bfe2686df 100644 --- a/packages/page-accounts/src/Sidebar/Sidebar.spec.tsx +++ b/packages/react-components/src/AccountSidebar/Sidebar.spec.tsx @@ -16,7 +16,7 @@ import { charlieShortAddress, ferdieShortAddress, mockRegistration, registrars } import { mockApiHooks } from '@polkadot/test-support/utils'; import { keyring } from '@polkadot/ui-keyring'; -import { AccountsPage } from '../../test/pages/accountsPage.js'; +import { AccountsPage } from '../../../page-accounts/test/pages/accountsPage.js'; // FIXME: these all need to be wrapped in waitFor .... describe.skip('Sidebar', () => { diff --git a/packages/page-accounts/src/Sidebar/Sidebar.tsx b/packages/react-components/src/AccountSidebar/Sidebar.tsx similarity index 96% rename from packages/page-accounts/src/Sidebar/Sidebar.tsx rename to packages/react-components/src/AccountSidebar/Sidebar.tsx index 22bc48ae94..346dbce76a 100644 --- a/packages/page-accounts/src/Sidebar/Sidebar.tsx +++ b/packages/react-components/src/AccountSidebar/Sidebar.tsx @@ -1,13 +1,14 @@ -// Copyright 2017-2023 @polkadot/app-accounts authors & contributors +// Copyright 2017-2023 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 import React, { useRef, useState } from 'react'; -import { LinkExternal, styled } from '@polkadot/react-components'; -import Sidebar from '@polkadot/react-components/Sidebar'; -import { colorLink } from '@polkadot/react-components/styles/theme'; import { useAccountInfo } from '@polkadot/react-hooks'; +import LinkExternal from '../LinkExternal.js'; +import Sidebar from '../Sidebar.js'; +import { styled } from '../styled.js'; +import { colorLink } from '../styles/theme.js'; import Balances from './Balances.js'; import Identity from './Identity.js'; import Multisig from './Multisig.js'; diff --git a/packages/page-accounts/src/Sidebar/SidebarEditableSection.tsx b/packages/react-components/src/AccountSidebar/SidebarEditableSection.tsx similarity index 98% rename from packages/page-accounts/src/Sidebar/SidebarEditableSection.tsx rename to packages/react-components/src/AccountSidebar/SidebarEditableSection.tsx index 4359772a4b..5a8e0a8027 100644 --- a/packages/page-accounts/src/Sidebar/SidebarEditableSection.tsx +++ b/packages/react-components/src/AccountSidebar/SidebarEditableSection.tsx @@ -3,10 +3,10 @@ import React, { useCallback, useEffect, useMemo } from 'react'; -import { Tags } from '@polkadot/react-components'; import { useAccountInfo, useOutsideClick } from '@polkadot/react-hooks'; import { keyring } from '@polkadot/ui-keyring'; +import Tags from '../Tags.js'; import AccountMenuButtons from './AccountMenuButtons.js'; import AddressSection from './AddressSection.js'; import Flags from './Flags.js'; diff --git a/packages/page-accounts/src/Sidebar/UserIcon.tsx b/packages/react-components/src/AccountSidebar/UserIcon.tsx similarity index 99% rename from packages/page-accounts/src/Sidebar/UserIcon.tsx rename to packages/react-components/src/AccountSidebar/UserIcon.tsx index 278519fa5f..eede51e572 100644 --- a/packages/page-accounts/src/Sidebar/UserIcon.tsx +++ b/packages/react-components/src/AccountSidebar/UserIcon.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2023 @polkadot/app-accounts authors & contributors +// Copyright 2017-2023 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 import React from 'react'; diff --git a/packages/page-accounts/src/Sidebar/index.tsx b/packages/react-components/src/AccountSidebar/index.tsx similarity index 78% rename from packages/page-accounts/src/Sidebar/index.tsx rename to packages/react-components/src/AccountSidebar/index.tsx index a5b63eb6b2..3920024fd3 100644 --- a/packages/page-accounts/src/Sidebar/index.tsx +++ b/packages/react-components/src/AccountSidebar/index.tsx @@ -1,8 +1,10 @@ -// Copyright 2017-2023 @polkadot/app-accounts authors & contributors +// Copyright 2017-2023 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 import React, { useCallback, useState } from 'react'; +import { AccountSidebarCtx } from '@polkadot/react-hooks/ctx/AccountSidebar'; + import Sidebar from './Sidebar.js'; interface Props { @@ -11,12 +13,8 @@ interface Props { type State = [string | null, (() => void) | null]; -type SetStateContext = undefined | (([address, onUpdateName]: State) => void); - const EMPTY_STATE: State = [null, null]; -export const AccountSidebarCtx = React.createContext(undefined); - function AccountSidebar ({ children }: Props): React.ReactElement { const [[address, onUpdateName], setAddress] = useState(EMPTY_STATE); diff --git a/packages/react-components/src/BatchWarning.tsx b/packages/react-components/src/BatchWarning.tsx index 34faa5cafe..570aba59ce 100644 --- a/packages/react-components/src/BatchWarning.tsx +++ b/packages/react-components/src/BatchWarning.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2023 @polkadot/app-accounts authors & contributors +// Copyright 2017-2023 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 import React from 'react'; diff --git a/packages/react-components/src/ChainLock.tsx b/packages/react-components/src/ChainLock.tsx index bfa7a584ef..99ead9f30b 100644 --- a/packages/react-components/src/ChainLock.tsx +++ b/packages/react-components/src/ChainLock.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2023 @polkadot/app-accounts authors & contributors +// Copyright 2017-2023 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 import React, { useCallback, useMemo } from 'react'; diff --git a/packages/react-components/src/FilterInput.tsx b/packages/react-components/src/FilterInput.tsx index e06727d14d..fcaf6b95a2 100644 --- a/packages/react-components/src/FilterInput.tsx +++ b/packages/react-components/src/FilterInput.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2023 @polkadot/app-accounts authors & contributors +// Copyright 2017-2023 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 import React from 'react'; diff --git a/packages/react-components/src/Flag.tsx b/packages/react-components/src/Flag.tsx index d225b334a4..ac3b7d5876 100644 --- a/packages/react-components/src/Flag.tsx +++ b/packages/react-components/src/Flag.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2023 @polkadot/app-accounts authors & contributors +// Copyright 2017-2023 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 import type { FlagColor } from './types.js'; diff --git a/packages/react-components/src/Forget.tsx b/packages/react-components/src/Forget.tsx index 0c29921007..505124c199 100644 --- a/packages/react-components/src/Forget.tsx +++ b/packages/react-components/src/Forget.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2023 @polkadot/app-accounts authors & contributors +// Copyright 2017-2023 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 import React from 'react'; diff --git a/packages/react-components/src/InputConsts/units.ts b/packages/react-components/src/InputConsts/units.ts new file mode 100644 index 0000000000..4cd571cf73 --- /dev/null +++ b/packages/react-components/src/InputConsts/units.ts @@ -0,0 +1,10 @@ +// Copyright 2017-2023 @polkadot/react-components authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +export class TokenUnit { + public static abbr = 'Unit'; + + public static setAbbr (abbr: string = TokenUnit.abbr): void { + TokenUnit.abbr = abbr; + } +} diff --git a/packages/react-components/src/InputNumber.tsx b/packages/react-components/src/InputNumber.tsx index 80d3532e22..66f1716e41 100644 --- a/packages/react-components/src/InputNumber.tsx +++ b/packages/react-components/src/InputNumber.tsx @@ -10,6 +10,7 @@ import React, { useCallback, useEffect, useState } from 'react'; import { useApi } from '@polkadot/react-hooks'; import { BN, BN_ONE, BN_TEN, BN_TWO, BN_ZERO, formatBalance, isBn, isUndefined } from '@polkadot/util'; +import { TokenUnit } from './InputConsts/units.js'; import Input, { KEYS_PRE } from './Input.js'; import { styled } from './styled.js'; import { useTranslation } from './translate.js'; @@ -48,14 +49,6 @@ interface Props { const DEFAULT_BITLENGTH = 32; -export class TokenUnit { - public static abbr = 'Unit'; - - public static setAbbr (abbr: string = TokenUnit.abbr): void { - TokenUnit.abbr = abbr; - } -} - function getGlobalMaxValue (bitLength?: number): BN { return BN_TWO.pow(new BN(bitLength || DEFAULT_BITLENGTH)).isub(BN_ONE); } diff --git a/packages/react-components/src/InputTags.tsx b/packages/react-components/src/InputTags.tsx index 9d89ec0cea..ab7932e14c 100644 --- a/packages/react-components/src/InputTags.tsx +++ b/packages/react-components/src/InputTags.tsx @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeDef } from '@polkadot/react-hooks/ctx/types'; +import type { ThemeDef } from './types.js'; import React, { useContext } from 'react'; import store from 'store'; diff --git a/packages/react-components/src/Modal/Modal.spec.tsx b/packages/react-components/src/Modal/Modal.spec.tsx index aeb267e36f..6beb3378a8 100644 --- a/packages/react-components/src/Modal/Modal.spec.tsx +++ b/packages/react-components/src/Modal/Modal.spec.tsx @@ -7,7 +7,7 @@ import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import React, { Suspense } from 'react'; import { ThemeProvider } from 'styled-components'; -import { lightTheme } from '@polkadot/apps/themes'; +import { lightTheme } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; import Button from '../Button/index.js'; diff --git a/packages/react-components/src/Popup/Popup.spec.tsx b/packages/react-components/src/Popup/Popup.spec.tsx index 05f0ee50ec..4ebf7f3d67 100644 --- a/packages/react-components/src/Popup/Popup.spec.tsx +++ b/packages/react-components/src/Popup/Popup.spec.tsx @@ -7,7 +7,7 @@ import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import React, { Suspense } from 'react'; import { ThemeProvider } from 'styled-components'; -import { lightTheme } from '@polkadot/apps/themes'; +import { lightTheme } from '@polkadot/react-components'; import i18next from '@polkadot/react-components/i18n'; import Popup from './index.js'; diff --git a/packages/react-components/src/Sidebar.tsx b/packages/react-components/src/Sidebar.tsx index b820b5f34e..4e313ddb03 100644 --- a/packages/react-components/src/Sidebar.tsx +++ b/packages/react-components/src/Sidebar.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2023 @polkadot/app-accounts authors & contributors +// Copyright 2017-2023 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 import React from 'react'; diff --git a/packages/react-components/src/Tabs/Tab.tsx b/packages/react-components/src/Tabs/Tab.tsx index 21c494063c..da8d1d3ccf 100644 --- a/packages/react-components/src/Tabs/Tab.tsx +++ b/packages/react-components/src/Tabs/Tab.tsx @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { TabItem } from './types.js'; +import type { TabItem } from '../types.js'; import React from 'react'; import { NavLink } from 'react-router-dom'; diff --git a/packages/react-components/src/Tabs/index.tsx b/packages/react-components/src/Tabs/index.tsx index ff76986dd3..247fe83059 100644 --- a/packages/react-components/src/Tabs/index.tsx +++ b/packages/react-components/src/Tabs/index.tsx @@ -2,18 +2,18 @@ // SPDX-License-Identifier: Apache-2.0 import type { Location } from 'history'; -import type { SectionType, TabItem } from './types.js'; +import type { TabItem } from '../types.js'; import React, { useEffect, useMemo } from 'react'; import { useLocation } from 'react-router-dom'; +import { TabsCtx } from '@polkadot/react-hooks/ctx/Tabs'; + import { styled } from '../styled.js'; import CurrentSection from './CurrentSection.js'; import Tab from './Tab.js'; import Delimiter from './TabsSectionDelimiter.js'; -export const TabsCtx = React.createContext({}); - interface Props { className?: string; basePath: string; diff --git a/packages/react-components/src/Tabs/types.ts b/packages/react-components/src/Tabs/types.ts deleted file mode 100644 index 462e7cc7f0..0000000000 --- a/packages/react-components/src/Tabs/types.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2017-2023 @polkadot/react-components authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import type { IconName } from '@fortawesome/fontawesome-svg-core'; -import type React from 'react'; - -export interface TabItem { - alias?: string; - count?: number; - hasParams?: boolean; - isExact?: boolean; - isHidden?: boolean; - isRoot?: boolean; - name: string; - text: React.ReactNode; -} - -export interface SectionType { - icon?: IconName; - text?: string; -} diff --git a/packages/react-components/src/Tag.tsx b/packages/react-components/src/Tag.tsx index 87ca936a5a..1365a57506 100644 --- a/packages/react-components/src/Tag.tsx +++ b/packages/react-components/src/Tag.tsx @@ -1,8 +1,7 @@ // Copyright 2017-2023 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeDef } from '@polkadot/react-hooks/ctx/types'; -import type { FlagColor as TagColor } from './types.js'; +import type { FlagColor as TagColor, ThemeDef } from './types.js'; import React, { useContext, useState } from 'react'; import { ThemeContext } from 'styled-components'; diff --git a/packages/react-components/src/index.ts b/packages/react-components/src/index.ts index f4c439b628..37ba653c2c 100644 --- a/packages/react-components/src/index.ts +++ b/packages/react-components/src/index.ts @@ -1,8 +1,10 @@ // Copyright 2017-2023 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +// named exports export { default as AccountIndex } from './AccountIndex.js'; export { default as AccountName } from './AccountName.js'; +export { default as AccountSidebar } from './AccountSidebar/index.js'; export { default as AddressInfo } from './AddressInfo.js'; export { default as AddressMini } from './AddressMini.js'; export { default as AddressRow } from './AddressRow.js'; @@ -91,7 +93,7 @@ export { default as Status } from './Status/index.js'; export { styled } from './styled.js'; export { default as SummaryBox } from './SummaryBox.js'; export { default as Table } from './Table/index.js'; -export { default as Tabs, TabsCtx } from './Tabs/index.js'; +export { default as Tabs } from './Tabs/index.js'; export { default as Tag } from './Tag.js'; export { default as Tags } from './Tags.js'; export { default as TextArea } from './TextArea.js'; @@ -101,4 +103,10 @@ export { default as Tooltip } from './Tooltip.js'; export { default as TxButton } from './TxButton.js'; export { default as VoteAccount } from './VoteAccount.js'; export { default as VoteValue } from './VoteValue.js'; + +// star exports +export * from './modals/index.js'; +export * from './themes.js'; + +// external exports export * from '@polkadot/react-qr'; diff --git a/packages/page-accounts/src/modals/Transfer.tsx b/packages/react-components/src/modals/Transfer.tsx similarity index 95% rename from packages/page-accounts/src/modals/Transfer.tsx rename to packages/react-components/src/modals/Transfer.tsx index c3a87d1cb5..5efba497a8 100644 --- a/packages/page-accounts/src/modals/Transfer.tsx +++ b/packages/react-components/src/modals/Transfer.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2023 @polkadot/app-accounts authors & contributors +// Copyright 2017-2023 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; @@ -8,12 +8,19 @@ import type { BN } from '@polkadot/util'; import React, { useEffect, useState } from 'react'; import { checkAddress } from '@polkadot/phishing'; -import { InputAddress, InputBalance, MarkError, MarkWarning, Modal, styled, Toggle, TxButton } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { Available } from '@polkadot/react-query'; import { BN_HUNDRED, BN_ZERO, isFunction, nextTick } from '@polkadot/util'; +import InputAddress from '../InputAddress/index.js'; +import InputBalance from '../InputBalance.js'; +import MarkError from '../MarkError.js'; +import MarkWarning from '../MarkWarning.js'; +import Modal from '../Modal/index.js'; +import { styled } from '../styled.js'; +import Toggle from '../Toggle.js'; import { useTranslation } from '../translate.js'; +import TxButton from '../TxButton.js'; interface Props { className?: string; diff --git a/packages/react-components/src/modals/index.ts b/packages/react-components/src/modals/index.ts new file mode 100644 index 0000000000..c03ddbb270 --- /dev/null +++ b/packages/react-components/src/modals/index.ts @@ -0,0 +1,4 @@ +// Copyright 2017-2023 @polkadot/react-components authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +export { default as TransferModal } from './Transfer.js'; diff --git a/packages/react-components/src/styles/components.ts b/packages/react-components/src/styles/components.ts index 42a3b14adc..89f5621cf6 100644 --- a/packages/react-components/src/styles/components.ts +++ b/packages/react-components/src/styles/components.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeDef } from '@polkadot/react-hooks/ctx/types'; +import type { ThemeDef } from '../types.js'; export default (_theme: ThemeDef): string => ` .ui--output { diff --git a/packages/react-components/src/styles/semantic.ts b/packages/react-components/src/styles/semantic.ts index 2dc8755750..b6889f50c0 100644 --- a/packages/react-components/src/styles/semantic.ts +++ b/packages/react-components/src/styles/semantic.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeDef } from '@polkadot/react-hooks/ctx/types'; +import type { ThemeDef } from '../types.js'; export default (_theme: ThemeDef): string => ` .ui.hidden.divider { diff --git a/packages/apps/src/themes.ts b/packages/react-components/src/themes.ts similarity index 55% rename from packages/apps/src/themes.ts rename to packages/react-components/src/themes.ts index 8a07309129..06aefadf68 100644 --- a/packages/apps/src/themes.ts +++ b/packages/react-components/src/themes.ts @@ -1,7 +1,7 @@ -// Copyright 2017-2023 @polkadot/apps authors & contributors +// Copyright 2017-2023 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeDef } from '@polkadot/react-hooks/ctx/types'; +import type { ThemeDef } from './types.js'; export const darkTheme: ThemeDef = { theme: 'dark' diff --git a/packages/react-components/src/types.ts b/packages/react-components/src/types.ts index b89627ddcb..d528ac09da 100644 --- a/packages/react-components/src/types.ts +++ b/packages/react-components/src/types.ts @@ -5,7 +5,6 @@ import type { IconName } from '@fortawesome/fontawesome-svg-core'; import type { WithTranslation } from 'react-i18next'; import type { SubmittableExtrinsic } from '@polkadot/api/types'; import type { Abi } from '@polkadot/api-contract'; -import type { ThemeDef } from '@polkadot/react-hooks/ctx/types'; import type { AccountId, AccountIndex, Address, Index } from '@polkadot/types/interfaces'; import type { ActionStatus, TxCallback, TxFailedCallback } from './Status/types.js'; @@ -21,6 +20,10 @@ export interface AppProps { onStatusChange: (status: ActionStatus) => void; } +export interface ThemeDef { + theme: 'dark' | 'light'; +} + export type I18nProps = BareProps & WithTranslation; export interface TxButtonProps { @@ -79,3 +82,14 @@ export type FlagColor = 'blue' | 'black' | 'green' | 'grey' | 'lightgrey' | 'ora export type AccountIdIsh = AccountId | AccountIndex | Address | string | Uint8Array | null; export type DisplayedJudgement = 'Erroneous' | 'Low quality' | 'Known good' | 'Reasonable'; + +export interface TabItem { + alias?: string; + count?: number; + hasParams?: boolean; + isExact?: boolean; + isHidden?: boolean; + isRoot?: boolean; + name: string; + text: React.ReactNode; +} diff --git a/packages/react-components/src/util/getContractAbi.ts b/packages/react-components/src/util/getContractAbi.ts index 778f80d308..71e8a5166e 100644 --- a/packages/react-components/src/util/getContractAbi.ts +++ b/packages/react-components/src/util/getContractAbi.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { Abi } from '@polkadot/api-contract'; -import { api } from '@polkadot/react-api'; +import { statics } from '@polkadot/react-api'; import { getAddressMeta } from './getAddressMeta.js'; @@ -17,7 +17,7 @@ export function getContractAbi (address: string | null): Abi | null { try { const data = (meta.contract && JSON.parse(meta.contract.abi)) as string; - abi = new Abi(data, api.registry.getChainProperties()); + abi = new Abi(data, statics.api.registry.getChainProperties()); } catch (error) { console.error(error); } diff --git a/packages/react-hooks/src/ctx/AccountSidebar.tsx b/packages/react-hooks/src/ctx/AccountSidebar.tsx new file mode 100644 index 0000000000..a031461f58 --- /dev/null +++ b/packages/react-hooks/src/ctx/AccountSidebar.tsx @@ -0,0 +1,8 @@ +// Copyright 2017-2023 @polkadot/react-hooks authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import React from 'react'; + +type SetStateContext = undefined | (([address, onUpdateName]: [string | null, (() => void) | null]) => void); + +export const AccountSidebarCtx = React.createContext(undefined); diff --git a/packages/react-hooks/src/ctx/Api.tsx b/packages/react-hooks/src/ctx/Api.tsx new file mode 100644 index 0000000000..4c3f6e8e5e --- /dev/null +++ b/packages/react-hooks/src/ctx/Api.tsx @@ -0,0 +1,8 @@ +// Copyright 2017-2023 @polkadot/react-hooks authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { ApiProps } from '@polkadot/react-api/types'; + +import React from 'react'; + +export const ApiCtx = React.createContext({} as unknown as ApiProps); diff --git a/packages/react-hooks/src/ctx/ApiStats.tsx b/packages/react-hooks/src/ctx/ApiStats.tsx index 9e6cef98eb..ddad54d95b 100644 --- a/packages/react-hooks/src/ctx/ApiStats.tsx +++ b/packages/react-hooks/src/ctx/ApiStats.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2023 @polkadot/react-components authors & contributors +// Copyright 2017-2023 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 import type { ApiPromise } from '@polkadot/api'; diff --git a/packages/react-hooks/src/ctx/Queue.tsx b/packages/react-hooks/src/ctx/Queue.tsx index 3fd4e824cd..2d3c026c48 100644 --- a/packages/react-hooks/src/ctx/Queue.tsx +++ b/packages/react-hooks/src/ctx/Queue.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2023 @polkadot/react-components authors & contributors +// Copyright 2017-2023 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 import type { SubmittableResult } from '@polkadot/api'; diff --git a/packages/react-hooks/src/ctx/Tabs.tsx b/packages/react-hooks/src/ctx/Tabs.tsx new file mode 100644 index 0000000000..df2f2a7359 --- /dev/null +++ b/packages/react-hooks/src/ctx/Tabs.tsx @@ -0,0 +1,13 @@ +// Copyright 2017-2023 @polkadot/react-hooks authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { IconName } from '@fortawesome/fontawesome-svg-core'; + +import React from 'react'; + +interface SectionType { + icon?: IconName; + text?: string; +} + +export const TabsCtx = React.createContext({}); diff --git a/packages/react-hooks/src/ctx/types.ts b/packages/react-hooks/src/ctx/types.ts index d066655d74..cc706e9395 100644 --- a/packages/react-hooks/src/ctx/types.ts +++ b/packages/react-hooks/src/ctx/types.ts @@ -55,10 +55,6 @@ export type SidebarState = [string | null, (() => void) | null]; export type Sidebar = undefined | (([address, onUpdateName]: SidebarState) => void); -export interface ThemeDef { - theme: 'dark' | 'light'; -} - export interface WindowSize { height: number; width: number; diff --git a/packages/react-hooks/src/translate.ts b/packages/react-hooks/src/translate.ts index 9f5d200ecf..2edde0f86e 100644 --- a/packages/react-hooks/src/translate.ts +++ b/packages/react-hooks/src/translate.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2023 @polkadot/react-components authors & contributors +// Copyright 2017-2023 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 import type { UseTranslationResponse } from 'react-i18next'; diff --git a/packages/react-hooks/src/types.ts b/packages/react-hooks/src/types.ts index 3f3270adde..890f6470b9 100644 --- a/packages/react-hooks/src/types.ts +++ b/packages/react-hooks/src/types.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2023 @polkadot/react-components authors & contributors +// Copyright 2017-2023 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 import type { ApiPromise } from '@polkadot/api'; diff --git a/packages/react-hooks/src/useApi.ts b/packages/react-hooks/src/useApi.ts index 6e603e08ac..bc6a18a45a 100644 --- a/packages/react-hooks/src/useApi.ts +++ b/packages/react-hooks/src/useApi.ts @@ -5,8 +5,7 @@ import type { ApiProps } from '@polkadot/react-api/types'; import { useContext } from 'react'; -import { ApiCtx } from '@polkadot/react-api'; - +import { ApiCtx } from './ctx/Api.js'; import { createNamedHook } from './createNamedHook.js'; function useApiImpl (): ApiProps { diff --git a/packages/react-hooks/src/useApiStats.ts b/packages/react-hooks/src/useApiStats.ts index e04f90eec6..3700407518 100644 --- a/packages/react-hooks/src/useApiStats.ts +++ b/packages/react-hooks/src/useApiStats.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2023 @polkadot/react-components authors & contributors +// Copyright 2017-2023 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 import type { ApiStats } from './ctx/types.js'; diff --git a/packages/react-hooks/src/useMemoValue.spec.ts b/packages/react-hooks/src/useMemoValue.spec.ts index 9998c9bc75..26b888e08d 100644 --- a/packages/react-hooks/src/useMemoValue.spec.ts +++ b/packages/react-hooks/src/useMemoValue.spec.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2023 @polkadot/react-components authors & contributors +// Copyright 2017-2023 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 /// diff --git a/packages/react-hooks/src/useOutsideClick.ts b/packages/react-hooks/src/useOutsideClick.ts index f808959f5d..1e000176f3 100644 --- a/packages/react-hooks/src/useOutsideClick.ts +++ b/packages/react-hooks/src/useOutsideClick.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2023 @polkadot/react-components authors & contributors +// Copyright 2017-2023 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 import type { RefObject } from 'react'; diff --git a/packages/react-hooks/src/useTheme.ts b/packages/react-hooks/src/useTheme.ts index 7da953fa65..08c7be6f21 100644 --- a/packages/react-hooks/src/useTheme.ts +++ b/packages/react-hooks/src/useTheme.ts @@ -1,7 +1,7 @@ // Copyright 2017-2023 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeDef } from './ctx/types.js'; +import type { ThemeDef } from '@polkadot/react-components/types'; import { useContext, useMemo } from 'react'; import { ThemeContext } from 'styled-components'; diff --git a/packages/react-hooks/src/useTimer.ts b/packages/react-hooks/src/useTimer.ts index 07747cc777..63d206a77b 100644 --- a/packages/react-hooks/src/useTimer.ts +++ b/packages/react-hooks/src/useTimer.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2023 @polkadot/react-components authors & contributors +// Copyright 2017-2023 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 import { useEffect, useRef, useState } from 'react'; diff --git a/packages/react-params/src/index.tsx b/packages/react-params/src/index.tsx index d3b4de68f9..8e9ba8cad6 100644 --- a/packages/react-params/src/index.tsx +++ b/packages/react-params/src/index.tsx @@ -7,7 +7,7 @@ import type { ComponentMap, ParamDef, RawParam, RawParamOnChangeValue, RawParams import React from 'react'; -import { api } from '@polkadot/react-api'; +import { statics } from '@polkadot/react-api'; import { ErrorBoundary } from '@polkadot/react-components'; import { stringify } from '@polkadot/util'; @@ -44,7 +44,7 @@ class Params extends React.PureComponent { params: null }; - public static getDerivedStateFromProps ({ isDisabled, params, registry = api.registry, values }: Props, prevState: State): Pick | null { + public static getDerivedStateFromProps ({ isDisabled, params, registry = statics.api.registry, values }: Props, prevState: State): Pick | null { if (isDisabled || stringify(prevState.params) === stringify(params)) { return null; } @@ -82,7 +82,7 @@ class Params extends React.PureComponent { } public override render (): React.ReactNode { - const { children, className = '', isDisabled, isError, onEnter, onEscape, overrides, params, registry = api.registry, withBorder = true, withExpander } = this.props; + const { children, className = '', isDisabled, isError, onEnter, onEscape, overrides, params, registry = statics.api.registry, withBorder = true, withExpander } = this.props; const { values = this.props.values } = this.state; if (!values || !values.length) { diff --git a/packages/react-query/src/BlockToTime.tsx b/packages/react-query/src/BlockToTime.tsx index 35d81ab770..82fbb0360f 100644 --- a/packages/react-query/src/BlockToTime.tsx +++ b/packages/react-query/src/BlockToTime.tsx @@ -6,7 +6,7 @@ import type { BN } from '@polkadot/util'; import React from 'react'; -import { styled } from '@polkadot/react-components/styled'; +import { styled } from '@polkadot/react-components'; import { useBlockTime } from '@polkadot/react-hooks'; interface Props { diff --git a/packages/react-query/src/Elapsed.tsx b/packages/react-query/src/Elapsed.tsx index 64696d852d..f74a2ad924 100644 --- a/packages/react-query/src/Elapsed.tsx +++ b/packages/react-query/src/Elapsed.tsx @@ -5,7 +5,7 @@ import type { BN } from '@polkadot/util'; import React, { useEffect, useState } from 'react'; -import { styled } from '@polkadot/react-components/styled'; +import { styled } from '@polkadot/react-components'; import { bnToBn } from '@polkadot/util'; type Ticker = (now: number) => void; diff --git a/packages/react-query/src/FormatBalance.tsx b/packages/react-query/src/FormatBalance.tsx index bf6c4078fc..ae2e52bed9 100644 --- a/packages/react-query/src/FormatBalance.tsx +++ b/packages/react-query/src/FormatBalance.tsx @@ -7,7 +7,7 @@ import type { BN } from '@polkadot/util'; import React, { useMemo } from 'react'; -import { styled } from '@polkadot/react-components/styled'; +import { styled } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import { formatBalance, isString } from '@polkadot/util'; diff --git a/packages/test-support/src/mockData/index.ts b/packages/test-support/src/mockData/index.ts index ad2dc04e52..1f2eb85784 100644 --- a/packages/test-support/src/mockData/index.ts +++ b/packages/test-support/src/mockData/index.ts @@ -3,32 +3,32 @@ import type { Registrar } from '@polkadot/react-hooks/types'; -import { registry } from '@polkadot/react-api'; +import { statics } from '@polkadot/react-api'; import { bob, charlie, ferdie } from '../keyring/index.js'; export const mockRegistration = { judgements: [ [ - registry.createType('RegistrarIndex', '0'), + statics.registry.createType('RegistrarIndex', '0'), { isReasonable: true } ], [ - registry.createType('RegistrarIndex', '1'), + statics.registry.createType('RegistrarIndex', '1'), { isKnownGood: true } ], [ - registry.createType('RegistrarIndex', '2'), + statics.registry.createType('RegistrarIndex', '2'), { isErroneous: true } ], [ - registry.createType('RegistrarIndex', '3'), + statics.registry.createType('RegistrarIndex', '3'), { isReasonable: true } diff --git a/packages/test-support/src/pages/Page.tsx b/packages/test-support/src/pages/Page.tsx index 5e669ed869..9fea6d55a0 100644 --- a/packages/test-support/src/pages/Page.tsx +++ b/packages/test-support/src/pages/Page.tsx @@ -12,10 +12,9 @@ import React, { Suspense } from 'react'; import { MemoryRouter } from 'react-router-dom'; import { ThemeProvider } from 'styled-components'; -import AccountSidebar from '@polkadot/app-accounts/Sidebar'; -import { lightTheme } from '@polkadot/apps/themes'; import { POLKADOT_GENESIS } from '@polkadot/apps-config'; -import { ApiCtx } from '@polkadot/react-api'; +import { AccountSidebar, lightTheme } from '@polkadot/react-components'; +import { ApiCtx } from '@polkadot/react-hooks/ctx/Api'; import { QueueCtx } from '@polkadot/react-hooks/ctx/Queue'; import { TypeRegistry } from '@polkadot/types/create'; import { keyring } from '@polkadot/ui-keyring'; diff --git a/tsconfig.base.json b/tsconfig.base.json index e3665eb941..382dae4265 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -5,7 +5,6 @@ "paths": { "@polkadot/apps": ["apps/src/index.tsx"], "@polkadot/apps/Root": ["apps/src/Root.tsx"], - "@polkadot/apps/themes": ["apps/src/themes.ts"], "@polkadot/apps-config": ["apps-config/src/index.ts"], "@polkadot/apps-config/endpoints": ["apps-config/src/endpoints/index.ts"], "@polkadot/apps-config/endpoints/*": ["apps-config/src/endpoints/*.ts"], @@ -15,8 +14,6 @@ "@polkadot/apps-routing": ["apps-routing/src/index.ts"], "@polkadot/apps-routing/*": ["apps-routing/src/*.ts"], "@polkadot/app-accounts": ["page-accounts/src/index.tsx"], - "@polkadot/app-accounts/modals/Transfer": ["page-accounts/src/modals/Transfer.tsx"], - "@polkadot/app-accounts/Sidebar": ["page-accounts/src/Sidebar/index.tsx"], "@polkadot/app-addresses": ["page-addresses/src/index.tsx"], "@polkadot/app-alliance": ["page-alliance/src/index.tsx"], "@polkadot/app-assets": ["page-assets/src/index.tsx"], @@ -85,10 +82,8 @@ "@polkadot/react-components/InputConsts/*": ["react-components/src/InputConsts/*.ts"], "@polkadot/react-components/Popup/*": ["react-components/src/Popup/*.ts"], "@polkadot/react-components/Status/*": ["react-components/src/Status/*.ts"], - "@polkadot/react-components/styled": ["react-components/src/styled.ts"], "@polkadot/react-components/styles": ["react-components/src/styles/index.ts"], "@polkadot/react-components/styles/*": ["react-components/src/styles/*.ts"], - "@polkadot/react-components/Tabs/*": ["react-components/src/Tabs/*.ts"], "@polkadot/react-components/types": ["react-components/src/types.ts"], "@polkadot/react-components/util": ["react-components/src/util/index.ts"], "@polkadot/react-components/util/types": ["react-components/src/util/types.ts"],