From 87505b1c59dabc58a9a24c76df6cdbb6362abc1a Mon Sep 17 00:00:00 2001 From: Ewa Kowalska <30404388+ekowalsk@users.noreply.github.com> Date: Tue, 1 Dec 2020 14:40:42 +0100 Subject: [PATCH] Eslint imports (#4037) * Add eslint configuration * Patch eslint plugin for sorting imports * Apply eslint rules for imports --- .eslintrc.js | 13 +- jest/globalSetup.ts | 1 + package.json | 4 + .../apps-config/src/api/bundle/spec/acala.ts | 4 +- .../src/api/bundle/spec/laminar.ts | 4 +- .../src/api/bundle/spec/soraSubstrate.ts | 1 + packages/apps-config/src/api/constants.ts | 1 + .../apps-config/src/api/params/inflation.ts | 2 +- .../src/api/params/proposalThresholds.ts | 2 +- .../apps-config/src/api/rpc/soraSubstrate.ts | 1 + packages/apps-config/src/api/spec/index.ts | 4 +- packages/apps-config/src/links/index.ts | 1 - .../apps-config/src/settings/endpoints.ts | 2 +- .../apps-config/src/settings/languages.ts | 1 + packages/apps-config/src/settings/ss58.ts | 3 +- packages/apps-config/src/ui/logos/index.ts | 34 +- packages/apps-electron/src/electron/index.ts | 1 + packages/apps-electron/src/index.tsx | 2 +- .../src/main/account-store.spec.ts | 4 +- .../apps-electron/src/main/account-store.ts | 4 +- .../src/main/register-ipc-handler.ts | 1 + packages/apps-electron/src/preload.ts | 4 +- packages/apps-routing/src/accounts.ts | 3 +- packages/apps-routing/src/addresses.ts | 3 +- packages/apps-routing/src/calendar.ts | 3 +- packages/apps-routing/src/claims.ts | 3 +- packages/apps-routing/src/contracts.ts | 3 +- packages/apps-routing/src/council.ts | 3 +- packages/apps-routing/src/democracy.ts | 3 +- packages/apps-routing/src/explorer.ts | 3 +- packages/apps-routing/src/extrinsics.ts | 3 +- packages/apps-routing/src/generic-asset.ts | 3 +- packages/apps-routing/src/index.ts | 2 +- packages/apps-routing/src/js.ts | 3 +- packages/apps-routing/src/parachains.ts | 3 +- packages/apps-routing/src/poll.ts | 3 +- packages/apps-routing/src/rpc.ts | 3 +- packages/apps-routing/src/settings.ts | 3 +- packages/apps-routing/src/signing.ts | 3 +- packages/apps-routing/src/society.ts | 3 +- packages/apps-routing/src/staking.ts | 3 +- packages/apps-routing/src/storage.ts | 3 +- packages/apps-routing/src/sudo.ts | 3 +- packages/apps-routing/src/techcomm.ts | 3 +- packages/apps-routing/src/transfer.ts | 3 +- packages/apps-routing/src/treasury.ts | 3 +- packages/apps-routing/src/types.ts | 1 + packages/apps/src/Apps.tsx | 6 +- packages/apps/src/Content/NotFound.tsx | 4 +- packages/apps/src/Content/Status.tsx | 6 +- packages/apps/src/Content/index.tsx | 4 +- packages/apps/src/Endpoints/Group.tsx | 6 +- packages/apps/src/Endpoints/Network.tsx | 6 +- packages/apps/src/Endpoints/Url.tsx | 1 + packages/apps/src/Endpoints/index.tsx | 12 +- packages/apps/src/Menu/ChainInfo.tsx | 4 +- packages/apps/src/Menu/Grouping.tsx | 6 +- packages/apps/src/Menu/Item.tsx | 5 +- packages/apps/src/Menu/NodeInfo.tsx | 4 +- packages/apps/src/Menu/index.tsx | 12 +- packages/apps/src/Menu/types.tsx | 4 +- packages/apps/src/Root.tsx | 10 +- packages/apps/src/TopBar.tsx | 1 + packages/apps/src/WarmUp.tsx | 1 + packages/apps/src/index.tsx | 1 - packages/apps/src/initSettings.ts | 1 + packages/apps/src/overlays/Base.tsx | 6 +- packages/apps/src/overlays/Connecting.tsx | 1 + .../page-accounts/src/Accounts/Account.tsx | 18 +- .../src/Accounts/BannerClaims.tsx | 1 + .../src/Accounts/BannerExtension.tsx | 3 +- packages/page-accounts/src/Accounts/index.tsx | 16 +- packages/page-accounts/src/Accounts/types.ts | 4 +- .../src/Accounts/useKnownAddresses.ts | 1 + .../src/Accounts/useMultisigApprovals.ts | 4 +- .../page-accounts/src/Accounts/useProxies.ts | 6 +- .../src/CreateAccount.slow.spec.tsx | 11 +- .../page-accounts/src/Sidebar/Balances.tsx | 1 + packages/page-accounts/src/Sidebar/Flags.tsx | 4 +- .../page-accounts/src/Sidebar/Identity.tsx | 4 +- .../page-accounts/src/Sidebar/Multisig.tsx | 4 +- .../src/Sidebar/RegistrarJudgement.tsx | 1 + .../page-accounts/src/Sidebar/Sidebar.tsx | 8 +- packages/page-accounts/src/Sidebar/index.tsx | 4 +- packages/page-accounts/src/Vanity/Match.tsx | 4 +- packages/page-accounts/src/Vanity/index.tsx | 8 +- packages/page-accounts/src/index.tsx | 10 +- packages/page-accounts/src/modals/Backup.tsx | 1 + .../page-accounts/src/modals/ChangePass.tsx | 1 + packages/page-accounts/src/modals/Create.tsx | 12 +- .../src/modals/CreateConfirmation.tsx | 4 +- .../page-accounts/src/modals/Delegate.tsx | 6 +- packages/page-accounts/src/modals/Derive.tsx | 4 +- .../page-accounts/src/modals/IdentityMain.tsx | 6 +- .../page-accounts/src/modals/IdentitySub.tsx | 4 +- packages/page-accounts/src/modals/Import.tsx | 8 +- .../src/modals/InputValidateAmount.tsx | 6 +- packages/page-accounts/src/modals/Ledger.tsx | 3 +- .../src/modals/MultisigApprove.tsx | 8 +- .../src/modals/MultisigCreate.tsx | 8 +- .../src/modals/PasswordInput.tsx | 1 + .../page-accounts/src/modals/ProxiedAdd.tsx | 8 +- .../src/modals/ProxyOverview.tsx | 10 +- packages/page-accounts/src/modals/Qr.tsx | 6 +- .../src/modals/RecoverAccount.tsx | 1 + .../page-accounts/src/modals/RecoverSetup.tsx | 5 +- .../page-accounts/src/modals/Transfer.tsx | 6 +- .../page-accounts/src/modals/Undelegate.tsx | 1 + packages/page-accounts/src/types.ts | 4 +- packages/page-accounts/src/util.tsx | 7 +- .../page-addresses/src/Contacts/Address.tsx | 12 +- .../page-addresses/src/Contacts/index.tsx | 6 +- packages/page-addresses/src/index.tsx | 6 +- packages/page-addresses/src/modals/Create.tsx | 6 +- packages/page-addresses/src/types.ts | 4 +- packages/page-addresses/src/util.tsx | 7 +- packages/page-calendar/src/Day.tsx | 6 +- packages/page-calendar/src/DayHour.tsx | 3 +- packages/page-calendar/src/DayItem.tsx | 12 +- packages/page-calendar/src/Month.tsx | 6 +- packages/page-calendar/src/MonthDay.tsx | 4 +- packages/page-calendar/src/index.tsx | 6 +- packages/page-calendar/src/useScheduled.ts | 9 +- packages/page-calendar/src/util.ts | 1 - packages/page-claims/src/Attest.tsx | 6 +- packages/page-claims/src/Claim.tsx | 8 +- packages/page-claims/src/Statement.tsx | 6 +- packages/page-claims/src/Warning.tsx | 4 +- packages/page-claims/src/index.tsx | 16 +- .../page-claims/src/usePolkadotPreclaims.ts | 6 +- packages/page-claims/src/util.ts | 6 +- packages/page-contracts/src/Banner.tsx | 1 + packages/page-contracts/src/Codes/Add.tsx | 8 +- packages/page-contracts/src/Codes/Code.tsx | 10 +- packages/page-contracts/src/Codes/Upload.tsx | 6 +- .../page-contracts/src/Codes/ValidateCode.tsx | 4 +- packages/page-contracts/src/Codes/index.tsx | 2 +- packages/page-contracts/src/Contracts/Add.tsx | 8 +- .../page-contracts/src/Contracts/Call.tsx | 16 +- .../page-contracts/src/Contracts/Contract.tsx | 8 +- .../page-contracts/src/Contracts/Outcome.tsx | 4 +- .../src/Contracts/ValidateAddr.tsx | 6 +- .../page-contracts/src/Contracts/index.tsx | 8 +- .../page-contracts/src/Contracts/util.tsx | 4 +- packages/page-contracts/src/Deploy.tsx | 12 +- packages/page-contracts/src/RemoveABI.tsx | 4 +- packages/page-contracts/src/Summary.tsx | 3 +- packages/page-contracts/src/index.tsx | 12 +- packages/page-contracts/src/shared/ABI.tsx | 3 +- .../page-contracts/src/shared/CodeRow.tsx | 10 +- .../src/shared/InputMegaGas.tsx | 4 +- .../page-contracts/src/shared/InputName.tsx | 4 +- .../page-contracts/src/shared/Message.tsx | 6 +- .../src/shared/MessageSignature.tsx | 6 +- .../page-contracts/src/shared/Messages.tsx | 12 +- packages/page-contracts/src/shared/Params.tsx | 6 +- packages/page-contracts/src/store.ts | 7 +- packages/page-contracts/src/types.ts | 1 + packages/page-contracts/src/useAbi.ts | 4 +- packages/page-contracts/src/useWeight.ts | 5 +- packages/page-council/src/Motions/Close.tsx | 4 +- packages/page-council/src/Motions/Motion.tsx | 6 +- .../src/Motions/ProposeExternal.tsx | 4 +- .../src/Motions/ProposeMotion.tsx | 4 +- .../page-council/src/Motions/Slashing.tsx | 4 +- packages/page-council/src/Motions/Voters.tsx | 4 +- packages/page-council/src/Motions/Voting.tsx | 4 +- packages/page-council/src/Motions/index.tsx | 6 +- .../page-council/src/Overview/Candidate.tsx | 4 +- .../page-council/src/Overview/Candidates.tsx | 4 +- .../page-council/src/Overview/Members.tsx | 4 +- .../src/Overview/SubmitCandidacy.tsx | 4 +- .../page-council/src/Overview/Summary.tsx | 8 +- packages/page-council/src/Overview/Vote.tsx | 4 +- packages/page-council/src/Overview/Voters.tsx | 4 +- packages/page-council/src/Overview/index.tsx | 4 +- packages/page-council/src/Overview/types.ts | 6 +- packages/page-council/src/index.tsx | 12 +- packages/page-council/src/useCounter.ts | 1 - .../src/Execute/DispatchEntry.tsx | 6 +- .../src/Execute/DispatchQueue.tsx | 4 +- .../page-democracy/src/Execute/Scheduled.tsx | 7 +- .../page-democracy/src/Execute/Scheduler.tsx | 6 +- packages/page-democracy/src/Execute/index.tsx | 1 + .../page-democracy/src/Overview/External.tsx | 6 +- .../src/Overview/ExternalCell.tsx | 6 +- .../page-democracy/src/Overview/Externals.tsx | 4 +- .../page-democracy/src/Overview/Fasttrack.tsx | 6 +- .../page-democracy/src/Overview/PreImage.tsx | 8 +- .../src/Overview/PreImageButton.tsx | 4 +- .../page-democracy/src/Overview/Proposal.tsx | 4 +- .../src/Overview/ProposalCell.tsx | 4 +- .../page-democracy/src/Overview/Proposals.tsx | 6 +- .../page-democracy/src/Overview/Propose.tsx | 1 + .../src/Overview/Referendum.tsx | 6 +- .../src/Overview/ReferendumVote.tsx | 4 +- .../src/Overview/ReferendumVotes.tsx | 4 +- .../src/Overview/Referendums.tsx | 6 +- .../page-democracy/src/Overview/Seconding.tsx | 6 +- .../page-democracy/src/Overview/Summary.tsx | 3 +- .../src/Overview/TreasuryCell.tsx | 4 +- .../page-democracy/src/Overview/Voting.tsx | 4 +- .../page-democracy/src/Overview/index.tsx | 8 +- packages/page-democracy/src/index.tsx | 3 +- packages/page-democracy/src/useChangeCalc.ts | 4 +- packages/page-democracy/src/useCounter.ts | 3 +- packages/page-democracy/src/util.spec.ts | 3 +- packages/page-democracy/src/util.ts | 6 +- packages/page-explorer/src/BestHash.tsx | 4 +- packages/page-explorer/src/BlockHeader.tsx | 1 + packages/page-explorer/src/BlockHeaders.tsx | 1 + .../page-explorer/src/BlockInfo/ByHash.tsx | 8 +- .../page-explorer/src/BlockInfo/ByNumber.tsx | 4 +- .../page-explorer/src/BlockInfo/Extrinsic.tsx | 8 +- .../src/BlockInfo/Extrinsics.tsx | 6 +- packages/page-explorer/src/BlockInfo/Logs.tsx | 8 +- .../page-explorer/src/BlockInfo/index.tsx | 4 +- packages/page-explorer/src/Event.tsx | 4 +- packages/page-explorer/src/Events.tsx | 4 +- packages/page-explorer/src/Forks.tsx | 6 +- packages/page-explorer/src/Main.tsx | 4 +- packages/page-explorer/src/NodeInfo/Peers.tsx | 6 +- .../page-explorer/src/NodeInfo/Summary.tsx | 6 +- packages/page-explorer/src/NodeInfo/index.tsx | 4 +- packages/page-explorer/src/Query.tsx | 1 + packages/page-explorer/src/Summary.tsx | 3 +- packages/page-explorer/src/SummarySession.tsx | 4 +- packages/page-explorer/src/index.tsx | 4 +- packages/page-extrinsics/src/Balance.tsx | 4 +- packages/page-extrinsics/src/Selection.tsx | 4 +- packages/page-extrinsics/src/index.tsx | 4 +- packages/page-generic-asset/src/AssetCard.tsx | 3 +- packages/page-generic-asset/src/AssetRow.tsx | 1 + packages/page-generic-asset/src/Assets.tsx | 10 +- packages/page-generic-asset/src/Transfer.tsx | 8 +- packages/page-generic-asset/src/index.tsx | 4 +- .../page-generic-asset/src/modals/Create.tsx | 1 + packages/page-js/src/ActionButtons.tsx | 1 + packages/page-js/src/Output.tsx | 7 +- packages/page-js/src/Playground.tsx | 21 +- packages/page-js/src/index.tsx | 4 +- packages/page-js/src/snippets/index.ts | 3 +- packages/page-js/src/types.ts | 2 +- .../src/Overview/Parachain.tsx | 10 +- .../src/Overview/Parachains.tsx | 4 +- .../page-parachains/src/Overview/Proposal.tsx | 7 +- .../src/Overview/Proposals.tsx | 4 +- .../page-parachains/src/Overview/Register.tsx | 7 +- .../page-parachains/src/Overview/Summary.tsx | 3 +- .../page-parachains/src/Overview/index.tsx | 10 +- .../page-parachains/src/Overview/types.ts | 2 +- .../src/Parachain/Deregister.tsx | 7 +- .../page-parachains/src/Parachain/Details.tsx | 6 +- .../src/Parachain/DispatchQueue.tsx | 4 +- .../page-parachains/src/Parachain/index.tsx | 11 +- .../page-parachains/src/ParachainInfo.tsx | 4 +- packages/page-parachains/src/Transfer.tsx | 6 +- packages/page-parachains/src/index.tsx | 4 +- packages/page-parachains/src/util.ts | 1 + packages/page-poll/src/index.tsx | 8 +- packages/page-rpc/src/Rpc/Account.tsx | 1 + packages/page-rpc/src/Rpc/Results.tsx | 4 +- packages/page-rpc/src/Rpc/Selection.tsx | 10 +- packages/page-rpc/src/Rpc/index.tsx | 1 + packages/page-rpc/src/index.tsx | 4 +- packages/page-settings/src/Developer.tsx | 4 +- packages/page-settings/src/General.tsx | 4 +- .../page-settings/src/I18n/StringInput.tsx | 1 + packages/page-settings/src/I18n/index.tsx | 1 + .../page-settings/src/Metadata/Extensions.tsx | 4 +- .../src/Metadata/NetworkSpecs.tsx | 6 +- packages/page-settings/src/Metadata/index.tsx | 1 + packages/page-settings/src/index.tsx | 12 +- packages/page-settings/src/useChainInfo.ts | 6 +- packages/page-settings/src/useExtensions.ts | 4 +- packages/page-settings/src/util.tsx | 4 +- packages/page-signing/src/Hash.tsx | 1 + packages/page-signing/src/Sign.tsx | 6 +- packages/page-signing/src/Unlock.tsx | 4 +- packages/page-signing/src/Verify.tsx | 4 +- packages/page-signing/src/index.tsx | 6 +- packages/page-society/src/Overview/Bid.tsx | 4 +- packages/page-society/src/Overview/BidNew.tsx | 1 + packages/page-society/src/Overview/Bids.tsx | 4 +- .../page-society/src/Overview/Candidate.tsx | 6 +- .../src/Overview/CandidateVoting.tsx | 3 +- .../page-society/src/Overview/Candidates.tsx | 4 +- .../page-society/src/Overview/Defender.tsx | 6 +- .../src/Overview/DefenderVoting.tsx | 3 +- packages/page-society/src/Overview/Member.tsx | 4 +- .../page-society/src/Overview/Members.tsx | 4 +- .../page-society/src/Overview/Summary.tsx | 8 +- packages/page-society/src/Overview/Votes.tsx | 3 +- .../src/Overview/VotesExpander.tsx | 5 +- packages/page-society/src/Overview/index.tsx | 7 +- packages/page-society/src/index.tsx | 1 + packages/page-society/src/useCounter.ts | 1 - packages/page-society/src/useMembers.ts | 7 +- .../src/Actions/Account/BondExtra.tsx | 6 +- .../src/Actions/Account/InjectKeys.tsx | 4 +- .../Actions/Account/InputValidateAmount.tsx | 6 +- .../Account/InputValidationController.tsx | 4 +- .../Account/InputValidationSessionKey.tsx | 4 +- .../src/Actions/Account/ListNominees.tsx | 4 +- .../src/Actions/Account/Nominate.tsx | 6 +- .../Actions/Account/SetControllerAccount.tsx | 1 + .../Actions/Account/SetRewardDestination.tsx | 6 +- .../src/Actions/Account/SetSessionKey.tsx | 4 +- .../src/Actions/Account/Unbond.tsx | 4 +- .../src/Actions/Account/Validate.tsx | 4 +- .../src/Actions/Account/index.tsx | 14 +- .../page-staking/src/Actions/NewNominator.tsx | 6 +- .../page-staking/src/Actions/NewStash.tsx | 4 +- .../page-staking/src/Actions/NewValidator.tsx | 4 +- packages/page-staking/src/Actions/index.tsx | 6 +- .../src/Actions/partials/Bond.tsx | 10 +- .../src/Actions/partials/Nominate.tsx | 6 +- .../src/Actions/partials/SessionKey.tsx | 6 +- .../src/Actions/partials/Validate.tsx | 6 +- packages/page-staking/src/Actions/types.ts | 4 +- .../page-staking/src/Actions/useInactives.ts | 4 +- .../src/Actions/useUnbondDuration.ts | 4 +- packages/page-staking/src/Filtering.tsx | 1 + packages/page-staking/src/Legend.tsx | 1 + packages/page-staking/src/MaxBadge.tsx | 1 + .../src/Overview/Address/Favorite.tsx | 1 + .../src/Overview/Address/NominatedBy.tsx | 6 +- .../src/Overview/Address/StakeOther.tsx | 5 +- .../src/Overview/Address/Status.tsx | 1 + .../src/Overview/Address/index.tsx | 12 +- .../page-staking/src/Overview/CurrentList.tsx | 10 +- .../page-staking/src/Overview/Summary.tsx | 4 +- packages/page-staking/src/Overview/index.tsx | 6 +- .../page-staking/src/Payouts/PayButton.tsx | 12 +- packages/page-staking/src/Payouts/Stash.tsx | 10 +- .../page-staking/src/Payouts/Validator.tsx | 6 +- packages/page-staking/src/Payouts/index.tsx | 10 +- packages/page-staking/src/Payouts/types.ts | 4 +- .../page-staking/src/Payouts/useEraBlocks.ts | 6 +- .../src/Payouts/useStakerPayouts.ts | 6 +- packages/page-staking/src/Payouts/util.tsx | 3 +- .../page-staking/src/Query/ChartPoints.tsx | 6 +- .../page-staking/src/Query/ChartPrefs.tsx | 6 +- .../page-staking/src/Query/ChartRewards.tsx | 6 +- .../page-staking/src/Query/ChartStake.tsx | 6 +- packages/page-staking/src/Query/Validator.tsx | 4 +- packages/page-staking/src/Query/index.tsx | 1 + .../page-staking/src/Query/useBlockCounts.tsx | 7 +- packages/page-staking/src/Query/util.ts | 1 + packages/page-staking/src/Slashes/Era.tsx | 6 +- packages/page-staking/src/Slashes/Row.tsx | 4 +- packages/page-staking/src/Slashes/Summary.tsx | 6 +- packages/page-staking/src/Slashes/index.tsx | 8 +- packages/page-staking/src/Slashes/types.ts | 4 +- .../page-staking/src/Targets/Nominate.tsx | 4 +- packages/page-staking/src/Targets/Summary.tsx | 3 +- .../page-staking/src/Targets/Validator.tsx | 10 +- packages/page-staking/src/Targets/index.tsx | 12 +- .../src/Targets/useOwnNominators.ts | 4 +- packages/page-staking/src/index.tsx | 14 +- packages/page-staking/src/types.ts | 6 +- packages/page-staking/src/useNominations.ts | 7 +- packages/page-staking/src/useSortedTargets.ts | 9 +- packages/page-storage/src/Queries.tsx | 3 +- packages/page-storage/src/Query.tsx | 17 +- .../page-storage/src/Selection/Consts.tsx | 6 +- .../page-storage/src/Selection/Modules.tsx | 8 +- packages/page-storage/src/Selection/Raw.tsx | 8 +- packages/page-storage/src/Selection/index.tsx | 6 +- packages/page-storage/src/index.tsx | 6 +- packages/page-sudo/src/SetKey.tsx | 4 +- packages/page-sudo/src/Sudo.tsx | 6 +- packages/page-sudo/src/index.tsx | 5 +- .../page-tech-comm/src/Overview/Members.tsx | 4 +- .../page-tech-comm/src/Overview/Summary.tsx | 8 +- .../page-tech-comm/src/Overview/index.tsx | 3 +- .../page-tech-comm/src/Proposals/Close.tsx | 4 +- .../page-tech-comm/src/Proposals/Proposal.tsx | 6 +- .../page-tech-comm/src/Proposals/Propose.tsx | 4 +- .../page-tech-comm/src/Proposals/Voting.tsx | 4 +- .../page-tech-comm/src/Proposals/index.tsx | 6 +- packages/page-tech-comm/src/index.tsx | 8 +- packages/page-tech-comm/src/useCounter.ts | 1 - .../page-treasury/src/Overview/Council.tsx | 4 +- .../page-treasury/src/Overview/Proposal.tsx | 4 +- .../src/Overview/ProposalCreate.tsx | 1 + .../page-treasury/src/Overview/Proposals.tsx | 6 +- .../page-treasury/src/Overview/Summary.tsx | 8 +- packages/page-treasury/src/Overview/index.tsx | 4 +- packages/page-treasury/src/Tips/Tip.tsx | 6 +- packages/page-treasury/src/Tips/TipCreate.tsx | 1 + .../page-treasury/src/Tips/TipEndorse.tsx | 1 + packages/page-treasury/src/Tips/TipReason.tsx | 6 +- packages/page-treasury/src/Tips/Tips.tsx | 6 +- packages/page-treasury/src/Tips/index.tsx | 4 +- packages/page-treasury/src/index.tsx | 2 +- packages/page-treasury/src/useCounter.ts | 4 +- packages/react-api/src/Api.tsx | 18 +- packages/react-api/src/ApiContext.ts | 4 +- packages/react-api/src/hoc/api.tsx | 6 +- packages/react-api/src/hoc/call.tsx | 8 +- packages/react-api/src/hoc/callDiv.tsx | 5 +- packages/react-api/src/hoc/calls.ts | 4 +- packages/react-api/src/hoc/observable.tsx | 5 +- packages/react-api/src/hoc/onlyOn.tsx | 4 +- packages/react-api/src/hoc/types.ts | 4 +- packages/react-api/src/index.ts | 4 +- packages/react-api/src/types.ts | 3 +- .../react-api/src/util/intervalObservable.ts | 4 +- packages/react-api/src/util/triggerChange.ts | 4 +- .../react-components/src/AccountIndex.tsx | 6 +- packages/react-components/src/AccountName.tsx | 12 +- packages/react-components/src/ActionItem.tsx | 4 +- packages/react-components/src/AddressInfo.tsx | 14 +- packages/react-components/src/AddressMini.tsx | 8 +- packages/react-components/src/AddressRow.tsx | 6 +- .../react-components/src/AddressSmall.tsx | 4 +- .../react-components/src/AddressToggle.tsx | 4 +- packages/react-components/src/Available.tsx | 4 +- packages/react-components/src/Badge.tsx | 1 - packages/react-components/src/Balance.tsx | 4 +- packages/react-components/src/Bonded.tsx | 4 +- .../react-components/src/Button/Button.tsx | 5 +- .../react-components/src/Button/Group.tsx | 4 +- .../react-components/src/Button/index.tsx | 1 - packages/react-components/src/Button/types.ts | 1 + packages/react-components/src/Call.tsx | 6 +- .../react-components/src/CallExpander.tsx | 4 +- packages/react-components/src/CardGrid.tsx | 1 - packages/react-components/src/CardSummary.tsx | 10 +- packages/react-components/src/ChainImg.tsx | 1 + packages/react-components/src/ChainLock.tsx | 3 +- packages/react-components/src/Chart/Base.tsx | 4 +- .../react-components/src/Chart/Doughnut.tsx | 4 +- .../react-components/src/Chart/HorizBar.tsx | 7 +- packages/react-components/src/Chart/Line.tsx | 6 +- packages/react-components/src/Checkbox.tsx | 3 +- packages/react-components/src/Collection.tsx | 4 +- packages/react-components/src/Column.tsx | 1 - .../src/ConvictionDropdown.tsx | 3 +- packages/react-components/src/CopyButton.tsx | 9 +- packages/react-components/src/CryptoType.tsx | 4 +- .../react-components/src/DemocracyLocks.tsx | 8 +- packages/react-components/src/Dropdown.tsx | 3 +- packages/react-components/src/EditButton.tsx | 5 +- .../react-components/src/ErrorBoundary.tsx | 3 +- packages/react-components/src/Event.tsx | 4 +- packages/react-components/src/Expander.tsx | 6 +- packages/react-components/src/Extrinsic.tsx | 6 +- packages/react-components/src/Forget.tsx | 1 + packages/react-components/src/HelpOverlay.tsx | 4 +- packages/react-components/src/Icon.tsx | 3 +- .../RoboHash/backgrounds/index.ts | 20 +- .../src/IdentityIcon/RoboHash/index.tsx | 4 +- .../src/IdentityIcon/RoboHash/sets/index.ts | 960 +++++++++--------- .../src/IdentityIcon/index.tsx | 4 +- packages/react-components/src/Input.tsx | 4 +- .../src/InputAddress/KeyPair.tsx | 4 +- .../src/InputAddress/createHeader.tsx | 4 +- .../src/InputAddress/createItem.tsx | 6 +- .../src/InputAddress/index.tsx | 8 +- .../src/InputAddress/types.ts | 4 +- .../src/InputAddressMulti/SelectedDrag.tsx | 2 +- .../src/InputAddressMulti/index.tsx | 3 +- .../src/InputAddressSimple.tsx | 2 +- .../react-components/src/InputBalance.tsx | 4 +- .../src/InputConsts/SelectKey.tsx | 5 +- .../src/InputConsts/SelectSection.tsx | 5 +- .../src/InputConsts/index.tsx | 12 +- .../src/InputConsts/options/key.tsx | 7 +- .../src/InputConsts/options/section.ts | 4 +- .../src/InputExtrinsic/SelectMethod.tsx | 6 +- .../src/InputExtrinsic/SelectSection.tsx | 6 +- .../src/InputExtrinsic/index.tsx | 10 +- .../src/InputExtrinsic/options/method.tsx | 5 +- .../src/InputExtrinsic/options/section.ts | 4 +- packages/react-components/src/InputFile.tsx | 8 +- packages/react-components/src/InputNumber.tsx | 10 +- .../src/InputRpc/SelectMethod.tsx | 6 +- .../src/InputRpc/SelectSection.tsx | 6 +- .../react-components/src/InputRpc/index.tsx | 10 +- .../src/InputRpc/options/method.tsx | 6 +- .../src/InputRpc/options/section.ts | 4 +- .../react-components/src/InputRpc/rpcs.ts | 1 - .../src/InputStorage/SelectKey.tsx | 6 +- .../src/InputStorage/SelectSection.tsx | 6 +- .../src/InputStorage/index.tsx | 10 +- .../src/InputStorage/options/key.tsx | 7 +- .../src/InputStorage/options/section.ts | 4 +- packages/react-components/src/InputWasm.tsx | 1 + packages/react-components/src/Inset.tsx | 1 + .../react-components/src/LinkExternal.tsx | 4 +- packages/react-components/src/LockedVote.tsx | 4 +- packages/react-components/src/Menu.tsx | 2 +- .../react-components/src/Modal/Actions.tsx | 3 +- .../react-components/src/Modal/Column.tsx | 4 +- .../react-components/src/Modal/Columns.tsx | 4 +- packages/react-components/src/Modal/index.tsx | 8 +- packages/react-components/src/Nonce.tsx | 4 +- packages/react-components/src/Params/Call.tsx | 4 +- .../react-components/src/Params/Extrinsic.tsx | 4 +- .../src/Params/OpaqueCall.tsx | 4 +- .../react-components/src/Params/Proposal.tsx | 4 +- .../react-components/src/PasswordStrength.tsx | 5 +- packages/react-components/src/Progress.tsx | 7 +- .../react-components/src/ProposedAction.tsx | 4 +- packages/react-components/src/Row.tsx | 1 + packages/react-components/src/Sidebar.tsx | 3 +- packages/react-components/src/Spinner.tsx | 2 +- .../react-components/src/StakingBonded.tsx | 4 +- .../src/StakingRedeemable.tsx | 6 +- .../react-components/src/StakingUnbonding.tsx | 4 +- .../react-components/src/Status/Context.ts | 4 +- .../react-components/src/Status/Queue.tsx | 8 +- .../react-components/src/Status/index.tsx | 7 +- packages/react-components/src/Table/Body.tsx | 4 +- packages/react-components/src/Table/Foot.tsx | 4 +- packages/react-components/src/Table/Head.tsx | 4 +- packages/react-components/src/Tabs/Tab.tsx | 5 +- packages/react-components/src/Tabs/index.tsx | 5 +- packages/react-components/src/Tags.tsx | 4 +- packages/react-components/src/TextArea.tsx | 3 +- packages/react-components/src/Toggle.tsx | 4 +- packages/react-components/src/ToggleGroup.tsx | 1 + .../react-components/src/TreasuryProposal.tsx | 4 +- packages/react-components/src/TxButton.tsx | 6 +- packages/react-components/src/TxModal.tsx | 4 +- packages/react-components/src/TxModalNew.tsx | 4 +- packages/react-components/src/VoteValue.tsx | 4 +- packages/react-components/src/i18n/index.ts | 1 + packages/react-components/src/styles/index.ts | 3 +- packages/react-components/src/types.ts | 6 +- .../src/util/checkVisibility.tsx | 1 - .../src/util/getAddressMeta.ts | 1 - .../src/util/getContractAbi.ts | 1 - .../react-components/src/util/toAddress.ts | 2 +- packages/react-hooks/src/types.ts | 2 +- packages/react-hooks/src/useAccountId.ts | 4 +- packages/react-hooks/src/useAccountInfo.ts | 6 +- packages/react-hooks/src/useAccounts.ts | 1 + packages/react-hooks/src/useAddresses.ts | 1 + packages/react-hooks/src/useApi.ts | 4 +- .../react-hooks/src/useAvailableSlashes.ts | 6 +- packages/react-hooks/src/useBlockTime.ts | 4 +- packages/react-hooks/src/useBlocksPerDays.ts | 1 + packages/react-hooks/src/useCacheKey.ts | 2 +- packages/react-hooks/src/useCall.ts | 10 +- packages/react-hooks/src/useContracts.ts | 1 + packages/react-hooks/src/useDebounce.ts | 2 +- packages/react-hooks/src/useFormField.ts | 1 + packages/react-hooks/src/useIncrement.ts | 1 + packages/react-hooks/src/useInflation.ts | 6 +- packages/react-hooks/src/useLoadingDelay.ts | 1 + packages/react-hooks/src/useMembers.ts | 4 +- packages/react-hooks/src/useModal.ts | 3 +- packages/react-hooks/src/useNonEmptyString.ts | 2 +- packages/react-hooks/src/useNonZeroBn.ts | 4 +- packages/react-hooks/src/useOwnEraRewards.ts | 6 +- packages/react-hooks/src/useOwnStashInfos.ts | 6 +- packages/react-hooks/src/useOwnStashes.ts | 4 +- packages/react-hooks/src/usePassword.ts | 1 + packages/react-hooks/src/useRegistrars.ts | 4 +- packages/react-hooks/src/useSudo.ts | 6 +- packages/react-hooks/src/useVotingStatus.ts | 4 +- packages/react-hooks/src/useWeight.ts | 4 +- packages/react-params/src/Holder.tsx | 4 +- packages/react-params/src/Param/Account.tsx | 4 +- packages/react-params/src/Param/Amount.tsx | 4 +- packages/react-params/src/Param/Balance.tsx | 4 +- packages/react-params/src/Param/Base.tsx | 4 +- packages/react-params/src/Param/BaseBytes.tsx | 6 +- packages/react-params/src/Param/Bool.tsx | 4 +- packages/react-params/src/Param/Bytes.tsx | 4 +- packages/react-params/src/Param/Call.tsx | 6 +- packages/react-params/src/Param/Code.tsx | 4 +- .../react-params/src/Param/DispatchError.tsx | 6 +- packages/react-params/src/Param/Enum.tsx | 6 +- packages/react-params/src/Param/File.tsx | 1 + packages/react-params/src/Param/Hash160.tsx | 3 +- packages/react-params/src/Param/Hash256.tsx | 3 +- packages/react-params/src/Param/Hash512.tsx | 3 +- packages/react-params/src/Param/KeyValue.tsx | 4 +- .../react-params/src/Param/KeyValueArray.tsx | 6 +- packages/react-params/src/Param/Moment.tsx | 4 +- packages/react-params/src/Param/Null.tsx | 4 +- .../react-params/src/Param/OpaqueCall.tsx | 6 +- packages/react-params/src/Param/Option.tsx | 6 +- packages/react-params/src/Param/Raw.tsx | 6 +- packages/react-params/src/Param/Static.tsx | 6 +- packages/react-params/src/Param/Struct.tsx | 3 +- packages/react-params/src/Param/Text.tsx | 4 +- packages/react-params/src/Param/Tuple.tsx | 3 +- packages/react-params/src/Param/Unknown.tsx | 3 +- packages/react-params/src/Param/Vector.tsx | 8 +- .../react-params/src/Param/VectorFixed.tsx | 6 +- packages/react-params/src/Param/Vote.tsx | 4 +- .../react-params/src/Param/VoteThreshold.tsx | 4 +- .../react-params/src/Param/findComponent.ts | 5 +- packages/react-params/src/Param/index.tsx | 4 +- .../react-params/src/Param/useParamDefs.ts | 7 +- packages/react-params/src/ParamComp.tsx | 6 +- packages/react-params/src/index.tsx | 8 +- packages/react-params/src/initValue.ts | 1 - packages/react-params/src/valueToText.tsx | 4 +- packages/react-params/src/values.ts | 3 +- packages/react-query/src/Available.tsx | 4 +- packages/react-query/src/Balance.tsx | 4 +- packages/react-query/src/BalanceFree.tsx | 4 +- packages/react-query/src/BalanceVoting.tsx | 4 +- packages/react-query/src/BestFinalized.tsx | 4 +- packages/react-query/src/BestNumber.tsx | 4 +- packages/react-query/src/BlockAuthors.tsx | 4 +- packages/react-query/src/BlockToTime.tsx | 1 + packages/react-query/src/Bonded.tsx | 4 +- packages/react-query/src/Chain.tsx | 1 + packages/react-query/src/Elapsed.tsx | 1 + packages/react-query/src/Events.tsx | 5 +- packages/react-query/src/FormatBalance.tsx | 6 +- packages/react-query/src/LockedVote.tsx | 4 +- packages/react-query/src/NodeName.tsx | 1 + packages/react-query/src/NodeVersion.tsx | 1 + packages/react-query/src/Nonce.tsx | 4 +- packages/react-query/src/TimeNow.tsx | 4 +- packages/react-query/src/TotalIssuance.tsx | 2 + packages/react-signer/src/Address.tsx | 8 +- packages/react-signer/src/Password.tsx | 4 +- packages/react-signer/src/PaymentInfo.tsx | 8 +- packages/react-signer/src/Qr.tsx | 1 + packages/react-signer/src/SignFields.tsx | 4 +- packages/react-signer/src/Tip.tsx | 1 + packages/react-signer/src/Transaction.tsx | 6 +- packages/react-signer/src/TxSigned.tsx | 16 +- packages/react-signer/src/TxUnsigned.tsx | 6 +- packages/react-signer/src/index.tsx | 6 +- .../react-signer/src/signers/AccountSigner.ts | 1 - .../react-signer/src/signers/ApiSigner.ts | 5 +- .../react-signer/src/signers/LedgerSigner.ts | 1 - packages/react-signer/src/signers/QrSigner.ts | 4 +- packages/react-signer/src/util.ts | 4 +- ...lint-plugin-simple-import-sort+6.0.1.patch | 22 + yarn.lock | 89 ++ 641 files changed, 2190 insertions(+), 1977 deletions(-) create mode 100644 patches/eslint-plugin-simple-import-sort+6.0.1.patch diff --git a/.eslintrc.js b/.eslintrc.js index 1c4b430cbc..291486a1e3 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -6,6 +6,7 @@ const base = require('@polkadot/dev/config/eslint.cjs'); // add override for any (a metric ton of them, initial conversion) module.exports = { ...base, + plugins: [...base.plugins, 'simple-import-sort'], ignorePatterns: [ '.eslintrc.js', '.github/**', @@ -26,6 +27,16 @@ module.exports = { // needs to be switched on at some point '@typescript-eslint/no-explicit-any': 'off', // this seems very broken atm, false positives - '@typescript-eslint/unbound-method': 'off' + '@typescript-eslint/unbound-method': 'off', + 'simple-import-sort/imports': [ + 'error', + { + groups: [ + ['^[^\/\\.]'], + ['^@polkadot'], + ['^\\.'] + ], + }, + ] } }; diff --git a/jest/globalSetup.ts b/jest/globalSetup.ts index 50cd8d4824..726c22b5d0 100644 --- a/jest/globalSetup.ts +++ b/jest/globalSetup.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { GenericContainer, Wait } from 'testcontainers'; + import { SubstrateTestsGlobal } from './substrateTestsGlobal'; declare const global: SubstrateTestsGlobal; diff --git a/package.json b/package.json index 02f7f0e490..6cf364a619 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "lint:css": "stylelint './packages/**/src/**/*.tsx'", "postinstall": "polkadot-dev-yarn-only", "postinstall:electron": "electron-builder install-app-deps", + "prepare": "patch-package", "test": "polkadot-dev-run-test --selectProjects=fast-tests --silent --testPathIgnorePatterns slow --testNamePattern='^((?!--SLOW--).)*$'", "test:all": "polkadot-dev-run-test --selectProjects=all-tests --silent", "test:one": "polkadot-dev-run-test", @@ -84,7 +85,10 @@ "electron": "^10.1.6", "electron-builder": "^22.9.1", "electron-builder-notarize": "^1.2.0", + "eslint-plugin-simple-import-sort": "^6.0.1", "i18next-scanner": "^2.11.0", + "patch-package": "^6.2.2", + "postinstall-prepare": "^1.0.1", "react": "^17.0.1", "react-dom": "^17.0.1", "react-is": "^17.0.1", diff --git a/packages/apps-config/src/api/bundle/spec/acala.ts b/packages/apps-config/src/api/bundle/spec/acala.ts index 8145d31c10..dcb2fe9b29 100644 --- a/packages/apps-config/src/api/bundle/spec/acala.ts +++ b/packages/apps-config/src/api/bundle/spec/acala.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/apps-config authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { OverrideBundleDefinition } from '@polkadot/types/types'; - import { typesBundleForPolkadot } from '@acala-network/type-definitions'; +import type { OverrideBundleDefinition } from '@polkadot/types/types'; + export default typesBundleForPolkadot.spec.acala as OverrideBundleDefinition; diff --git a/packages/apps-config/src/api/bundle/spec/laminar.ts b/packages/apps-config/src/api/bundle/spec/laminar.ts index 33e4722f32..bce5619f80 100644 --- a/packages/apps-config/src/api/bundle/spec/laminar.ts +++ b/packages/apps-config/src/api/bundle/spec/laminar.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/apps-config authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { OverrideBundleDefinition } from '@polkadot/types/types'; - import { typesBundleForPolkadot } from '@laminar/type-definitions'; +import type { OverrideBundleDefinition } from '@polkadot/types/types'; + export default typesBundleForPolkadot.spec.acala as OverrideBundleDefinition; diff --git a/packages/apps-config/src/api/bundle/spec/soraSubstrate.ts b/packages/apps-config/src/api/bundle/spec/soraSubstrate.ts index 94b1171e2d..b614505ac1 100644 --- a/packages/apps-config/src/api/bundle/spec/soraSubstrate.ts +++ b/packages/apps-config/src/api/bundle/spec/soraSubstrate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { slimOverrideBundle } from '@sora-substrate/type-definitions'; + import { OverrideBundleDefinition } from '@polkadot/types/types'; export default slimOverrideBundle.spec.sora as OverrideBundleDefinition; diff --git a/packages/apps-config/src/api/constants.ts b/packages/apps-config/src/api/constants.ts index bbf8168763..0e9d2b6e9b 100644 --- a/packages/apps-config/src/api/constants.ts +++ b/packages/apps-config/src/api/constants.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import BN from 'bn.js'; + import networks from '@polkadot/networks'; import { assert } from '@polkadot/util'; diff --git a/packages/apps-config/src/api/params/inflation.ts b/packages/apps-config/src/api/params/inflation.ts index 8cf649e328..76ccae5992 100644 --- a/packages/apps-config/src/api/params/inflation.ts +++ b/packages/apps-config/src/api/params/inflation.ts @@ -3,7 +3,7 @@ import type { ApiPromise } from '@polkadot/api'; -import { POLKADOT_GENESIS, KUSAMA_GENESIS } from '../constants'; +import { KUSAMA_GENESIS, POLKADOT_GENESIS } from '../constants'; interface InflationParams { falloff: number; diff --git a/packages/apps-config/src/api/params/proposalThresholds.ts b/packages/apps-config/src/api/params/proposalThresholds.ts index 2ce8fa36f9..af40d15cbf 100644 --- a/packages/apps-config/src/api/params/proposalThresholds.ts +++ b/packages/apps-config/src/api/params/proposalThresholds.ts @@ -3,7 +3,7 @@ import type { ApiPromise } from '@polkadot/api'; -import { POLKADOT_GENESIS, KULUPU_GENESIS, KUSAMA_GENESIS } from '../constants'; +import { KULUPU_GENESIS, KUSAMA_GENESIS, POLKADOT_GENESIS } from '../constants'; const PROPOSE_THRESHOLDS: Record = { [KULUPU_GENESIS]: 1, diff --git a/packages/apps-config/src/api/rpc/soraSubstrate.ts b/packages/apps-config/src/api/rpc/soraSubstrate.ts index b08c1d5aed..cf6505eec3 100644 --- a/packages/apps-config/src/api/rpc/soraSubstrate.ts +++ b/packages/apps-config/src/api/rpc/soraSubstrate.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { rpc } from '@sora-substrate/type-definitions'; + import { DefinitionRpc } from '@polkadot/types/types'; export default rpc as Record>; diff --git a/packages/apps-config/src/api/spec/index.ts b/packages/apps-config/src/api/spec/index.ts index c69af66e0f..5b2d3a19bd 100644 --- a/packages/apps-config/src/api/spec/index.ts +++ b/packages/apps-config/src/api/spec/index.ts @@ -6,10 +6,11 @@ import canvas from './canvas'; import centrifugeChain from './centrifuge-chain'; import crab from './crab'; import crust from './crust'; +import testPara from './cumulus-test-parachain'; import darwinia from './darwinia'; import darwiniaParachain from './darwinia-parachain'; import dock from './dock'; -import testPara from './cumulus-test-parachain'; +import dusty from './dusty'; import edgeware from './edgeware'; import encointerNodeNotee from './encointer-node-notee'; import encointerNodeTeeproxy from './encointer-node-teeproxy'; @@ -21,7 +22,6 @@ import moonbeam from './moonbeam'; import nodeTemplate from './node-template'; import nodle from './nodle'; import plasm from './plasm'; -import dusty from './dusty'; import robonomics from './robonomics'; import stablePoc from './stable-poc'; import stafi from './stafi'; diff --git a/packages/apps-config/src/links/index.ts b/packages/apps-config/src/links/index.ts index 94e1ca6f5d..1a9064d6f4 100644 --- a/packages/apps-config/src/links/index.ts +++ b/packages/apps-config/src/links/index.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import type { ExternalDef } from './types'; - import Commonwealth from './commonwealth'; import Polkascan from './polkascan'; import Polkassembly from './polkassembly'; diff --git a/packages/apps-config/src/settings/endpoints.ts b/packages/apps-config/src/settings/endpoints.ts index 59e29e39ba..b7d0188b60 100644 --- a/packages/apps-config/src/settings/endpoints.ts +++ b/packages/apps-config/src/settings/endpoints.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { LinkOption } from './types'; +import type { LinkOption } from './types'; import { CUSTOM_ENDPOINT_KEY } from './constants'; interface EnvWindow { diff --git a/packages/apps-config/src/settings/languages.ts b/packages/apps-config/src/settings/languages.ts index 66b93be6d7..409e720e52 100644 --- a/packages/apps-config/src/settings/languages.ts +++ b/packages/apps-config/src/settings/languages.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; + import type { Option } from './types'; export function createLanguages (t: TFunction): Option[] { diff --git a/packages/apps-config/src/settings/ss58.ts b/packages/apps-config/src/settings/ss58.ts index 73b8215bff..2a4b57d8db 100644 --- a/packages/apps-config/src/settings/ss58.ts +++ b/packages/apps-config/src/settings/ss58.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Option } from './types'; import known from '@polkadot/networks'; +import type { Option } from './types'; + // Definitions here are with the following values - // info: the name of a logo as defined in ../logos, specifically in namedLogos // text: The text you wish to display in the dropdown diff --git a/packages/apps-config/src/ui/logos/index.ts b/packages/apps-config/src/ui/logos/index.ts index 5827d696d8..fb51a4a966 100644 --- a/packages/apps-config/src/ui/logos/index.ts +++ b/packages/apps-config/src/ui/logos/index.ts @@ -8,11 +8,22 @@ // alphabetical import chainDusty from './chains/dusty.png'; import chainKusama from './chains/kusama-128.gif'; -import chainRococo from './chains/rococo.svg'; import chainRococoTick from './chains/rococo-tick.svg'; import chainRococoTrack from './chains/rococo-track.svg'; import chainRococoTrick from './chains/rococo-trick.svg'; - +import chainRococo from './chains/rococo.svg'; +// last-resort fallback, just something empty +import emptyLogo from './empty.svg'; +// extensions +// alphabetical +import extensionPolkadotJs from './extensions/polkadot-js.svg'; +// external links +// alphabetical +import externalCommonwealth from './external/commonwealth.png'; +import externalPolkascan from './external/polkascan.png'; +import externalPolkassembly from './external/polkassembly.png'; +import externalPolkastats from './external/polkastats.png'; +import externalSubscan from './external/subscan.svg'; // defaults for the node type, assuming we don't have a specific chain, but rather match on the implementation // alphabetical import nodeAcala from './nodes/acala-circle.svg'; @@ -28,37 +39,22 @@ import nodeEdgeware from './nodes/edgeware-circle.svg'; import nodeEncointerNotee from './nodes/encointer-notee.svg'; import nodeEncointerTeeproxy from './nodes/encointer-teeproxy.svg'; import nodeEquilibrium from './nodes/equilibrium.svg'; -import nodeNodle from './nodes/nodle.svg'; import nodeHanonycash from './nodes/hanonycash.svg'; import nodeKilt from './nodes/kilt.svg'; import nodeKulupu from './nodes/kulupu.svg'; import nodeLaminar from './nodes/laminar-circle.svg'; import moonbeam from './nodes/moonbeam.png'; +import nodeNodle from './nodes/nodle.svg'; import nodePhala from './nodes/phala.svg'; import nodePlasm from './nodes/plasm.png'; import nodePolkadot from './nodes/polkadot-circle.svg'; import nodePolkadotJs from './nodes/polkadot-js.svg'; -import nodeSora from './nodes/sora-substrate.svg'; import nodeRobonomics from './nodes/robonomics.svg'; +import nodeSora from './nodes/sora-substrate.svg'; import nodeStafi from './nodes/stafi.png'; import nodeSubsocial from './nodes/subsocial.svg'; import nodeSubstrate from './nodes/substrate-hexagon.svg'; -// extensions -// alphabetical -import extensionPolkadotJs from './extensions/polkadot-js.svg'; - -// external links -// alphabetical -import externalCommonwealth from './external/commonwealth.png'; -import externalPolkascan from './external/polkascan.png'; -import externalPolkassembly from './external/polkassembly.png'; -import externalPolkastats from './external/polkastats.png'; -import externalSubscan from './external/subscan.svg'; - -// last-resort fallback, just something empty -import emptyLogo from './empty.svg'; - // Alphabetical overrides based on the actual matched chain name // NOTE: This is as retrieved via system.chain RPC export const chainLogos: Record = [ diff --git a/packages/apps-electron/src/electron/index.ts b/packages/apps-electron/src/electron/index.ts index 51a464dc09..0358a0eac0 100644 --- a/packages/apps-electron/src/electron/index.ts +++ b/packages/apps-electron/src/electron/index.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { app, shell } from 'electron'; + import { registerAccountStoreHandlers } from '../main/account-store'; import { setupAutoUpdater } from './autoUpdater'; import { setupContentSecurityPolicy } from './contentSecurityPolicy'; diff --git a/packages/apps-electron/src/index.tsx b/packages/apps-electron/src/index.tsx index 63bd8a298e..9c0d7dcf01 100644 --- a/packages/apps-electron/src/index.tsx +++ b/packages/apps-electron/src/index.tsx @@ -5,9 +5,9 @@ import '@polkadot/apps/initSettings'; import 'semantic-ui-css/semantic.min.css'; import '@polkadot/react-components/i18n'; - import React from 'react'; import ReactDOM from 'react-dom'; + import Root from '@polkadot/apps/Root'; import { electronMainApi } from './api/global-exported-api'; diff --git a/packages/apps-electron/src/main/account-store.spec.ts b/packages/apps-electron/src/main/account-store.spec.ts index d82e104531..8144f88f74 100644 --- a/packages/apps-electron/src/main/account-store.spec.ts +++ b/packages/apps-electron/src/main/account-store.spec.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { KeyringJson } from '@polkadot/ui-keyring/types'; - import * as tmp from 'tmp'; + +import type { KeyringJson } from '@polkadot/ui-keyring/types'; import { FileStore } from '@polkadot/ui-keyring/stores'; import { accountStoreIpcHandler } from './account-store'; diff --git a/packages/apps-electron/src/main/account-store.ts b/packages/apps-electron/src/main/account-store.ts index 3c115bd184..32ac671d6d 100644 --- a/packages/apps-electron/src/main/account-store.ts +++ b/packages/apps-electron/src/main/account-store.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { KeyringJson } from '@polkadot/ui-keyring/types'; - import { app } from 'electron'; import path from 'path'; + +import type { KeyringJson } from '@polkadot/ui-keyring/types'; import { FileStore } from '@polkadot/ui-keyring/stores'; import { IpcMainHandler } from './ipc-main-handler'; diff --git a/packages/apps-electron/src/main/register-ipc-handler.ts b/packages/apps-electron/src/main/register-ipc-handler.ts index 9b164ca364..89e48c5b7e 100644 --- a/packages/apps-electron/src/main/register-ipc-handler.ts +++ b/packages/apps-electron/src/main/register-ipc-handler.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { ipcMain } from 'electron'; + import { IpcMainHandler } from './ipc-main-handler'; export const registerIpcHandler = (ipcHandler: IpcMainHandler): void => { diff --git a/packages/apps-electron/src/preload.ts b/packages/apps-electron/src/preload.ts index df48975c91..06da03cea4 100644 --- a/packages/apps-electron/src/preload.ts +++ b/packages/apps-electron/src/preload.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { KeyringJson } from '@polkadot/ui-keyring/types'; - import { contextBridge, ipcRenderer } from 'electron'; +import type { KeyringJson } from '@polkadot/ui-keyring/types'; + contextBridge.exposeInMainWorld('ElectronMain', { accountStore: { all: () => ipcRenderer.invoke('account-store-all'), diff --git a/packages/apps-routing/src/accounts.ts b/packages/apps-routing/src/accounts.ts index ca5c2b6cb2..ee9ddf6c0c 100644 --- a/packages/apps-routing/src/accounts.ts +++ b/packages/apps-routing/src/accounts.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Route } from './types'; import Component, { useCounter } from '@polkadot/app-accounts'; +import type { Route } from './types'; + export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/addresses.ts b/packages/apps-routing/src/addresses.ts index 2170db3253..1105ea120d 100644 --- a/packages/apps-routing/src/addresses.ts +++ b/packages/apps-routing/src/addresses.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Route } from './types'; import Component from '@polkadot/app-addresses'; +import type { Route } from './types'; + export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/calendar.ts b/packages/apps-routing/src/calendar.ts index f374f6e1ef..0ffaefc237 100644 --- a/packages/apps-routing/src/calendar.ts +++ b/packages/apps-routing/src/calendar.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Route } from './types'; import Component from '@polkadot/app-calendar'; +import type { Route } from './types'; + export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/claims.ts b/packages/apps-routing/src/claims.ts index 2b69bf6e40..9d86c2b412 100644 --- a/packages/apps-routing/src/claims.ts +++ b/packages/apps-routing/src/claims.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Route } from './types'; import Component, { useCounter } from '@polkadot/app-claims'; +import type { Route } from './types'; + export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/contracts.ts b/packages/apps-routing/src/contracts.ts index 09b8d23652..f542634e96 100644 --- a/packages/apps-routing/src/contracts.ts +++ b/packages/apps-routing/src/contracts.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Route } from './types'; import Component from '@polkadot/app-contracts'; +import type { Route } from './types'; + export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/council.ts b/packages/apps-routing/src/council.ts index ac70cf9d7c..0e7a5e9038 100644 --- a/packages/apps-routing/src/council.ts +++ b/packages/apps-routing/src/council.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Route } from './types'; import Component, { useCounter } from '@polkadot/app-council'; +import type { Route } from './types'; + export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/democracy.ts b/packages/apps-routing/src/democracy.ts index 8e1c35936e..01c16ab640 100644 --- a/packages/apps-routing/src/democracy.ts +++ b/packages/apps-routing/src/democracy.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Route } from './types'; import Component, { useCounter } from '@polkadot/app-democracy'; +import type { Route } from './types'; + export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/explorer.ts b/packages/apps-routing/src/explorer.ts index 656364ef22..ad1c8ebcd3 100644 --- a/packages/apps-routing/src/explorer.ts +++ b/packages/apps-routing/src/explorer.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Route } from './types'; import Component from '@polkadot/app-explorer'; +import type { Route } from './types'; + export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/extrinsics.ts b/packages/apps-routing/src/extrinsics.ts index e740f17962..d8e05933bf 100644 --- a/packages/apps-routing/src/extrinsics.ts +++ b/packages/apps-routing/src/extrinsics.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Route } from './types'; import Component from '@polkadot/app-extrinsics'; +import type { Route } from './types'; + export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/generic-asset.ts b/packages/apps-routing/src/generic-asset.ts index f32fc21670..37624d023e 100644 --- a/packages/apps-routing/src/generic-asset.ts +++ b/packages/apps-routing/src/generic-asset.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Route } from './types'; import Component from '@polkadot/app-generic-asset'; +import type { Route } from './types'; + export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/index.ts b/packages/apps-routing/src/index.ts index bd030bbdb8..3b8e31cd55 100644 --- a/packages/apps-routing/src/index.ts +++ b/packages/apps-routing/src/index.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Routes } from './types'; +import type { Routes } from './types'; import accounts from './accounts'; import addresses from './addresses'; import calendar from './calendar'; diff --git a/packages/apps-routing/src/js.ts b/packages/apps-routing/src/js.ts index bc9447a674..15707bb0f1 100644 --- a/packages/apps-routing/src/js.ts +++ b/packages/apps-routing/src/js.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Route } from './types'; import Component from '@polkadot/app-js'; +import type { Route } from './types'; + export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/parachains.ts b/packages/apps-routing/src/parachains.ts index 6811dd22d0..642d54e7af 100644 --- a/packages/apps-routing/src/parachains.ts +++ b/packages/apps-routing/src/parachains.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Route } from './types'; import Component from '@polkadot/app-parachains'; +import type { Route } from './types'; + export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/poll.ts b/packages/apps-routing/src/poll.ts index cdce254f32..001a5bd77d 100644 --- a/packages/apps-routing/src/poll.ts +++ b/packages/apps-routing/src/poll.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Route } from './types'; import Component from '@polkadot/app-poll'; +import type { Route } from './types'; + export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/rpc.ts b/packages/apps-routing/src/rpc.ts index 89d4f9721e..b27568efa8 100644 --- a/packages/apps-routing/src/rpc.ts +++ b/packages/apps-routing/src/rpc.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Route } from './types'; import Component from '@polkadot/app-rpc'; +import type { Route } from './types'; + export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/settings.ts b/packages/apps-routing/src/settings.ts index 44b0a7874d..f4a1be4937 100644 --- a/packages/apps-routing/src/settings.ts +++ b/packages/apps-routing/src/settings.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Route } from './types'; import Component, { useCounter } from '@polkadot/app-settings'; +import type { Route } from './types'; + export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/signing.ts b/packages/apps-routing/src/signing.ts index 9fe1162605..a99a8a3b01 100644 --- a/packages/apps-routing/src/signing.ts +++ b/packages/apps-routing/src/signing.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Route } from './types'; import Component from '@polkadot/app-signing'; +import type { Route } from './types'; + export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/society.ts b/packages/apps-routing/src/society.ts index 53e2420ad8..0a2b1a95a7 100644 --- a/packages/apps-routing/src/society.ts +++ b/packages/apps-routing/src/society.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Route } from './types'; import Component, { useCounter } from '@polkadot/app-society'; +import type { Route } from './types'; + export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/staking.ts b/packages/apps-routing/src/staking.ts index 5c945f42f1..8de6546824 100644 --- a/packages/apps-routing/src/staking.ts +++ b/packages/apps-routing/src/staking.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Route } from './types'; import Component from '@polkadot/app-staking'; +import type { Route } from './types'; + export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/storage.ts b/packages/apps-routing/src/storage.ts index dfac0cd6e9..f1e3d7e565 100644 --- a/packages/apps-routing/src/storage.ts +++ b/packages/apps-routing/src/storage.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Route } from './types'; import Component from '@polkadot/app-storage'; +import type { Route } from './types'; + export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/sudo.ts b/packages/apps-routing/src/sudo.ts index 10f795269f..fe135b4897 100644 --- a/packages/apps-routing/src/sudo.ts +++ b/packages/apps-routing/src/sudo.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Route } from './types'; import Component from '@polkadot/app-sudo'; +import type { Route } from './types'; + export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/techcomm.ts b/packages/apps-routing/src/techcomm.ts index 03ff3fee2f..883e81a6f5 100644 --- a/packages/apps-routing/src/techcomm.ts +++ b/packages/apps-routing/src/techcomm.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Route } from './types'; import Component, { useCounter } from '@polkadot/app-tech-comm'; +import type { Route } from './types'; + export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/transfer.ts b/packages/apps-routing/src/transfer.ts index 947c93386f..fc9a0888f6 100644 --- a/packages/apps-routing/src/transfer.ts +++ b/packages/apps-routing/src/transfer.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Route } from './types'; import Modal from '@polkadot/app-accounts/modals/Transfer'; +import type { Route } from './types'; + export default function create (t: TFunction): Route { return { Component: Modal, diff --git a/packages/apps-routing/src/treasury.ts b/packages/apps-routing/src/treasury.ts index 454031dadf..ada5bb242c 100644 --- a/packages/apps-routing/src/treasury.ts +++ b/packages/apps-routing/src/treasury.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { Route } from './types'; import Component, { useCounter } from '@polkadot/app-treasury'; +import type { Route } from './types'; + export default function create (t: TFunction): Route { return { Component, diff --git a/packages/apps-routing/src/types.ts b/packages/apps-routing/src/types.ts index cb56434a54..02326a5ad9 100644 --- a/packages/apps-routing/src/types.ts +++ b/packages/apps-routing/src/types.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { IconName } from '@fortawesome/fontawesome-svg-core'; + import type { AppProps, BareProps } from '@polkadot/react-components/types'; export type RouteGroup = 'accounts' | 'developer' | 'governance' | 'network' | 'settings'; diff --git a/packages/apps/src/Apps.tsx b/packages/apps/src/Apps.tsx index 1a3d75f697..e689bb4b4b 100644 --- a/packages/apps/src/Apps.tsx +++ b/packages/apps/src/Apps.tsx @@ -1,19 +1,19 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { BareProps as Props, ThemeDef, ThemeProps } from '@polkadot/react-components/types'; - import React, { useContext, useMemo } from 'react'; import styled, { ThemeContext } from 'styled-components'; + +import type { BareProps as Props, ThemeDef, ThemeProps } from '@polkadot/react-components/types'; import AccountSidebar from '@polkadot/app-accounts/Sidebar'; import { getSystemChainColor } from '@polkadot/apps-config'; import GlobalStyle from '@polkadot/react-components/styles'; import { useApi } from '@polkadot/react-hooks'; import Signer from '@polkadot/react-signer'; -import ConnectingOverlay from './overlays/Connecting'; import Content from './Content'; import Menu from './Menu'; +import ConnectingOverlay from './overlays/Connecting'; import WarmUp from './WarmUp'; export const PORTAL_ID = 'portals'; diff --git a/packages/apps/src/Content/NotFound.tsx b/packages/apps/src/Content/NotFound.tsx index d71c19fa77..2dd2010bcf 100644 --- a/packages/apps/src/Content/NotFound.tsx +++ b/packages/apps/src/Content/NotFound.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { RouteProps } from '@polkadot/apps-routing/types'; - import React from 'react'; import { Redirect } from 'react-router'; +import type { RouteProps } from '@polkadot/apps-routing/types'; + interface Props extends RouteProps { missingApis?: (string | string[])[]; } diff --git a/packages/apps/src/Content/Status.tsx b/packages/apps/src/Content/Status.tsx index 9fed67c9c0..72485b2d0b 100644 --- a/packages/apps/src/Content/Status.tsx +++ b/packages/apps/src/Content/Status.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useContext, useEffect } from 'react'; + +import type { ActionStatus } from '@polkadot/react-components/Status/types'; import type { EventRecord } from '@polkadot/types/interfaces'; import type { KeyringOptions } from '@polkadot/ui-keyring/options/types'; -import type { ActionStatus } from '@polkadot/react-components/Status/types'; - -import React, { useContext, useEffect } from 'react'; import { Status as StatusDisplay, StatusContext } from '@polkadot/react-components'; import { useAccounts, useApi, useCall } from '@polkadot/react-hooks'; import { stringToU8a } from '@polkadot/util'; diff --git a/packages/apps/src/Content/index.tsx b/packages/apps/src/Content/index.tsx index c8dbc75869..0e6568db60 100644 --- a/packages/apps/src/Content/index.tsx +++ b/packages/apps/src/Content/index.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Route } from '@polkadot/apps-routing/types'; - import React, { Suspense, useContext, useMemo } from 'react'; import { useLocation } from 'react-router-dom'; import styled from 'styled-components'; + +import type { Route } from '@polkadot/apps-routing/types'; import createRoutes from '@polkadot/apps-routing'; import { ErrorBoundary, Spinner, StatusContext } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; diff --git a/packages/apps/src/Endpoints/Group.tsx b/packages/apps/src/Endpoints/Group.tsx index 9b8215a946..4b4ac8a8d4 100644 --- a/packages/apps/src/Endpoints/Group.tsx +++ b/packages/apps/src/Endpoints/Group.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from '@polkadot/react-components/types'; -import type { Group } from './types'; - import React, { useCallback } from 'react'; import styled from 'styled-components'; + +import type { ThemeProps } from '@polkadot/react-components/types'; import { Icon } from '@polkadot/react-components'; +import type { Group } from './types'; import Network from './Network'; interface Props { diff --git a/packages/apps/src/Endpoints/Network.tsx b/packages/apps/src/Endpoints/Network.tsx index 14ba8daf27..e6cdb10cec 100644 --- a/packages/apps/src/Endpoints/Network.tsx +++ b/packages/apps/src/Endpoints/Network.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from '@polkadot/react-components/types'; -import type { Network } from './types'; - import React, { useCallback, useMemo } from 'react'; import styled from 'styled-components'; + +import type { ThemeProps } from '@polkadot/react-components/types'; import { ChainImg } from '@polkadot/react-components'; +import type { Network } from './types'; import Url from './Url'; interface Props { diff --git a/packages/apps/src/Endpoints/Url.tsx b/packages/apps/src/Endpoints/Url.tsx index ee3ad325e5..03c286b513 100644 --- a/packages/apps/src/Endpoints/Url.tsx +++ b/packages/apps/src/Endpoints/Url.tsx @@ -3,6 +3,7 @@ import React, { useCallback } from 'react'; import styled from 'styled-components'; + import { Toggle } from '@polkadot/react-components'; interface Props { diff --git a/packages/apps/src/Endpoints/index.tsx b/packages/apps/src/Endpoints/index.tsx index f9161a878e..259a1c08c8 100644 --- a/packages/apps/src/Endpoints/index.tsx +++ b/packages/apps/src/Endpoints/index.tsx @@ -1,20 +1,20 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { LinkOption } from '@polkadot/apps-config/settings/types'; -import type { ThemeProps } from '@polkadot/react-components/types'; -import type { Group } from './types'; - -import React, { useCallback, useMemo, useState } from 'react'; // ok, this seems to be an eslint bug, this _is_ a package import /* eslint-disable-next-line node/no-deprecated-api */ import punycode from 'punycode'; +import React, { useCallback, useMemo, useState } from 'react'; import styled from 'styled-components'; -import { CUSTOM_ENDPOINT_KEY, createWsEndpoints } from '@polkadot/apps-config'; + +import type { LinkOption } from '@polkadot/apps-config/settings/types'; +import type { ThemeProps } from '@polkadot/react-components/types'; +import { createWsEndpoints, CUSTOM_ENDPOINT_KEY } from '@polkadot/apps-config'; import { Button, Input, Sidebar } from '@polkadot/react-components'; import uiSettings from '@polkadot/ui-settings'; import { isAscii } from '@polkadot/util'; +import type { Group } from './types'; import { useTranslation } from '../translate'; import GroupDisplay from './Group'; diff --git a/packages/apps/src/Menu/ChainInfo.tsx b/packages/apps/src/Menu/ChainInfo.tsx index cbe37bed21..726404561d 100644 --- a/packages/apps/src/Menu/ChainInfo.tsx +++ b/packages/apps/src/Menu/ChainInfo.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { RuntimeVersion } from '@polkadot/types/interfaces'; - import React from 'react'; import styled from 'styled-components'; + +import type { RuntimeVersion } from '@polkadot/types/interfaces'; import { ChainImg, Icon } from '@polkadot/react-components'; import { useApi, useCall, useIpfs, useToggle } from '@polkadot/react-hooks'; import { BestNumber, Chain } from '@polkadot/react-query'; diff --git a/packages/apps/src/Menu/Grouping.tsx b/packages/apps/src/Menu/Grouping.tsx index eae2df013e..7d885890c7 100644 --- a/packages/apps/src/Menu/Grouping.tsx +++ b/packages/apps/src/Menu/Grouping.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from '@polkadot/react-components/types'; -import type { Group } from './types'; - import React from 'react'; import styled from 'styled-components'; + +import type { ThemeProps } from '@polkadot/react-components/types'; import { Icon } from '@polkadot/react-components'; +import type { Group } from './types'; import Item from './Item'; interface Props extends Group { diff --git a/packages/apps/src/Menu/Item.tsx b/packages/apps/src/Menu/Item.tsx index 2f6b864dab..f83470231d 100644 --- a/packages/apps/src/Menu/Item.tsx +++ b/packages/apps/src/Menu/Item.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ItemRoute } from './types'; - import React from 'react'; import styled from 'styled-components'; + import { Badge, Icon } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; +import type { ItemRoute } from './types'; + interface Props { className?: string; isToplevel?: boolean; diff --git a/packages/apps/src/Menu/NodeInfo.tsx b/packages/apps/src/Menu/NodeInfo.tsx index c2c8ed49aa..bfc8ca4277 100644 --- a/packages/apps/src/Menu/NodeInfo.tsx +++ b/packages/apps/src/Menu/NodeInfo.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { BareProps as Props } from '@polkadot/react-components/types'; - import React from 'react'; import styled from 'styled-components'; + +import type { BareProps as Props } from '@polkadot/react-components/types'; import { useApi } from '@polkadot/react-hooks'; import { NodeName, NodeVersion } from '@polkadot/react-query'; diff --git a/packages/apps/src/Menu/index.tsx b/packages/apps/src/Menu/index.tsx index 5a90fe81b9..e68124d8be 100644 --- a/packages/apps/src/Menu/index.tsx +++ b/packages/apps/src/Menu/index.tsx @@ -1,20 +1,20 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Route, Routes } from '@polkadot/apps-routing/types'; -import type { ApiProps } from '@polkadot/react-api/types'; -import type { ThemeProps } from '@polkadot/react-components/types'; -import type { AccountId } from '@polkadot/types/interfaces'; -import type { Group, Groups, ItemRoute } from './types'; - import type { TFunction } from 'i18next'; import React, { useMemo, useRef } from 'react'; import { useLocation } from 'react-router-dom'; import styled from 'styled-components'; + +import type { Route, Routes } from '@polkadot/apps-routing/types'; +import type { ApiProps } from '@polkadot/react-api/types'; +import type { ThemeProps } from '@polkadot/react-components/types'; +import type { AccountId } from '@polkadot/types/interfaces'; import createRoutes from '@polkadot/apps-routing'; import { Icon } from '@polkadot/react-components'; import { useAccounts, useApi, useCall } from '@polkadot/react-hooks'; +import type { Group, Groups, ItemRoute } from './types'; import { findMissingApis } from '../endpoint'; import { useTranslation } from '../translate'; import ChainInfo from './ChainInfo'; diff --git a/packages/apps/src/Menu/types.tsx b/packages/apps/src/Menu/types.tsx index 7bed75e1db..022e104b3a 100644 --- a/packages/apps/src/Menu/types.tsx +++ b/packages/apps/src/Menu/types.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { IconName } from '@fortawesome/fontawesome-svg-core'; -import type { Routes } from '@polkadot/apps-routing/types'; - import React from 'react'; +import type { Routes } from '@polkadot/apps-routing/types'; + export interface ItemRoute { Modal?: React.ComponentType; href?: string; diff --git a/packages/apps/src/Root.tsx b/packages/apps/src/Root.tsx index 6b6af836fe..67e1945d7f 100644 --- a/packages/apps/src/Root.tsx +++ b/packages/apps/src/Root.tsx @@ -1,20 +1,20 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { Suspense, useEffect, useState } from 'react'; +import { HashRouter } from 'react-router-dom'; +import { ThemeProvider } from 'styled-components'; + import type { ThemeDef } from '@polkadot/react-components/types'; import type { KeyringStore } from '@polkadot/ui-keyring/types'; - -import React, { Suspense, useEffect, useState } from 'react'; -import { ThemeProvider } from 'styled-components'; -import { HashRouter } from 'react-router-dom'; import { Api } from '@polkadot/react-api'; import Queue from '@polkadot/react-components/Status/Queue'; import { BlockAuthors, Events } from '@polkadot/react-query'; import settings from '@polkadot/ui-settings'; import Apps from './Apps'; -import WindowDimensions from './WindowDimensions'; import { darkTheme, lightTheme } from './themes'; +import WindowDimensions from './WindowDimensions'; interface Props { store?: KeyringStore; diff --git a/packages/apps/src/TopBar.tsx b/packages/apps/src/TopBar.tsx index fa07cda7c3..1826eafdfa 100644 --- a/packages/apps/src/TopBar.tsx +++ b/packages/apps/src/TopBar.tsx @@ -5,6 +5,7 @@ import React from 'react'; import styled from 'styled-components'; + import { BestNumber, Chain, NodeName, NodeVersion } from '@polkadot/react-query'; interface Props { diff --git a/packages/apps/src/WarmUp.tsx b/packages/apps/src/WarmUp.tsx index 14817c0800..db440668f8 100644 --- a/packages/apps/src/WarmUp.tsx +++ b/packages/apps/src/WarmUp.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React, { useEffect, useState } from 'react'; + import { useApi, useCall } from '@polkadot/react-hooks'; function WarmUp (): React.ReactElement { diff --git a/packages/apps/src/index.tsx b/packages/apps/src/index.tsx index 42fb6fb393..13ca569d48 100644 --- a/packages/apps/src/index.tsx +++ b/packages/apps/src/index.tsx @@ -5,7 +5,6 @@ import './initSettings'; import 'semantic-ui-css/semantic.min.css'; import '@polkadot/react-components/i18n'; - import React from 'react'; import ReactDOM from 'react-dom'; diff --git a/packages/apps/src/initSettings.ts b/packages/apps/src/initSettings.ts index 132d3a1148..1605841262 100644 --- a/packages/apps/src/initSettings.ts +++ b/packages/apps/src/initSettings.ts @@ -3,6 +3,7 @@ import queryString from 'query-string'; import store from 'store'; + import { createWsEndpoints } from '@polkadot/apps-config'; import { extractIpfsDetails } from '@polkadot/react-hooks/useIpfs'; import settings from '@polkadot/ui-settings'; diff --git a/packages/apps/src/overlays/Base.tsx b/packages/apps/src/overlays/Base.tsx index 72f4d2cb9a..71e153cfef 100644 --- a/packages/apps/src/overlays/Base.tsx +++ b/packages/apps/src/overlays/Base.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from '@polkadot/react-components/types'; - +import type { IconName } from '@fortawesome/fontawesome-svg-core'; import React from 'react'; import styled from 'styled-components'; -import type { IconName } from '@fortawesome/fontawesome-svg-core'; + +import type { ThemeProps } from '@polkadot/react-components/types'; import { Button, Icon } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; diff --git a/packages/apps/src/overlays/Connecting.tsx b/packages/apps/src/overlays/Connecting.tsx index 105abb7060..fdf5f0009a 100644 --- a/packages/apps/src/overlays/Connecting.tsx +++ b/packages/apps/src/overlays/Connecting.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React from 'react'; + import { useApi } from '@polkadot/react-hooks'; import settings from '@polkadot/ui-settings'; diff --git a/packages/page-accounts/src/Accounts/Account.tsx b/packages/page-accounts/src/Accounts/Account.tsx index d6c9d77003..d740e9b7c3 100644 --- a/packages/page-accounts/src/Accounts/Account.tsx +++ b/packages/page-accounts/src/Accounts/Account.tsx @@ -1,18 +1,17 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SubmittableExtrinsic } from '@polkadot/api/types'; +import BN from 'bn.js'; +import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react'; +import styled, { ThemeContext } from 'styled-components'; + import type { DeriveBalancesAll, DeriveDemocracyLock } from '@polkadot/api-derive/types'; +import type { SubmittableExtrinsic } from '@polkadot/api/types'; import type { ActionStatus } from '@polkadot/react-components/Status/types'; import type { ThemeDef } from '@polkadot/react-components/types'; import type { Option } from '@polkadot/types'; import type { ProxyDefinition, RecoveryConfig } from '@polkadot/types/interfaces'; import type { KeyringAddress } from '@polkadot/ui-keyring/types'; -import type { Delegation } from '../types'; - -import BN from 'bn.js'; -import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react'; -import styled, { ThemeContext } from 'styled-components'; import { ApiPromise } from '@polkadot/api'; import { getLedger } from '@polkadot/react-api'; import { AddressInfo, AddressMini, AddressSmall, Badge, Button, ChainLock, CryptoType, Forget, Icon, IdentityIcon, LinkExternal, Menu, Popup, StatusContext, Tags } from '@polkadot/react-components'; @@ -20,20 +19,21 @@ import { useAccountInfo, useApi, useCall, useToggle } from '@polkadot/react-hook import keyring from '@polkadot/ui-keyring'; import { BN_ZERO, formatBalance, formatNumber } from '@polkadot/util'; -import { useTranslation } from '../translate'; -import { createMenuGroup } from '../util'; +import type { Delegation } from '../types'; import Backup from '../modals/Backup'; import ChangePass from '../modals/ChangePass'; import DelegateModal from '../modals/Delegate'; import Derive from '../modals/Derive'; import IdentityMain from '../modals/IdentityMain'; import IdentitySub from '../modals/IdentitySub'; -import ProxyOverview from '../modals/ProxyOverview'; import MultisigApprove from '../modals/MultisigApprove'; +import ProxyOverview from '../modals/ProxyOverview'; import RecoverAccount from '../modals/RecoverAccount'; import RecoverSetup from '../modals/RecoverSetup'; import Transfer from '../modals/Transfer'; import UndelegateModal from '../modals/Undelegate'; +import { useTranslation } from '../translate'; +import { createMenuGroup } from '../util'; import useMultisigApprovals from './useMultisigApprovals'; import useProxies from './useProxies'; diff --git a/packages/page-accounts/src/Accounts/BannerClaims.tsx b/packages/page-accounts/src/Accounts/BannerClaims.tsx index 25fc546e50..6c040eac1f 100644 --- a/packages/page-accounts/src/Accounts/BannerClaims.tsx +++ b/packages/page-accounts/src/Accounts/BannerClaims.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React from 'react'; + import useClaimCounter from '@polkadot/app-claims/useCounter'; // exceptionally CRAP idea import { useTranslation } from '../translate'; diff --git a/packages/page-accounts/src/Accounts/BannerExtension.tsx b/packages/page-accounts/src/Accounts/BannerExtension.tsx index 4d50e52f81..d066471bfa 100644 --- a/packages/page-accounts/src/Accounts/BannerExtension.tsx +++ b/packages/page-accounts/src/Accounts/BannerExtension.tsx @@ -4,12 +4,13 @@ import { detect } from 'detect-browser'; import React from 'react'; import { Trans } from 'react-i18next'; + import useExtensionCounter from '@polkadot/app-settings/useCounter'; import { availableExtensions } from '@polkadot/apps-config'; import { isWeb3Injected } from '@polkadot/extension-dapp'; -import { stringUpperFirst } from '@polkadot/util'; import { onlyOnWeb } from '@polkadot/react-api/hoc'; import { useApi } from '@polkadot/react-hooks'; +import { stringUpperFirst } from '@polkadot/util'; import { useTranslation } from '../translate'; import Banner from './Banner'; diff --git a/packages/page-accounts/src/Accounts/index.tsx b/packages/page-accounts/src/Accounts/index.tsx index 430ab4aab5..ffeb3a1e2f 100644 --- a/packages/page-accounts/src/Accounts/index.tsx +++ b/packages/page-accounts/src/Accounts/index.tsx @@ -1,30 +1,30 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ActionStatus } from '@polkadot/react-components/Status/types'; -import type { AccountId, ProxyDefinition, ProxyType, Voting } from '@polkadot/types/interfaces'; -import type { Delegation, SortedAccount } from '../types'; - import BN from 'bn.js'; import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import styled from 'styled-components'; + +import type { ActionStatus } from '@polkadot/react-components/Status/types'; +import type { AccountId, ProxyDefinition, ProxyType, Voting } from '@polkadot/types/interfaces'; import { isLedger } from '@polkadot/react-api'; -import { useApi, useAccounts, useCall, useFavorites, useIpfs, useLoadingDelay, useToggle } from '@polkadot/react-hooks'; -import { FormatBalance } from '@polkadot/react-query'; import { Button, Input, Table } from '@polkadot/react-components'; +import { useAccounts, useApi, useCall, useFavorites, useIpfs, useLoadingDelay, useToggle } from '@polkadot/react-hooks'; +import { FormatBalance } from '@polkadot/react-query'; import { BN_ZERO } from '@polkadot/util'; -import { useTranslation } from '../translate'; +import type { Delegation, SortedAccount } from '../types'; import CreateModal from '../modals/Create'; import ImportModal from '../modals/Import'; import Ledger from '../modals/Ledger'; import Multisig from '../modals/MultisigCreate'; import Proxy from '../modals/ProxiedAdd'; import Qr from '../modals/Qr'; +import { useTranslation } from '../translate'; +import { sortAccounts } from '../util'; import Account from './Account'; import BannerClaims from './BannerClaims'; import BannerExtension from './BannerExtension'; -import { sortAccounts } from '../util'; interface Balances { accounts: Record; diff --git a/packages/page-accounts/src/Accounts/types.ts b/packages/page-accounts/src/Accounts/types.ts index 93b8071033..16f116ab1f 100644 --- a/packages/page-accounts/src/Accounts/types.ts +++ b/packages/page-accounts/src/Accounts/types.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import { WithTranslation } from 'react-i18next'; + import type { ActionStatus } from '@polkadot/react-components/Status/types'; import type { KeyringAddress } from '@polkadot/ui-keyring/types'; -import { WithTranslation } from 'react-i18next'; - export { AppProps as ComponentProps } from '@polkadot/react-components/types'; export interface BareProps { diff --git a/packages/page-accounts/src/Accounts/useKnownAddresses.ts b/packages/page-accounts/src/Accounts/useKnownAddresses.ts index 3a6d5210b0..4f8688026f 100644 --- a/packages/page-accounts/src/Accounts/useKnownAddresses.ts +++ b/packages/page-accounts/src/Accounts/useKnownAddresses.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { useMemo } from 'react'; + import { useAccounts, useAddresses } from '@polkadot/react-hooks'; export default function useKnownAddresses (exclude?: string): string[] { diff --git a/packages/page-accounts/src/Accounts/useMultisigApprovals.ts b/packages/page-accounts/src/Accounts/useMultisigApprovals.ts index bcb4572321..5b21962fcf 100644 --- a/packages/page-accounts/src/Accounts/useMultisigApprovals.ts +++ b/packages/page-accounts/src/Accounts/useMultisigApprovals.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import { useContext, useEffect, useState } from 'react'; + import type { Option, StorageKey } from '@polkadot/types'; import type { H256, Multisig } from '@polkadot/types/interfaces'; - -import { useContext, useEffect, useState } from 'react'; import { useApi, useIncrement, useIsMountedRef } from '@polkadot/react-hooks'; import { EventsContext } from '@polkadot/react-query'; diff --git a/packages/page-accounts/src/Accounts/useProxies.ts b/packages/page-accounts/src/Accounts/useProxies.ts index ef7a221699..a500101e6b 100644 --- a/packages/page-accounts/src/Accounts/useProxies.ts +++ b/packages/page-accounts/src/Accounts/useProxies.ts @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import BN from 'bn.js'; +import { useEffect, useState } from 'react'; + import type { Vec } from '@polkadot/types'; import type { AccountId, BalanceOf, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces'; import type { ITuple } from '@polkadot/types/types'; - -import BN from 'bn.js'; -import { useEffect, useState } from 'react'; import { useAccounts, useApi, useIsMountedRef } from '@polkadot/react-hooks'; import { BN_ZERO } from '@polkadot/util'; diff --git a/packages/page-accounts/src/CreateAccount.slow.spec.tsx b/packages/page-accounts/src/CreateAccount.slow.spec.tsx index de66be27ab..8b8ca832f6 100644 --- a/packages/page-accounts/src/CreateAccount.slow.spec.tsx +++ b/packages/page-accounts/src/CreateAccount.slow.spec.tsx @@ -1,16 +1,17 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import '@polkadot/react-components/i18n'; +import { fireEvent, render, waitForElementToBeRemoved } from '@testing-library/react'; +import React, { PropsWithChildren } from 'react'; +import { MemoryRouter } from 'react-router-dom'; +import { ThemeProvider } from 'styled-components'; + import AccountsApp from '@polkadot/app-accounts'; import { MemoryStore } from '@polkadot/app-accounts/test-support/MemoryStore'; import { lightTheme } from '@polkadot/apps/themes'; import { Api } from '@polkadot/react-api'; -import '@polkadot/react-components/i18n'; import { useApi } from '@polkadot/react-hooks'; -import { fireEvent, render, waitForElementToBeRemoved } from '@testing-library/react'; -import React, { PropsWithChildren } from 'react'; -import { MemoryRouter } from 'react-router-dom'; -import { ThemeProvider } from 'styled-components'; const SUBSTRATE_PORT = Number.parseInt(process.env.TEST_SUBSTRATE_PORT || '30333'); diff --git a/packages/page-accounts/src/Sidebar/Balances.tsx b/packages/page-accounts/src/Sidebar/Balances.tsx index 17468f2052..00bf07917d 100644 --- a/packages/page-accounts/src/Sidebar/Balances.tsx +++ b/packages/page-accounts/src/Sidebar/Balances.tsx @@ -3,6 +3,7 @@ import React from 'react'; import styled from 'styled-components'; + import { AddressInfo, Icon } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-accounts/src/Sidebar/Flags.tsx b/packages/page-accounts/src/Sidebar/Flags.tsx index ed4eb3faff..c44c63f739 100644 --- a/packages/page-accounts/src/Sidebar/Flags.tsx +++ b/packages/page-accounts/src/Sidebar/Flags.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AddressFlags } from '@polkadot/react-hooks/types'; - import React from 'react'; + +import type { AddressFlags } from '@polkadot/react-hooks/types'; import { Tag } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-accounts/src/Sidebar/Identity.tsx b/packages/page-accounts/src/Sidebar/Identity.tsx index 4f5c59fd21..493f739d20 100644 --- a/packages/page-accounts/src/Sidebar/Identity.tsx +++ b/packages/page-accounts/src/Sidebar/Identity.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React from 'react'; + import type { AddressIdentity } from '@polkadot/react-hooks/types'; import type { AccountId, BalanceOf } from '@polkadot/types/interfaces'; - -import React from 'react'; import { AddressMini, AvatarItem, Expander, Icon, IconLink, Tag } from '@polkadot/react-components'; import { useApi, useCall, useRegistrars, useToggle } from '@polkadot/react-hooks'; import { isHex } from '@polkadot/util'; diff --git a/packages/page-accounts/src/Sidebar/Multisig.tsx b/packages/page-accounts/src/Sidebar/Multisig.tsx index 5cb445088a..ef50d1ef70 100644 --- a/packages/page-accounts/src/Sidebar/Multisig.tsx +++ b/packages/page-accounts/src/Sidebar/Multisig.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { KeyringJson$Meta } from '@polkadot/ui-keyring/types'; - import React from 'react'; + +import type { KeyringJson$Meta } from '@polkadot/ui-keyring/types'; import { AddressMini, Icon, Static } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-accounts/src/Sidebar/RegistrarJudgement.tsx b/packages/page-accounts/src/Sidebar/RegistrarJudgement.tsx index 00fd8da94f..8cba5c2d6a 100644 --- a/packages/page-accounts/src/Sidebar/RegistrarJudgement.tsx +++ b/packages/page-accounts/src/Sidebar/RegistrarJudgement.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React, { useEffect, useState } from 'react'; + import { Dropdown, Input, InputAddress, Modal, TxButton } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-accounts/src/Sidebar/Sidebar.tsx b/packages/page-accounts/src/Sidebar/Sidebar.tsx index fcaf1a6b8c..abebeca8ef 100644 --- a/packages/page-accounts/src/Sidebar/Sidebar.tsx +++ b/packages/page-accounts/src/Sidebar/Sidebar.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from '@polkadot/react-components/types'; - import React, { useCallback } from 'react'; import styled from 'styled-components'; -import { useAccountInfo, useToggle } from '@polkadot/react-hooks'; -import { colorLink } from '@polkadot/react-components/styles/theme'; + +import type { ThemeProps } from '@polkadot/react-components/types'; import { AccountName, Button, Icon, IdentityIcon, Input, LinkExternal, Sidebar, Tags } from '@polkadot/react-components'; +import { colorLink } from '@polkadot/react-components/styles/theme'; +import { useAccountInfo, useToggle } from '@polkadot/react-hooks'; import Transfer from '../modals/Transfer'; import { useTranslation } from '../translate'; diff --git a/packages/page-accounts/src/Sidebar/index.tsx b/packages/page-accounts/src/Sidebar/index.tsx index 7e89a0c574..d9ff073308 100644 --- a/packages/page-accounts/src/Sidebar/index.tsx +++ b/packages/page-accounts/src/Sidebar/index.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { StringOrNull, VoidFn } from '@polkadot/react-components/types'; - import React, { useCallback, useState } from 'react'; +import type { StringOrNull, VoidFn } from '@polkadot/react-components/types'; + import Sidebar from './Sidebar'; type ToggleContext = undefined | (([address, onUpdateName]: [StringOrNull, VoidFn | null]) => void); diff --git a/packages/page-accounts/src/Vanity/Match.tsx b/packages/page-accounts/src/Vanity/Match.tsx index ed72452011..55e4f0552e 100644 --- a/packages/page-accounts/src/Vanity/Match.tsx +++ b/packages/page-accounts/src/Vanity/Match.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from '@polkadot/react-components/types'; - import React, { useCallback, useMemo } from 'react'; import styled from 'styled-components'; + +import type { ThemeProps } from '@polkadot/react-components/types'; import { Button, IdentityIcon } from '@polkadot/react-components'; import { u8aToHex } from '@polkadot/util'; diff --git a/packages/page-accounts/src/Vanity/index.tsx b/packages/page-accounts/src/Vanity/index.tsx index 6622181a4c..b522059854 100644 --- a/packages/page-accounts/src/Vanity/index.tsx +++ b/packages/page-accounts/src/Vanity/index.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ActionStatus } from '@polkadot/react-components/Status/types'; -import type { KeypairType } from '@polkadot/util-crypto/types'; -import type { GeneratorMatches, GeneratorMatch, GeneratorResult } from '@polkadot/vanitygen/types'; - import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import styled from 'styled-components'; + +import type { ActionStatus } from '@polkadot/react-components/Status/types'; +import type { KeypairType } from '@polkadot/util-crypto/types'; +import type { GeneratorMatch, GeneratorMatches, GeneratorResult } from '@polkadot/vanitygen/types'; import { Button, Dropdown, Input, Table } from '@polkadot/react-components'; import { useApi, useIsMountedRef } from '@polkadot/react-hooks'; import uiSettings from '@polkadot/ui-settings'; diff --git a/packages/page-accounts/src/index.tsx b/packages/page-accounts/src/index.tsx index c5869a41c2..4d1476ffbf 100644 --- a/packages/page-accounts/src/index.tsx +++ b/packages/page-accounts/src/index.tsx @@ -1,17 +1,17 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AppProps as Props } from '@polkadot/react-components/types'; - import React, { useRef } from 'react'; import { Route, Switch } from 'react-router'; -import { useAccounts, useIpfs } from '@polkadot/react-hooks'; -import { HelpOverlay, Tabs } from '@polkadot/react-components'; +import type { AppProps as Props } from '@polkadot/react-components/types'; +import { HelpOverlay, Tabs } from '@polkadot/react-components'; +import { useAccounts, useIpfs } from '@polkadot/react-hooks'; + +import Accounts from './Accounts'; import basicMd from './md/basic.md'; import { useTranslation } from './translate'; import useCounter from './useCounter'; -import Accounts from './Accounts'; import Vanity from './Vanity'; export { useCounter }; diff --git a/packages/page-accounts/src/modals/Backup.tsx b/packages/page-accounts/src/modals/Backup.tsx index 60f751e3e4..9ba274e5aa 100644 --- a/packages/page-accounts/src/modals/Backup.tsx +++ b/packages/page-accounts/src/modals/Backup.tsx @@ -3,6 +3,7 @@ import FileSaver from 'file-saver'; import React, { useCallback, useState } from 'react'; + import { AddressRow, Button, Modal, Password } from '@polkadot/react-components'; import keyring from '@polkadot/ui-keyring'; diff --git a/packages/page-accounts/src/modals/ChangePass.tsx b/packages/page-accounts/src/modals/ChangePass.tsx index 46d951dd2b..b8f33ab944 100644 --- a/packages/page-accounts/src/modals/ChangePass.tsx +++ b/packages/page-accounts/src/modals/ChangePass.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React, { useCallback, useState } from 'react'; + import { AddressRow, Button, Modal, Password, PasswordStrength } from '@polkadot/react-components'; import keyring from '@polkadot/ui-keyring'; diff --git a/packages/page-accounts/src/modals/Create.tsx b/packages/page-accounts/src/modals/Create.tsx index 7931e2d8a9..76ca4860d2 100644 --- a/packages/page-accounts/src/modals/Create.tsx +++ b/packages/page-accounts/src/modals/Create.tsx @@ -1,23 +1,23 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ActionStatus } from '@polkadot/react-components/Status/types'; -import type { CreateResult } from '@polkadot/ui-keyring/types'; -import type { KeypairType } from '@polkadot/util-crypto/types'; -import type { ModalProps } from '../types'; - import FileSaver from 'file-saver'; import React, { useCallback, useMemo, useState } from 'react'; import styled from 'styled-components'; + +import type { ActionStatus } from '@polkadot/react-components/Status/types'; +import type { CreateResult } from '@polkadot/ui-keyring/types'; +import type { KeypairType } from '@polkadot/util-crypto/types'; import { DEV_PHRASE } from '@polkadot/keyring/defaults'; +import { getEnvironment } from '@polkadot/react-api/util'; import { AddressRow, Button, Checkbox, CopyButton, Dropdown, Expander, Input, InputAddress, Modal, TextArea } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import keyring from '@polkadot/ui-keyring'; import uiSettings from '@polkadot/ui-settings'; import { isHex, u8aToHex } from '@polkadot/util'; import { keyExtractSuri, mnemonicGenerate, mnemonicValidate, randomAsU8a } from '@polkadot/util-crypto'; -import { getEnvironment } from '@polkadot/react-api/util'; +import type { ModalProps } from '../types'; import { useTranslation } from '../translate'; import CreateConfirmation from './CreateConfirmation'; import ExternalWarning from './ExternalWarning'; diff --git a/packages/page-accounts/src/modals/CreateConfirmation.tsx b/packages/page-accounts/src/modals/CreateConfirmation.tsx index 9cd47cc876..4cfebd1f07 100644 --- a/packages/page-accounts/src/modals/CreateConfirmation.tsx +++ b/packages/page-accounts/src/modals/CreateConfirmation.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { KeypairType } from '@polkadot/util-crypto/types'; - import React from 'react'; + +import type { KeypairType } from '@polkadot/util-crypto/types'; import { AddressRow, Modal, Static } from '@polkadot/react-components'; import { isHex } from '@polkadot/util'; diff --git a/packages/page-accounts/src/modals/Delegate.tsx b/packages/page-accounts/src/modals/Delegate.tsx index ebc02fba7f..c9eb78d1fb 100644 --- a/packages/page-accounts/src/modals/Delegate.tsx +++ b/packages/page-accounts/src/modals/Delegate.tsx @@ -1,15 +1,15 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Conviction } from '@polkadot/types/interfaces'; -import type { AmountValidateState } from '../Accounts/types'; - import BN from 'bn.js'; import React, { useState } from 'react'; + +import type { Conviction } from '@polkadot/types/interfaces'; import { ConvictionDropdown, InputAddress, InputBalance, Modal, TxButton } from '@polkadot/react-components'; import { BalanceFree } from '@polkadot/react-query'; import { BN_ZERO } from '@polkadot/util'; +import type { AmountValidateState } from '../Accounts/types'; import { useTranslation } from '../translate'; import ValidateAmount from './InputValidateAmount'; diff --git a/packages/page-accounts/src/modals/Derive.tsx b/packages/page-accounts/src/modals/Derive.tsx index 2ed74cbdae..4d90b95239 100644 --- a/packages/page-accounts/src/modals/Derive.tsx +++ b/packages/page-accounts/src/modals/Derive.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useCallback, useContext, useEffect, useState } from 'react'; + import type { KeyringPair } from '@polkadot/keyring/types'; import type { ActionStatus } from '@polkadot/react-components/Status/types'; import type { KeypairType } from '@polkadot/util-crypto/types'; - -import React, { useCallback, useContext, useEffect, useState } from 'react'; import { AddressRow, Button, Input, InputAddress, Modal, Password, StatusContext } from '@polkadot/react-components'; import { useApi, useDebounce, useToggle } from '@polkadot/react-hooks'; import keyring from '@polkadot/ui-keyring'; diff --git a/packages/page-accounts/src/modals/IdentityMain.tsx b/packages/page-accounts/src/modals/IdentityMain.tsx index def103e89d..46b315d29d 100644 --- a/packages/page-accounts/src/modals/IdentityMain.tsx +++ b/packages/page-accounts/src/modals/IdentityMain.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Data, Option } from '@polkadot/types'; -import type { Registration } from '@polkadot/types/interfaces'; - import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; + +import type { Data, Option } from '@polkadot/types'; +import type { Registration } from '@polkadot/types/interfaces'; import { Input, InputBalance, Modal, Toggle, TxButton } from '@polkadot/react-components'; import { getAddressMeta } from '@polkadot/react-components/util'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-accounts/src/modals/IdentitySub.tsx b/packages/page-accounts/src/modals/IdentitySub.tsx index 994b331bbb..98e5d4b9d5 100644 --- a/packages/page-accounts/src/modals/IdentitySub.tsx +++ b/packages/page-accounts/src/modals/IdentitySub.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useCallback, useEffect, useState } from 'react'; + import type { Data, Option, Vec } from '@polkadot/types'; import type { AccountId, Balance } from '@polkadot/types/interfaces'; import type { ITuple } from '@polkadot/types/types'; - -import React, { useCallback, useEffect, useState } from 'react'; import { Button, Columar, Input, InputAddress, Modal, Spinner, TxButton } from '@polkadot/react-components'; import { useAccounts, useApi, useCall } from '@polkadot/react-hooks'; import { u8aToString } from '@polkadot/util'; diff --git a/packages/page-accounts/src/modals/Import.tsx b/packages/page-accounts/src/modals/Import.tsx index 39ef11638b..b2fcd6743e 100644 --- a/packages/page-accounts/src/modals/Import.tsx +++ b/packages/page-accounts/src/modals/Import.tsx @@ -1,16 +1,16 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useCallback, useMemo, useState } from 'react'; + import type { KeyringPair, KeyringPair$Json } from '@polkadot/keyring/types'; import type { ActionStatus } from '@polkadot/react-components/Status/types'; -import type { ModalProps } from '../types'; - -import React, { useCallback, useMemo, useState } from 'react'; import { AddressRow, Button, InputAddress, InputFile, Modal, Password } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; -import { u8aToString } from '@polkadot/util'; import keyring from '@polkadot/ui-keyring'; +import { u8aToString } from '@polkadot/util'; +import type { ModalProps } from '../types'; import { useTranslation } from '../translate'; import ExternalWarning from './ExternalWarning'; diff --git a/packages/page-accounts/src/modals/InputValidateAmount.tsx b/packages/page-accounts/src/modals/InputValidateAmount.tsx index d3e7bb81db..613d2c5f8c 100644 --- a/packages/page-accounts/src/modals/InputValidateAmount.tsx +++ b/packages/page-accounts/src/modals/InputValidateAmount.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; -import type { AmountValidateState } from '../Accounts/types'; - import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; + +import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BN_ZERO } from '@polkadot/util'; +import type { AmountValidateState } from '../Accounts/types'; import { useTranslation } from '../translate'; interface Props { diff --git a/packages/page-accounts/src/modals/Ledger.tsx b/packages/page-accounts/src/modals/Ledger.tsx index f38d010a79..7201619e69 100644 --- a/packages/page-accounts/src/modals/Ledger.tsx +++ b/packages/page-accounts/src/modals/Ledger.tsx @@ -2,9 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import React, { useCallback, useRef, useState } from 'react'; -import keyring from '@polkadot/ui-keyring'; + import { getLedger } from '@polkadot/react-api'; import { Button, Dropdown, Modal } from '@polkadot/react-components'; +import keyring from '@polkadot/ui-keyring'; import { useTranslation } from '../translate'; diff --git a/packages/page-accounts/src/modals/MultisigApprove.tsx b/packages/page-accounts/src/modals/MultisigApprove.tsx index 52b68e3e38..5b1d168b94 100644 --- a/packages/page-accounts/src/modals/MultisigApprove.tsx +++ b/packages/page-accounts/src/modals/MultisigApprove.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AccountId, Call, H256, Multisig } from '@polkadot/types/interfaces'; -import type { SubmittableExtrinsic } from '@polkadot/api/types'; - import React, { useCallback, useEffect, useMemo, useState } from 'react'; import styled from 'styled-components'; + +import type { SubmittableExtrinsic } from '@polkadot/api/types'; +import type { AccountId, Call, H256, Multisig } from '@polkadot/types/interfaces'; import { registry } from '@polkadot/react-api'; -import { Dropdown, InputAddress, Modal, Toggle, TxButton, Input } from '@polkadot/react-components'; +import { Dropdown, Input, InputAddress, Modal, Toggle, TxButton } from '@polkadot/react-components'; import { useAccounts, useApi, useWeight } from '@polkadot/react-hooks'; import { assert, isHex } from '@polkadot/util'; diff --git a/packages/page-accounts/src/modals/MultisigCreate.tsx b/packages/page-accounts/src/modals/MultisigCreate.tsx index 440e669185..3619786f85 100644 --- a/packages/page-accounts/src/modals/MultisigCreate.tsx +++ b/packages/page-accounts/src/modals/MultisigCreate.tsx @@ -1,17 +1,17 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ActionStatus } from '@polkadot/react-components/Status/types'; -import type { ModalProps } from '../types'; - import BN from 'bn.js'; import React, { useCallback, useState } from 'react'; + +import type { ActionStatus } from '@polkadot/react-components/Status/types'; import { Button, Input, InputAddressMulti, InputNumber, Modal } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import keyring from '@polkadot/ui-keyring'; -import { useTranslation } from '../translate'; +import type { ModalProps } from '../types'; import useKnownAddresses from '../Accounts/useKnownAddresses'; +import { useTranslation } from '../translate'; interface Props extends ModalProps { className?: string; diff --git a/packages/page-accounts/src/modals/PasswordInput.tsx b/packages/page-accounts/src/modals/PasswordInput.tsx index 0d7b822c10..799c1c9419 100644 --- a/packages/page-accounts/src/modals/PasswordInput.tsx +++ b/packages/page-accounts/src/modals/PasswordInput.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React, { useCallback, useEffect, useState } from 'react'; + import { Modal, Password, PasswordStrength } from '@polkadot/react-components'; import keyring from '@polkadot/ui-keyring'; diff --git a/packages/page-accounts/src/modals/ProxiedAdd.tsx b/packages/page-accounts/src/modals/ProxiedAdd.tsx index fec8d9c361..4113e53df3 100644 --- a/packages/page-accounts/src/modals/ProxiedAdd.tsx +++ b/packages/page-accounts/src/modals/ProxiedAdd.tsx @@ -1,16 +1,16 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ActionStatus } from '@polkadot/react-components/Status/types'; -import type { ModalProps } from '../types'; - import React, { useCallback, useState } from 'react'; + +import type { ActionStatus } from '@polkadot/react-components/Status/types'; import { Button, Input, InputAddressSimple, Modal } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import keyring from '@polkadot/ui-keyring'; -import { useTranslation } from '../translate'; +import type { ModalProps } from '../types'; import useProxies from '../Accounts/useProxies'; +import { useTranslation } from '../translate'; interface Props extends ModalProps { className?: string; diff --git a/packages/page-accounts/src/modals/ProxyOverview.tsx b/packages/page-accounts/src/modals/ProxyOverview.tsx index 0cfe918022..2571b9d2ae 100644 --- a/packages/page-accounts/src/modals/ProxyOverview.tsx +++ b/packages/page-accounts/src/modals/ProxyOverview.tsx @@ -1,19 +1,19 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import BN from 'bn.js'; +import React, { useCallback, useEffect, useMemo, useState } from 'react'; +import styled from 'styled-components'; + import type { ApiPromise } from '@polkadot/api'; import type { SubmittableExtrinsic } from '@polkadot/api/types'; import type { AccountId, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces'; - -import BN from 'bn.js'; -import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { registry } from '@polkadot/react-api'; -import { Button, InputAddress, Modal, TxButton, Dropdown } from '@polkadot/react-components'; +import { Button, Dropdown, InputAddress, Modal, TxButton } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import { isFunction } from '@polkadot/util'; import { useTranslation } from '../translate'; -import styled from 'styled-components'; type PrevProxy = [AccountId, ProxyType]; diff --git a/packages/page-accounts/src/modals/Qr.tsx b/packages/page-accounts/src/modals/Qr.tsx index 970c1bd3c7..d693e168c3 100644 --- a/packages/page-accounts/src/modals/Qr.tsx +++ b/packages/page-accounts/src/modals/Qr.tsx @@ -1,15 +1,15 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ActionStatus } from '@polkadot/react-components/Status/types'; -import type { ModalProps } from '../types'; - import React, { useCallback, useState } from 'react'; import styled from 'styled-components'; + +import type { ActionStatus } from '@polkadot/react-components/Status/types'; import { AddressRow, Button, Input, InputAddress, Modal, QrScanAddress } from '@polkadot/react-components'; import { useApi, useIpfs } from '@polkadot/react-hooks'; import keyring from '@polkadot/ui-keyring'; +import type { ModalProps } from '../types'; import { useTranslation } from '../translate'; import PasswordInput from './PasswordInput'; diff --git a/packages/page-accounts/src/modals/RecoverAccount.tsx b/packages/page-accounts/src/modals/RecoverAccount.tsx index ceafa15666..4a190b3a58 100644 --- a/packages/page-accounts/src/modals/RecoverAccount.tsx +++ b/packages/page-accounts/src/modals/RecoverAccount.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React, { useState } from 'react'; + import { InputAddress, Modal, TxButton } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-accounts/src/modals/RecoverSetup.tsx b/packages/page-accounts/src/modals/RecoverSetup.tsx index 24b3a6c30a..63ea878e2a 100644 --- a/packages/page-accounts/src/modals/RecoverSetup.tsx +++ b/packages/page-accounts/src/modals/RecoverSetup.tsx @@ -3,11 +3,12 @@ import BN from 'bn.js'; import React, { useState } from 'react'; -import { InputAddressMulti, InputAddress, InputNumber, Modal, TxButton } from '@polkadot/react-components'; + +import { InputAddress, InputAddressMulti, InputNumber, Modal, TxButton } from '@polkadot/react-components'; import { sortAddresses } from '@polkadot/util-crypto'; -import { useTranslation } from '../translate'; import useKnownAddresses from '../Accounts/useKnownAddresses'; +import { useTranslation } from '../translate'; interface Props { address: string; diff --git a/packages/page-accounts/src/modals/Transfer.tsx b/packages/page-accounts/src/modals/Transfer.tsx index 0c0d624025..06e5fd22c4 100644 --- a/packages/page-accounts/src/modals/Transfer.tsx +++ b/packages/page-accounts/src/modals/Transfer.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; -import type { AccountInfo } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; + +import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; +import type { AccountInfo } from '@polkadot/types/interfaces'; import { InputAddress, InputBalance, Modal, Toggle, TxButton } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { Available } from '@polkadot/react-query'; diff --git a/packages/page-accounts/src/modals/Undelegate.tsx b/packages/page-accounts/src/modals/Undelegate.tsx index ba1472a523..bf4ebeea87 100644 --- a/packages/page-accounts/src/modals/Undelegate.tsx +++ b/packages/page-accounts/src/modals/Undelegate.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React from 'react'; + import { InputAddress, Modal, TxButton } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-accounts/src/types.ts b/packages/page-accounts/src/types.ts index 8548f38ab4..399c965e1c 100644 --- a/packages/page-accounts/src/types.ts +++ b/packages/page-accounts/src/types.ts @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import { WithTranslation } from 'react-i18next'; + import type { ActionStatus } from '@polkadot/react-components/Status/types'; import type { Balance, Conviction } from '@polkadot/types/interfaces'; import type { KeyringAddress } from '@polkadot/ui-keyring/types'; -import { WithTranslation } from 'react-i18next'; - export { AppProps as ComponentProps } from '@polkadot/react-components/types'; export interface BareProps { diff --git a/packages/page-accounts/src/util.tsx b/packages/page-accounts/src/util.tsx index 9090126b36..c0befe0fce 100644 --- a/packages/page-accounts/src/util.tsx +++ b/packages/page-accounts/src/util.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { KeyringAddress } from '@polkadot/ui-keyring/types'; -import type { SortedAccount } from './types'; - import React from 'react'; + +import type { KeyringAddress } from '@polkadot/ui-keyring/types'; import { Menu } from '@polkadot/react-components'; import keyring from '@polkadot/ui-keyring'; +import type { SortedAccount } from './types'; + export function createMenuGroup (items: (React.ReactNode | false | undefined | null)[]): React.ReactNode | null { const filtered = items.filter((item): item is React.ReactNode => !!item); diff --git a/packages/page-addresses/src/Contacts/Address.tsx b/packages/page-addresses/src/Contacts/Address.tsx index 1f08bcde1a..311934d08f 100644 --- a/packages/page-addresses/src/Contacts/Address.tsx +++ b/packages/page-addresses/src/Contacts/Address.tsx @@ -1,15 +1,15 @@ // Copyright 2017-2020 @polkadot/app-addresses authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveAccountInfo, DeriveBalancesAll } from '@polkadot/api-derive/types'; -import type { KeyringAddress } from '@polkadot/ui-keyring/types'; -import type { ActionStatus } from '@polkadot/react-components/Status/types'; -import type { ThemeDef } from '@polkadot/react-components/types'; - import React, { useCallback, useContext, useEffect, useState } from 'react'; import styled, { ThemeContext } from 'styled-components'; + +import type { DeriveAccountInfo, DeriveBalancesAll } from '@polkadot/api-derive/types'; +import type { ActionStatus } from '@polkadot/react-components/Status/types'; +import type { ThemeDef } from '@polkadot/react-components/types'; +import type { KeyringAddress } from '@polkadot/ui-keyring/types'; import Transfer from '@polkadot/app-accounts/modals/Transfer'; -import { AddressSmall, AddressInfo, Button, ChainLock, Icon, LinkExternal, Forget, Menu, Popup, Tags } from '@polkadot/react-components'; +import { AddressInfo, AddressSmall, Button, ChainLock, Forget, Icon, LinkExternal, Menu, Popup, Tags } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import keyring from '@polkadot/ui-keyring'; import { BN_ZERO, formatNumber } from '@polkadot/util'; diff --git a/packages/page-addresses/src/Contacts/index.tsx b/packages/page-addresses/src/Contacts/index.tsx index 817a85185b..369ee7838b 100644 --- a/packages/page-addresses/src/Contacts/index.tsx +++ b/packages/page-addresses/src/Contacts/index.tsx @@ -1,15 +1,15 @@ // Copyright 2017-2020 @polkadot/app-addresses authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ComponentProps as Props } from '../types'; - import React, { useEffect, useMemo, useRef, useState } from 'react'; import styled from 'styled-components'; + import { Button, Input, Table } from '@polkadot/react-components'; import { useAddresses, useFavorites, useLoadingDelay, useToggle } from '@polkadot/react-hooks'; -import { useTranslation } from '../translate'; +import type { ComponentProps as Props } from '../types'; import CreateModal from '../modals/Create'; +import { useTranslation } from '../translate'; import Address from './Address'; type SortedAddress = { address: string; isFavorite: boolean }; diff --git a/packages/page-addresses/src/index.tsx b/packages/page-addresses/src/index.tsx index ca18d4e8f5..e88bcb811a 100644 --- a/packages/page-addresses/src/index.tsx +++ b/packages/page-addresses/src/index.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-addresses authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AppProps as Props } from '@polkadot/react-components/types'; - import React, { useRef } from 'react'; import { Route, Switch } from 'react-router'; + +import type { AppProps as Props } from '@polkadot/react-components/types'; import { Tabs } from '@polkadot/react-components'; -import { useTranslation } from './translate'; import Contacts from './Contacts'; +import { useTranslation } from './translate'; function AddressesApp ({ basePath, onStatusChange }: Props): React.ReactElement { const { t } = useTranslation(); diff --git a/packages/page-addresses/src/modals/Create.tsx b/packages/page-addresses/src/modals/Create.tsx index 0f80774e96..9eea5dba68 100644 --- a/packages/page-addresses/src/modals/Create.tsx +++ b/packages/page-addresses/src/modals/Create.tsx @@ -1,17 +1,17 @@ // Copyright 2017-2020 @polkadot/app-addresses authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useCallback, useState } from 'react'; + import type { DeriveAccountInfo } from '@polkadot/api-derive/types'; import type { ActionStatus } from '@polkadot/react-components/Status/types'; -import type { ModalProps as Props } from '../types'; - -import React, { useCallback, useState } from 'react'; import { AddressRow, Button, Input, InputAddress, Modal } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import keyring from '@polkadot/ui-keyring'; import { hexToU8a } from '@polkadot/util'; import { ethereumEncode } from '@polkadot/util-crypto'; +import type { ModalProps as Props } from '../types'; import { useTranslation } from '../translate'; interface AddrState { diff --git a/packages/page-addresses/src/types.ts b/packages/page-addresses/src/types.ts index 55daa4d13d..0f96c595fb 100644 --- a/packages/page-addresses/src/types.ts +++ b/packages/page-addresses/src/types.ts @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-addresses authors & contributors // SPDX-License-Identifier: Apache-2.0 +import { WithTranslation } from 'react-i18next'; + import type { ActionStatus } from '@polkadot/react-components/Status/types'; import type { Balance, Conviction } from '@polkadot/types/interfaces'; import type { KeyringAddress } from '@polkadot/ui-keyring/types'; -import { WithTranslation } from 'react-i18next'; - export { AppProps as ComponentProps } from '@polkadot/react-components/types'; export interface BareProps { diff --git a/packages/page-addresses/src/util.tsx b/packages/page-addresses/src/util.tsx index f6893ed05c..6236863f84 100644 --- a/packages/page-addresses/src/util.tsx +++ b/packages/page-addresses/src/util.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/app-addresses authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { KeyringAddress } from '@polkadot/ui-keyring/types'; -import type { SortedAccount } from './types'; - import React from 'react'; + +import type { KeyringAddress } from '@polkadot/ui-keyring/types'; import { Menu } from '@polkadot/react-components'; import keyring from '@polkadot/ui-keyring'; +import type { SortedAccount } from './types'; + export function createMenuGroup (items: (React.ReactNode | false | undefined | null)[]): React.ReactNode | null { const filtered = items.filter((item): item is React.ReactNode => !!item); diff --git a/packages/page-calendar/src/Day.tsx b/packages/page-calendar/src/Day.tsx index 489bb85dd3..5a4fce9368 100644 --- a/packages/page-calendar/src/Day.tsx +++ b/packages/page-calendar/src/Day.tsx @@ -1,15 +1,15 @@ // Copyright 2017-2020 @polkadot/app-calendar authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { EntryInfo } from './types'; - import React, { useMemo, useRef } from 'react'; import styled from 'styled-components'; + import { Button } from '@polkadot/react-components'; +import type { EntryInfo } from './types'; +import { MONTHS } from './constants'; import DayHour from './DayHour'; import DayTime from './DayTime'; -import { MONTHS } from './constants'; import { useTranslation } from './translate'; interface Props { diff --git a/packages/page-calendar/src/DayHour.tsx b/packages/page-calendar/src/DayHour.tsx index 6869c1f214..69db896800 100644 --- a/packages/page-calendar/src/DayHour.tsx +++ b/packages/page-calendar/src/DayHour.tsx @@ -1,11 +1,10 @@ // Copyright 2017-2020 @polkadot/app-calendar authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { EntryInfoTyped } from './types'; - import React, { useMemo } from 'react'; import styled from 'styled-components'; +import type { EntryInfoTyped } from './types'; import DayItem from './DayItem'; interface Props { diff --git a/packages/page-calendar/src/DayItem.tsx b/packages/page-calendar/src/DayItem.tsx index 7968543aba..0647ea20dc 100644 --- a/packages/page-calendar/src/DayItem.tsx +++ b/packages/page-calendar/src/DayItem.tsx @@ -1,15 +1,15 @@ // Copyright 2017-2020 @polkadot/app-calendar authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { EntryInfoTyped } from './types'; - -import React, { useMemo, useState, useCallback } from 'react'; +import React, { useCallback, useMemo, useState } from 'react'; import styled from 'styled-components'; -import { formatNumber, isString } from '@polkadot/util'; -import { dateCalendarFormat } from './util'; -import { Button } from '@polkadot/react-components'; +import { Button } from '@polkadot/react-components'; +import { formatNumber, isString } from '@polkadot/util'; + +import type { EntryInfoTyped } from './types'; import { useTranslation } from './translate'; +import { dateCalendarFormat } from './util'; interface Props { className?: string; diff --git a/packages/page-calendar/src/Month.tsx b/packages/page-calendar/src/Month.tsx index 21bed4f476..08ca487c90 100644 --- a/packages/page-calendar/src/Month.tsx +++ b/packages/page-calendar/src/Month.tsx @@ -1,15 +1,15 @@ // Copyright 2017-2020 @polkadot/app-calendar authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DateState, EntryInfo } from './types'; - import React, { useMemo, useRef } from 'react'; import styled from 'styled-components'; + import { Button } from '@polkadot/react-components'; +import type { DateState, EntryInfo } from './types'; import { DAYS, MONTHS } from './constants'; -import { useTranslation } from './translate'; import MonthDay from './MonthDay'; +import { useTranslation } from './translate'; interface Props { className?: string; diff --git a/packages/page-calendar/src/MonthDay.tsx b/packages/page-calendar/src/MonthDay.tsx index e15488596d..7de9817be5 100644 --- a/packages/page-calendar/src/MonthDay.tsx +++ b/packages/page-calendar/src/MonthDay.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-calendar authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { EntryInfo } from './types'; - import React, { useCallback, useMemo } from 'react'; import styled from 'styled-components'; +import type { EntryInfo } from './types'; + interface Props { className?: string; dateMonth: Date; diff --git a/packages/page-calendar/src/index.tsx b/packages/page-calendar/src/index.tsx index 7ba08f8d71..6e8f3b3897 100644 --- a/packages/page-calendar/src/index.tsx +++ b/packages/page-calendar/src/index.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/app-calendar authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from '@polkadot/react-components/types'; -import type { DateState } from './types'; - import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import styled from 'styled-components'; + +import type { ThemeProps } from '@polkadot/react-components/types'; import { Tabs } from '@polkadot/react-components'; +import type { DateState } from './types'; import Day from './Day'; import Month from './Month'; import { useTranslation } from './translate'; diff --git a/packages/page-calendar/src/useScheduled.ts b/packages/page-calendar/src/useScheduled.ts index 2dac5764b3..b204d7bfad 100644 --- a/packages/page-calendar/src/useScheduled.ts +++ b/packages/page-calendar/src/useScheduled.ts @@ -1,16 +1,17 @@ // Copyright 2017-2020 @polkadot/app-calendar authors & contributors // SPDX-License-Identifier: Apache-2.0 +import BN from 'bn.js'; +import { useEffect, useState } from 'react'; + import type { DeriveCollectiveProposal, DeriveDispatch, DeriveReferendumExt, DeriveSessionProgress } from '@polkadot/api-derive/types'; import type { Option } from '@polkadot/types'; import type { BlockNumber, EraIndex, Scheduled, UnappliedSlash } from '@polkadot/types/interfaces'; -import type { EntryInfo, EntryInfoTyped, EntryType } from './types'; - -import BN from 'bn.js'; -import { useEffect, useState } from 'react'; import { useApi, useBlockTime, useCall } from '@polkadot/react-hooks'; import { BN_ONE } from '@polkadot/util'; +import type { EntryInfo, EntryInfoTyped, EntryType } from './types'; + interface DateExt { date: Date; dateTime: number; diff --git a/packages/page-calendar/src/util.ts b/packages/page-calendar/src/util.ts index 1a941d1c96..e72fd52e08 100644 --- a/packages/page-calendar/src/util.ts +++ b/packages/page-calendar/src/util.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import type { DateState } from './types'; - import { DAYS } from './constants'; export function newZeroDate (input: Date): Date { diff --git a/packages/page-claims/src/Attest.tsx b/packages/page-claims/src/Attest.tsx index 39df8daf50..33b6fb7a11 100644 --- a/packages/page-claims/src/Attest.tsx +++ b/packages/page-claims/src/Attest.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-claims authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useEffect, useState } from 'react'; +import styled from 'styled-components'; + import type { TxCallback } from '@polkadot/react-components/Status/types'; import type { Option } from '@polkadot/types'; import type { BalanceOf, EthereumAddress, StatementKind } from '@polkadot/types/interfaces'; - -import React, { useEffect, useState } from 'react'; -import styled from 'styled-components'; import { Button, Card, TxButton } from '@polkadot/react-components'; import { useAccounts, useApi } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; diff --git a/packages/page-claims/src/Claim.tsx b/packages/page-claims/src/Claim.tsx index 75b2dec6a3..9e5dd144b6 100644 --- a/packages/page-claims/src/Claim.tsx +++ b/packages/page-claims/src/Claim.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-claims authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Option } from '@polkadot/types'; -import type { TxCallback } from '@polkadot/react-components/Status/types'; -import type { BalanceOf, EthereumAddress, StatementKind } from '@polkadot/types/interfaces'; - import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; + +import type { TxCallback } from '@polkadot/react-components/Status/types'; +import type { Option } from '@polkadot/types'; +import type { BalanceOf, EthereumAddress, StatementKind } from '@polkadot/types/interfaces'; import { Button, Card, TxButton } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; diff --git a/packages/page-claims/src/Statement.tsx b/packages/page-claims/src/Statement.tsx index 67a3b5c780..8df0b620fc 100644 --- a/packages/page-claims/src/Statement.tsx +++ b/packages/page-claims/src/Statement.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-claims authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from '@polkadot/react-components/types'; -import type { StatementKind } from '@polkadot/types/interfaces'; - import React from 'react'; import styled from 'styled-components'; +import type { ThemeProps } from '@polkadot/react-components/types'; +import type { StatementKind } from '@polkadot/types/interfaces'; + import { useTranslation } from './translate'; import { getStatement } from './util'; diff --git a/packages/page-claims/src/Warning.tsx b/packages/page-claims/src/Warning.tsx index 7fcd3d8d6c..c57e1c7c9b 100644 --- a/packages/page-claims/src/Warning.tsx +++ b/packages/page-claims/src/Warning.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-claims authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AddressMini, Card } from '@polkadot/react-components'; - import React from 'react'; import styled from 'styled-components'; +import { AddressMini, Card } from '@polkadot/react-components'; + import { useTranslation } from './translate'; import usePolkadotPreclaims from './usePolkadotPreclaims'; diff --git a/packages/page-claims/src/index.tsx b/packages/page-claims/src/index.tsx index 8cd5085eb9..b17d9e6e22 100644 --- a/packages/page-claims/src/index.tsx +++ b/packages/page-claims/src/index.tsx @@ -1,25 +1,25 @@ // Copyright 2017-2020 @polkadot/app-claims authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useCallback, useEffect, useRef, useState } from 'react'; +import CopyToClipboard from 'react-copy-to-clipboard'; +import { Trans } from 'react-i18next'; +import styled from 'styled-components'; + import type { AppProps as Props, ThemeProps } from '@polkadot/react-components/types'; import type { Option } from '@polkadot/types'; import type { EcdsaSignature, EthereumAddress, StatementKind } from '@polkadot/types/interfaces'; - -import React, { useState, useCallback, useEffect, useRef } from 'react'; -import { Trans } from 'react-i18next'; -import styled from 'styled-components'; -import CopyToClipboard from 'react-copy-to-clipboard'; import { Button, Card, Columar, Column, Input, InputAddress, Tabs, Tooltip } from '@polkadot/react-components'; -import { useApi, useCall } from '@polkadot/react-hooks'; import { TokenUnit } from '@polkadot/react-components/InputNumber'; +import { useApi, useCall } from '@polkadot/react-hooks'; import { u8aToHex, u8aToString } from '@polkadot/util'; import { decodeAddress } from '@polkadot/util-crypto'; -import { useTranslation } from './translate'; -import { recoverFromJSON, getStatement } from './util'; import AttestDisplay from './Attest'; import ClaimDisplay from './Claim'; import Statement from './Statement'; +import { useTranslation } from './translate'; +import { getStatement, recoverFromJSON } from './util'; import Warning from './Warning'; export { default as useCounter } from './useCounter'; diff --git a/packages/page-claims/src/usePolkadotPreclaims.ts b/packages/page-claims/src/usePolkadotPreclaims.ts index a365dae513..e20c9d575f 100644 --- a/packages/page-claims/src/usePolkadotPreclaims.ts +++ b/packages/page-claims/src/usePolkadotPreclaims.ts @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-settings authors & contributors // SPDX-License-Identifier: Apache-2.0 +import { useEffect, useState } from 'react'; + import type { QueryableStorageEntry } from '@polkadot/api/types'; import type { Option } from '@polkadot/types'; -import type { Codec } from '@polkadot/types/types'; import type { EthereumAddress } from '@polkadot/types/interfaces'; - -import { useEffect, useState } from 'react'; +import type { Codec } from '@polkadot/types/types'; import { useAccounts, useApi, useCall, useIsMountedRef } from '@polkadot/react-hooks'; export default function usePolkadotPreclaims (): string[] { diff --git a/packages/page-claims/src/util.ts b/packages/page-claims/src/util.ts index 9c2fc6b306..5eace5bf67 100644 --- a/packages/page-claims/src/util.ts +++ b/packages/page-claims/src/util.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-claims authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { EthereumAddress, EcdsaSignature, StatementKind } from '@polkadot/types/interfaces'; - import secp256k1 from 'secp256k1/elliptic'; + +import type { EcdsaSignature, EthereumAddress, StatementKind } from '@polkadot/types/interfaces'; import registry from '@polkadot/react-api/typeRegistry'; -import { assert, hexToU8a, stringToU8a, u8aToBuffer, u8aConcat } from '@polkadot/util'; +import { assert, hexToU8a, stringToU8a, u8aConcat, u8aToBuffer } from '@polkadot/util'; import { keccakAsHex, keccakAsU8a } from '@polkadot/util-crypto'; interface RecoveredSignature { diff --git a/packages/page-contracts/src/Banner.tsx b/packages/page-contracts/src/Banner.tsx index bf29b7ec2a..bb41d2b22f 100644 --- a/packages/page-contracts/src/Banner.tsx +++ b/packages/page-contracts/src/Banner.tsx @@ -3,6 +3,7 @@ import React from 'react'; import styled from 'styled-components'; + import { Button } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-contracts/src/Codes/Add.tsx b/packages/page-contracts/src/Codes/Add.tsx index d8ae16177d..2d69fa2e37 100644 --- a/packages/page-contracts/src/Codes/Add.tsx +++ b/packages/page-contracts/src/Codes/Add.tsx @@ -1,17 +1,17 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { StringOrNull } from '@polkadot/react-components/types'; - import React, { useCallback, useState } from 'react'; + +import type { StringOrNull } from '@polkadot/react-components/types'; import { Button, Input, Modal } from '@polkadot/react-components'; import { isNull } from '@polkadot/util'; -import { ABI, InputName } from '../shared'; -import ValidateCode from './ValidateCode'; +import { ABI, InputName } from '../shared'; import store from '../store'; import { useTranslation } from '../translate'; import useAbi from '../useAbi'; +import ValidateCode from './ValidateCode'; interface Props { onClose: () => void; diff --git a/packages/page-contracts/src/Codes/Code.tsx b/packages/page-contracts/src/Codes/Code.tsx index ef3d0cc157..d79a8ab1ea 100644 --- a/packages/page-contracts/src/Codes/Code.tsx +++ b/packages/page-contracts/src/Codes/Code.tsx @@ -1,19 +1,19 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Option } from '@polkadot/types'; -import type { Codec } from '@polkadot/types/types'; -import type { CodeStored } from '../types'; - import React, { useCallback } from 'react'; import styled from 'styled-components'; + +import type { Option } from '@polkadot/types'; +import type { Codec } from '@polkadot/types/types'; import { Button, Card, CopyButton, Forget } from '@polkadot/react-components'; import { useApi, useCall, useToggle } from '@polkadot/react-hooks'; +import type { CodeStored } from '../types'; import { CodeRow, Messages } from '../shared'; import store from '../store'; -import useAbi from '../useAbi'; import { useTranslation } from '../translate'; +import useAbi from '../useAbi'; interface Props { className?: string; diff --git a/packages/page-contracts/src/Codes/Upload.tsx b/packages/page-contracts/src/Codes/Upload.tsx index 5eb5424d19..ee9dc41c06 100644 --- a/packages/page-contracts/src/Codes/Upload.tsx +++ b/packages/page-contracts/src/Codes/Upload.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SubmittableExtrinsic } from '@polkadot/api/types'; -import type { CodeSubmittableResult } from '@polkadot/api-contract/promise/types'; - import React, { useCallback, useEffect, useMemo, useState } from 'react'; + +import type { CodeSubmittableResult } from '@polkadot/api-contract/promise/types'; +import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { CodePromise } from '@polkadot/api-contract'; import { InputAddress, InputFile, Modal, TxButton } from '@polkadot/react-components'; import { useAccountId, useApi, useNonEmptyString } from '@polkadot/react-hooks'; diff --git a/packages/page-contracts/src/Codes/ValidateCode.tsx b/packages/page-contracts/src/Codes/ValidateCode.tsx index ba7412bb97..2d755b0240 100644 --- a/packages/page-contracts/src/Codes/ValidateCode.tsx +++ b/packages/page-contracts/src/Codes/ValidateCode.tsx @@ -3,10 +3,10 @@ /* eslint-disable camelcase */ +import React, { useMemo } from 'react'; + import type { Option } from '@polkadot/types'; import type { PrefabWasmModule } from '@polkadot/types/interfaces'; - -import React, { useMemo } from 'react'; import { InfoForInput } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { isHex } from '@polkadot/util'; diff --git a/packages/page-contracts/src/Codes/index.tsx b/packages/page-contracts/src/Codes/index.tsx index 98621af921..58ed917a8d 100644 --- a/packages/page-contracts/src/Codes/index.tsx +++ b/packages/page-contracts/src/Codes/index.tsx @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import React, { useRef } from 'react'; + import { Table } from '@polkadot/react-components'; import contracts from '../store'; import { useTranslation } from '../translate'; - import Code from './Code'; interface Props { diff --git a/packages/page-contracts/src/Contracts/Add.tsx b/packages/page-contracts/src/Contracts/Add.tsx index dd67e5bac9..42e06fce65 100644 --- a/packages/page-contracts/src/Contracts/Add.tsx +++ b/packages/page-contracts/src/Contracts/Add.tsx @@ -1,18 +1,18 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { StringOrNull } from '@polkadot/react-components/types'; -import type { ActionStatus } from '@polkadot/react-components/Status/types'; - import React, { useCallback, useState } from 'react'; + +import type { ActionStatus } from '@polkadot/react-components/Status/types'; +import type { StringOrNull } from '@polkadot/react-components/types'; import { AddressRow, Button, Input, Modal } from '@polkadot/react-components'; import { useApi, useNonEmptyString } from '@polkadot/react-hooks'; import keyring from '@polkadot/ui-keyring'; -import ValidateAddr from './ValidateAddr'; import { ABI, InputName } from '../shared'; import { useTranslation } from '../translate'; import useAbi from '../useAbi'; +import ValidateAddr from './ValidateAddr'; interface Props { onClose: () => void; diff --git a/packages/page-contracts/src/Contracts/Call.tsx b/packages/page-contracts/src/Contracts/Call.tsx index 694f931521..52c8b138fa 100644 --- a/packages/page-contracts/src/Contracts/Call.tsx +++ b/packages/page-contracts/src/Contracts/Call.tsx @@ -1,24 +1,24 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SubmittableExtrinsic } from '@polkadot/api/types'; -import type { ContractCallOutcome } from '@polkadot/api-contract/types'; -import type { CallResult } from './types'; - import BN from 'bn.js'; -import React, { useCallback, useState, useEffect } from 'react'; +import React, { useCallback, useEffect, useState } from 'react'; import styled from 'styled-components'; -import { Button, Dropdown, Expander, InputAddress, InputBalance, Modal, Toggle, TxButton } from '@polkadot/react-components'; + +import type { ContractCallOutcome } from '@polkadot/api-contract/types'; +import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { ContractPromise } from '@polkadot/api-contract'; +import { Button, Dropdown, Expander, InputAddress, InputBalance, Modal, Toggle, TxButton } from '@polkadot/react-components'; import { useAccountId, useDebounce, useFormField, useToggle } from '@polkadot/react-hooks'; import { Available } from '@polkadot/react-query'; import { BN_ZERO } from '@polkadot/util'; +import type { CallResult } from './types'; import { InputMegaGas, Params } from '../shared'; -import Outcome from './Outcome'; import { useTranslation } from '../translate'; -import { getCallMessageOptions } from './util'; import useWeight from '../useWeight'; +import Outcome from './Outcome'; +import { getCallMessageOptions } from './util'; interface Props { className?: string; diff --git a/packages/page-contracts/src/Contracts/Contract.tsx b/packages/page-contracts/src/Contracts/Contract.tsx index 89ea358b55..dd7c052868 100644 --- a/packages/page-contracts/src/Contracts/Contract.tsx +++ b/packages/page-contracts/src/Contracts/Contract.tsx @@ -1,20 +1,20 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useCallback, useEffect, useState } from 'react'; + import type { ContractCallOutcome } from '@polkadot/api-contract/types'; import type { ActionStatus } from '@polkadot/react-components/Status/types'; import type { Option } from '@polkadot/types'; import type { BlockNumber, ContractInfo } from '@polkadot/types/interfaces'; -import type { ContractLink } from './types'; - -import React, { useCallback, useEffect, useState } from 'react'; -import keyring from '@polkadot/ui-keyring'; import { ContractPromise } from '@polkadot/api-contract'; import { AddressInfo, AddressMini, Button, Forget } from '@polkadot/react-components'; import { useApi, useCall, useToggle } from '@polkadot/react-hooks'; import { BlockToTime } from '@polkadot/react-query'; +import keyring from '@polkadot/ui-keyring'; import { formatNumber, isFunction, isUndefined } from '@polkadot/util'; +import type { ContractLink } from './types'; import Messages from '../shared/Messages'; import { useTranslation } from '../translate'; diff --git a/packages/page-contracts/src/Contracts/Outcome.tsx b/packages/page-contracts/src/Contracts/Outcome.tsx index 669cad246f..c70816bf33 100644 --- a/packages/page-contracts/src/Contracts/Outcome.tsx +++ b/packages/page-contracts/src/Contracts/Outcome.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { CallResult } from './types'; - import React from 'react'; import styled from 'styled-components'; + import { Button, IdentityIcon, Output } from '@polkadot/react-components'; import valueToText from '@polkadot/react-params/valueToText'; +import type { CallResult } from './types'; import MessageSignature from '../shared/MessageSignature'; interface Props { diff --git a/packages/page-contracts/src/Contracts/ValidateAddr.tsx b/packages/page-contracts/src/Contracts/ValidateAddr.tsx index 87cf9ae413..2a6ec2cd9b 100644 --- a/packages/page-contracts/src/Contracts/ValidateAddr.tsx +++ b/packages/page-contracts/src/Contracts/ValidateAddr.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useEffect, useState } from 'react'; + import type { Option } from '@polkadot/types'; import type { ContractInfo } from '@polkadot/types/interfaces'; - -import React, { useEffect, useState } from 'react'; -import { useApi, useCall } from '@polkadot/react-hooks'; import { InfoForInput } from '@polkadot/react-components'; +import { useApi, useCall } from '@polkadot/react-hooks'; import keyring from '@polkadot/ui-keyring'; import { useTranslation } from '../translate'; diff --git a/packages/page-contracts/src/Contracts/index.tsx b/packages/page-contracts/src/Contracts/index.tsx index f405e96fd1..0703b62860 100644 --- a/packages/page-contracts/src/Contracts/index.tsx +++ b/packages/page-contracts/src/Contracts/index.tsx @@ -1,20 +1,20 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; + import type { ContractCallOutcome } from '@polkadot/api-contract/types'; import type { FullNewBlock } from '@polkadot/api-derive/types'; -import type { ContractLink } from './types'; - -import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { ApiPromise } from '@polkadot/api'; import { ContractPromise } from '@polkadot/api-contract'; import { Table } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; +import type { ContractLink } from './types'; import { useTranslation } from '../translate'; -import Contract from './Contract'; import Call from './Call'; +import Contract from './Contract'; import { getContractForAddress } from './util'; export interface Props { diff --git a/packages/page-contracts/src/Contracts/util.tsx b/packages/page-contracts/src/Contracts/util.tsx index 44234b2fd1..4a1aaeba13 100644 --- a/packages/page-contracts/src/Contracts/util.tsx +++ b/packages/page-contracts/src/Contracts/util.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React from 'react'; + import type { AbiMessage } from '@polkadot/api-contract/types'; import type { StringOrNull } from '@polkadot/react-components/types'; - -import React from 'react'; import { ApiPromise } from '@polkadot/api'; import { ContractPromise as Contract } from '@polkadot/api-contract'; import { getContractAbi } from '@polkadot/react-components/util'; diff --git a/packages/page-contracts/src/Deploy.tsx b/packages/page-contracts/src/Deploy.tsx index ef658d9181..fd68b949c4 100644 --- a/packages/page-contracts/src/Deploy.tsx +++ b/packages/page-contracts/src/Deploy.tsx @@ -1,26 +1,26 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SubmittableExtrinsic } from '@polkadot/api/types'; -import type { BlueprintSubmittableResult } from '@polkadot/api-contract/promise/types'; -import type { StringOrNull } from '@polkadot/react-components/types'; - import BN from 'bn.js'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; + +import type { BlueprintSubmittableResult } from '@polkadot/api-contract/promise/types'; +import type { SubmittableExtrinsic } from '@polkadot/api/types'; +import type { StringOrNull } from '@polkadot/react-components/types'; import { BlueprintPromise } from '@polkadot/api-contract'; import { Dropdown, Input, InputAddress, InputBalance, Modal, Toggle, TxButton } from '@polkadot/react-components'; -import { useFormField, useNonEmptyString, useNonZeroBn, useApi } from '@polkadot/react-hooks'; +import { useApi, useFormField, useNonEmptyString, useNonZeroBn } from '@polkadot/react-hooks'; import { Available } from '@polkadot/react-query'; import keyring from '@polkadot/ui-keyring'; import { isHex } from '@polkadot/util'; import { randomAsHex } from '@polkadot/util-crypto'; +import { ENDOWMENT } from './constants'; import { ABI, InputMegaGas, InputName, MessageSignature, Params } from './shared'; import store from './store'; import { useTranslation } from './translate'; import useAbi from './useAbi'; import useWeight from './useWeight'; -import { ENDOWMENT } from './constants'; interface Props { codeHash: string; diff --git a/packages/page-contracts/src/RemoveABI.tsx b/packages/page-contracts/src/RemoveABI.tsx index b6382add0c..c9a0faf535 100644 --- a/packages/page-contracts/src/RemoveABI.tsx +++ b/packages/page-contracts/src/RemoveABI.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { CodeStored } from './types'; - import React, { useCallback } from 'react'; + import { Button, Modal } from '@polkadot/react-components'; +import type { CodeStored } from './types'; import CodeRow from './shared/CodeRow'; import { useTranslation } from './translate'; diff --git a/packages/page-contracts/src/Summary.tsx b/packages/page-contracts/src/Summary.tsx index 84976ca71c..83126b102d 100644 --- a/packages/page-contracts/src/Summary.tsx +++ b/packages/page-contracts/src/Summary.tsx @@ -3,7 +3,8 @@ import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; -import { SummaryBox, CardSummary } from '@polkadot/react-components'; + +import { CardSummary, SummaryBox } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/page-contracts/src/index.tsx b/packages/page-contracts/src/index.tsx index f39de76842..45caf862d5 100644 --- a/packages/page-contracts/src/index.tsx +++ b/packages/page-contracts/src/index.tsx @@ -1,22 +1,22 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AppProps as Props } from '@polkadot/react-components/types'; - import React, { useCallback, useEffect, useRef, useState } from 'react'; import styled from 'styled-components'; + +import type { AppProps as Props } from '@polkadot/react-components/types'; import { Button, HelpOverlay, Tabs } from '@polkadot/react-components'; import { useContracts, useToggle } from '@polkadot/react-hooks'; -import introMd from './md/intro.md'; -import store from './store'; -import Contracts from './Contracts'; -import ContractAdd from './Contracts/Add'; import Banner from './Banner'; import Codes from './Codes'; import CodeAdd from './Codes/Add'; import CodeUpload from './Codes/Upload'; +import Contracts from './Contracts'; +import ContractAdd from './Contracts/Add'; import Deploy from './Deploy'; +import introMd from './md/intro.md'; +import store from './store'; import Summary from './Summary'; import { useTranslation } from './translate'; diff --git a/packages/page-contracts/src/shared/ABI.tsx b/packages/page-contracts/src/shared/ABI.tsx index fe395d5b81..ef97a43766 100644 --- a/packages/page-contracts/src/shared/ABI.tsx +++ b/packages/page-contracts/src/shared/ABI.tsx @@ -2,11 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 import React from 'react'; + import { Abi } from '@polkadot/api-contract'; import { IconLink, InputFile, Labelled } from '@polkadot/react-components'; -import Messages from './Messages'; import { useTranslation } from '../translate'; +import Messages from './Messages'; interface Props { className?: string; diff --git a/packages/page-contracts/src/shared/CodeRow.tsx b/packages/page-contracts/src/shared/CodeRow.tsx index c6e761b595..474737d452 100644 --- a/packages/page-contracts/src/shared/CodeRow.tsx +++ b/packages/page-contracts/src/shared/CodeRow.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { CodeStored } from '../types'; - import React, { useCallback, useEffect, useState } from 'react'; import styled from 'styled-components'; -import { registry } from '@polkadot/react-api'; -import Row from '@polkadot/react-components/Row'; -import { Icon } from '@polkadot/react-components'; +import { registry } from '@polkadot/react-api'; +import { Icon } from '@polkadot/react-components'; +import Row from '@polkadot/react-components/Row'; + +import type { CodeStored } from '../types'; import contracts from '../store'; interface Props { diff --git a/packages/page-contracts/src/shared/InputMegaGas.tsx b/packages/page-contracts/src/shared/InputMegaGas.tsx index 16b0795e4d..db7ffb0bb7 100644 --- a/packages/page-contracts/src/shared/InputMegaGas.tsx +++ b/packages/page-contracts/src/shared/InputMegaGas.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { UseWeight } from '../types'; - import BN from 'bn.js'; import React, { useEffect, useMemo, useState } from 'react'; import styled from 'styled-components'; + import { InputNumber, Toggle } from '@polkadot/react-components'; import { BN_ZERO } from '@polkadot/util'; +import type { UseWeight } from '../types'; import { useTranslation } from '../translate'; interface Props { diff --git a/packages/page-contracts/src/shared/InputName.tsx b/packages/page-contracts/src/shared/InputName.tsx index 707941097e..82fe2c1342 100644 --- a/packages/page-contracts/src/shared/InputName.tsx +++ b/packages/page-contracts/src/shared/InputName.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { VoidFn } from '@polkadot/react-components/types'; - import React from 'react'; + +import type { VoidFn } from '@polkadot/react-components/types'; import { Input } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-contracts/src/shared/Message.tsx b/packages/page-contracts/src/shared/Message.tsx index 0fbf96b5ed..d564a71a1b 100644 --- a/packages/page-contracts/src/shared/Message.tsx +++ b/packages/page-contracts/src/shared/Message.tsx @@ -1,15 +1,15 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AbiConstructor, AbiMessage, ContractCallOutcome } from '@polkadot/api-contract/types'; - import React, { useCallback } from 'react'; import styled from 'styled-components'; + +import type { AbiConstructor, AbiMessage, ContractCallOutcome } from '@polkadot/api-contract/types'; import { Button, Output } from '@polkadot/react-components'; import valueToText from '@polkadot/react-params/valueToText'; -import MessageSignature from './MessageSignature'; import { useTranslation } from '../translate'; +import MessageSignature from './MessageSignature'; export interface Props { className?: string; diff --git a/packages/page-contracts/src/shared/MessageSignature.tsx b/packages/page-contracts/src/shared/MessageSignature.tsx index e892b2d999..59c27c15b6 100644 --- a/packages/page-contracts/src/shared/MessageSignature.tsx +++ b/packages/page-contracts/src/shared/MessageSignature.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AbiMessage } from '@polkadot/api-contract/types'; -import type { ThemeProps } from '@polkadot/react-components/types'; - import React from 'react'; import styled from 'styled-components'; + +import type { AbiMessage } from '@polkadot/api-contract/types'; +import type { ThemeProps } from '@polkadot/react-components/types'; import { Icon, Tooltip } from '@polkadot/react-components'; import { encodeTypeDef } from '@polkadot/types/create'; import { stringCamelCase } from '@polkadot/util'; diff --git a/packages/page-contracts/src/shared/Messages.tsx b/packages/page-contracts/src/shared/Messages.tsx index fa0db9654f..0eeec92457 100644 --- a/packages/page-contracts/src/shared/Messages.tsx +++ b/packages/page-contracts/src/shared/Messages.tsx @@ -1,20 +1,20 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AbiMessage, ContractCallOutcome } from '@polkadot/api-contract/types'; -import type { Option } from '@polkadot/types'; -import type { ContractInfo } from '@polkadot/types/interfaces'; -import type { ThemeProps } from '@polkadot/react-components/types'; - import React, { useCallback, useEffect, useState } from 'react'; import styled from 'styled-components'; + +import type { AbiMessage, ContractCallOutcome } from '@polkadot/api-contract/types'; +import type { ThemeProps } from '@polkadot/react-components/types'; +import type { Option } from '@polkadot/types'; +import type { ContractInfo } from '@polkadot/types/interfaces'; import { Abi, ContractPromise } from '@polkadot/api-contract'; import { Expander } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; -import Message from './Message'; import { useTranslation } from '../translate'; +import Message from './Message'; export interface Props { className?: string; diff --git a/packages/page-contracts/src/shared/Params.tsx b/packages/page-contracts/src/shared/Params.tsx index bb7b12a8d6..6d256e8db3 100644 --- a/packages/page-contracts/src/shared/Params.tsx +++ b/packages/page-contracts/src/shared/Params.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Registry, TypeDef } from '@polkadot/types/types'; -import type { RawParams } from '@polkadot/react-params/types'; - import React, { useCallback, useEffect, useState } from 'react'; + +import type { RawParams } from '@polkadot/react-params/types'; +import type { Registry, TypeDef } from '@polkadot/types/types'; import UIParams from '@polkadot/react-params'; interface Props { diff --git a/packages/page-contracts/src/store.ts b/packages/page-contracts/src/store.ts index 4ce472291a..cdd84827fe 100644 --- a/packages/page-contracts/src/store.ts +++ b/packages/page-contracts/src/store.ts @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Hash } from '@polkadot/types/interfaces'; -import type { CodeJson, CodeStored } from './types'; - import EventEmitter from 'eventemitter3'; import store from 'store'; + +import type { Hash } from '@polkadot/types/interfaces'; import { Abi } from '@polkadot/api-contract'; import { api, registry } from '@polkadot/react-api'; +import type { CodeJson, CodeStored } from './types'; + const KEY_CODE = 'code:'; class Store extends EventEmitter { diff --git a/packages/page-contracts/src/types.ts b/packages/page-contracts/src/types.ts index a86c91aacb..e9ba81d23e 100644 --- a/packages/page-contracts/src/types.ts +++ b/packages/page-contracts/src/types.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import BN from 'bn.js'; + import { Abi } from '@polkadot/api-contract'; export interface CodeJson { diff --git a/packages/page-contracts/src/useAbi.ts b/packages/page-contracts/src/useAbi.ts index da3c583643..af8c4de1c8 100644 --- a/packages/page-contracts/src/useAbi.ts +++ b/packages/page-contracts/src/useAbi.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { StringOrNull } from '@polkadot/react-components/types'; - import { useCallback, useEffect, useState } from 'react'; + +import type { StringOrNull } from '@polkadot/react-components/types'; import { Abi } from '@polkadot/api-contract'; import { api } from '@polkadot/react-api'; import { u8aToString } from '@polkadot/util'; diff --git a/packages/page-contracts/src/useWeight.ts b/packages/page-contracts/src/useWeight.ts index fdb837bdf8..8742567195 100644 --- a/packages/page-contracts/src/useWeight.ts +++ b/packages/page-contracts/src/useWeight.ts @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { UseWeight } from './types'; - import BN from 'bn.js'; import { useCallback, useMemo, useState } from 'react'; + import { useApi, useBlockTime } from '@polkadot/react-hooks'; import { BN_TEN, BN_ZERO } from '@polkadot/util'; +import type { UseWeight } from './types'; + const BN_MILLION = new BN(1_000_000); export default function useWeight (): UseWeight { diff --git a/packages/page-council/src/Motions/Close.tsx b/packages/page-council/src/Motions/Close.tsx index 059cd579c5..23240bd359 100644 --- a/packages/page-council/src/Motions/Close.tsx +++ b/packages/page-council/src/Motions/Close.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-council authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Hash, Proposal, ProposalIndex } from '@polkadot/types/interfaces'; - import React, { useState } from 'react'; + +import type { Hash, Proposal, ProposalIndex } from '@polkadot/types/interfaces'; import { Button, InputAddress, Modal, ProposedAction, TxButton } from '@polkadot/react-components'; import { useApi, useToggle, useWeight } from '@polkadot/react-hooks'; diff --git a/packages/page-council/src/Motions/Motion.tsx b/packages/page-council/src/Motions/Motion.tsx index e6e41b9c1c..0efa370c86 100644 --- a/packages/page-council/src/Motions/Motion.tsx +++ b/packages/page-council/src/Motions/Motion.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-council authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AccountId } from '@polkadot/types/interfaces'; -import type { DeriveCollectiveProposal } from '@polkadot/api-derive/types'; - import React, { useMemo } from 'react'; + +import type { DeriveCollectiveProposal } from '@polkadot/api-derive/types'; +import type { AccountId } from '@polkadot/types/interfaces'; import ProposalCell from '@polkadot/app-democracy/Overview/ProposalCell'; import { Icon, LinkExternal, TxButton } from '@polkadot/react-components'; import { useAccounts, useApi, useVotingStatus, useWeight } from '@polkadot/react-hooks'; diff --git a/packages/page-council/src/Motions/ProposeExternal.tsx b/packages/page-council/src/Motions/ProposeExternal.tsx index 60a2274893..666e5d42f9 100644 --- a/packages/page-council/src/Motions/ProposeExternal.tsx +++ b/packages/page-council/src/Motions/ProposeExternal.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-council authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SubmittableExtrinsic } from '@polkadot/api/types'; - import React, { useCallback, useEffect, useState } from 'react'; + +import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { getProposalThreshold } from '@polkadot/apps-config'; import { Button, Input, InputAddress, Modal, TxButton } from '@polkadot/react-components'; import { useApi, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-council/src/Motions/ProposeMotion.tsx b/packages/page-council/src/Motions/ProposeMotion.tsx index 0ee242e00a..fd4129ac97 100644 --- a/packages/page-council/src/Motions/ProposeMotion.tsx +++ b/packages/page-council/src/Motions/ProposeMotion.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-council authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SubmittableExtrinsic } from '@polkadot/api/types'; - import BN from 'bn.js'; import React, { useCallback, useEffect, useState } from 'react'; + +import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { getProposalThreshold } from '@polkadot/apps-config'; import { Button, Extrinsic, InputAddress, InputNumber, Modal, TxButton } from '@polkadot/react-components'; import { useApi, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-council/src/Motions/Slashing.tsx b/packages/page-council/src/Motions/Slashing.tsx index d6c14add78..f2783fc06e 100644 --- a/packages/page-council/src/Motions/Slashing.tsx +++ b/packages/page-council/src/Motions/Slashing.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-council authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SubmittableExtrinsic } from '@polkadot/api/types'; - import React, { useEffect, useMemo, useState } from 'react'; + +import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { getSlashProposalThreshold } from '@polkadot/apps-config'; import { Button, Dropdown, Input, InputAddress, Modal, TxButton } from '@polkadot/react-components'; import { useApi, useAvailableSlashes, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-council/src/Motions/Voters.tsx b/packages/page-council/src/Motions/Voters.tsx index 14a4701303..897614b86a 100644 --- a/packages/page-council/src/Motions/Voters.tsx +++ b/packages/page-council/src/Motions/Voters.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AccountId, MemberCount } from '@polkadot/types/interfaces'; - import React, { useMemo } from 'react'; + +import type { AccountId, MemberCount } from '@polkadot/types/interfaces'; import { AddressMini, Expander } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-council/src/Motions/Voting.tsx b/packages/page-council/src/Motions/Voting.tsx index 959417c418..611492da08 100644 --- a/packages/page-council/src/Motions/Voting.tsx +++ b/packages/page-council/src/Motions/Voting.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-council authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AccountId, Hash, Proposal, ProposalIndex } from '@polkadot/types/interfaces'; - import React, { useState } from 'react'; + +import type { AccountId, Hash, Proposal, ProposalIndex } from '@polkadot/types/interfaces'; import { Button, Modal, ProposedAction, TxButton, VoteAccount } from '@polkadot/react-components'; import { useAccounts, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-council/src/Motions/index.tsx b/packages/page-council/src/Motions/index.tsx index edc61a9abc..c28d0d24ed 100644 --- a/packages/page-council/src/Motions/index.tsx +++ b/packages/page-council/src/Motions/index.tsx @@ -1,17 +1,17 @@ // Copyright 2017-2020 @polkadot/app-council authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useRef } from 'react'; + import type { DeriveCollectiveProposal } from '@polkadot/api-derive/types'; import type { AccountId } from '@polkadot/types/interfaces'; - -import React, { useRef } from 'react'; import { Button, Table } from '@polkadot/react-components'; import { useMembers } from '@polkadot/react-hooks'; import { useTranslation } from '../translate'; import Motion from './Motion'; -import ProposeMotion from './ProposeMotion'; import ProposeExternal from './ProposeExternal'; +import ProposeMotion from './ProposeMotion'; import Slashing from './Slashing'; interface Props { diff --git a/packages/page-council/src/Overview/Candidate.tsx b/packages/page-council/src/Overview/Candidate.tsx index e2b546762f..39a3414946 100644 --- a/packages/page-council/src/Overview/Candidate.tsx +++ b/packages/page-council/src/Overview/Candidate.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AccountId, Balance } from '@polkadot/types/interfaces'; - import React from 'react'; + +import type { AccountId, Balance } from '@polkadot/types/interfaces'; import { AddressSmall, Tag } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-council/src/Overview/Candidates.tsx b/packages/page-council/src/Overview/Candidates.tsx index 3fe3950129..95c2de158e 100644 --- a/packages/page-council/src/Overview/Candidates.tsx +++ b/packages/page-council/src/Overview/Candidates.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useRef } from 'react'; + import type { DeriveElectionsInfo } from '@polkadot/api-derive/types'; import type { AccountId } from '@polkadot/types/interfaces'; - -import React, { useRef } from 'react'; import { Table } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-council/src/Overview/Members.tsx b/packages/page-council/src/Overview/Members.tsx index 4324bea7d3..0662e99c0c 100644 --- a/packages/page-council/src/Overview/Members.tsx +++ b/packages/page-council/src/Overview/Members.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useRef } from 'react'; + import type { DeriveElectionsInfo } from '@polkadot/api-derive/types'; import type { AccountId } from '@polkadot/types/interfaces'; - -import React, { useRef } from 'react'; import { Table } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-council/src/Overview/SubmitCandidacy.tsx b/packages/page-council/src/Overview/SubmitCandidacy.tsx index 9b9851cfa7..ea428d66c8 100644 --- a/packages/page-council/src/Overview/SubmitCandidacy.tsx +++ b/packages/page-council/src/Overview/SubmitCandidacy.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-council authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ComponentProps as Props } from './types'; - import React, { useState } from 'react'; + import { Button, InputAddress, InputBalance, Modal, TxButton } from '@polkadot/react-components'; import { useApi, useModal } from '@polkadot/react-hooks'; +import type { ComponentProps as Props } from './types'; import { useTranslation } from '../translate'; function SubmitCandidacy ({ electionsInfo }: Props): React.ReactElement { diff --git a/packages/page-council/src/Overview/Summary.tsx b/packages/page-council/src/Overview/Summary.tsx index 3a07138b4c..7d1d3b2072 100644 --- a/packages/page-council/src/Overview/Summary.tsx +++ b/packages/page-council/src/Overview/Summary.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React from 'react'; + import type { DeriveElectionsInfo } from '@polkadot/api-derive/types'; import type { BlockNumber } from '@polkadot/types/interfaces'; -import type { ComponentProps } from './types'; - -import React from 'react'; -import { SummaryBox, CardSummary } from '@polkadot/react-components'; +import { CardSummary, SummaryBox } from '@polkadot/react-components'; import { formatNumber } from '@polkadot/util'; +import type { ComponentProps } from './types'; import { useTranslation } from '../translate'; interface Props extends ComponentProps { diff --git a/packages/page-council/src/Overview/Vote.tsx b/packages/page-council/src/Overview/Vote.tsx index 4528830d26..df83dadef2 100644 --- a/packages/page-council/src/Overview/Vote.tsx +++ b/packages/page-council/src/Overview/Vote.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-council authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveElectionsInfo } from '@polkadot/api-derive/types'; - import React, { useEffect, useState } from 'react'; + +import type { DeriveElectionsInfo } from '@polkadot/api-derive/types'; import { Button, InputAddress, InputAddressMulti, Modal, TxButton, VoteValue } from '@polkadot/react-components'; import { useApi, useToggle } from '@polkadot/react-hooks'; import { BN_ZERO } from '@polkadot/util'; diff --git a/packages/page-council/src/Overview/Voters.tsx b/packages/page-council/src/Overview/Voters.tsx index b0ccdc9b21..4cab21aea3 100644 --- a/packages/page-council/src/Overview/Voters.tsx +++ b/packages/page-council/src/Overview/Voters.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AccountId, Balance } from '@polkadot/types/interfaces'; - import React from 'react'; + +import type { AccountId, Balance } from '@polkadot/types/interfaces'; import { AddressMini, Expander } from '@polkadot/react-components'; import { FormatBalance } from '@polkadot/react-query'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/page-council/src/Overview/index.tsx b/packages/page-council/src/Overview/index.tsx index df6e20c5f2..3b5b9ac9b4 100644 --- a/packages/page-council/src/Overview/index.tsx +++ b/packages/page-council/src/Overview/index.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React from 'react'; + import type { DeriveCouncilVotes, DeriveElectionsInfo } from '@polkadot/api-derive/types'; import type { AccountId, BlockNumber } from '@polkadot/types/interfaces'; - -import React from 'react'; import { Button } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-council/src/Overview/types.ts b/packages/page-council/src/Overview/types.ts index 4c6a32999a..162d43eea1 100644 --- a/packages/page-council/src/Overview/types.ts +++ b/packages/page-council/src/Overview/types.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SetIndex } from '@polkadot/types/interfaces'; -import type { DeriveElectionsInfo } from '@polkadot/api-derive/types'; - import BN from 'bn.js'; +import type { DeriveElectionsInfo } from '@polkadot/api-derive/types'; +import type { SetIndex } from '@polkadot/types/interfaces'; + export interface ComponentProps { electionsInfo?: DeriveElectionsInfo; } diff --git a/packages/page-council/src/index.tsx b/packages/page-council/src/index.tsx index 29ec7dd0b4..dd747fd452 100644 --- a/packages/page-council/src/index.tsx +++ b/packages/page-council/src/index.tsx @@ -1,21 +1,21 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Option } from '@polkadot/types'; -import type { AccountId } from '@polkadot/types/interfaces'; -import type { DeriveCollectiveProposal } from '@polkadot/api-derive/types'; - import React, { useMemo } from 'react'; import { Route, Switch } from 'react-router'; import { useLocation } from 'react-router-dom'; import styled from 'styled-components'; + +import type { DeriveCollectiveProposal } from '@polkadot/api-derive/types'; +import type { Option } from '@polkadot/types'; +import type { AccountId } from '@polkadot/types/interfaces'; import { Tabs } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; -import useCounter from './useCounter'; -import Overview from './Overview'; import Motions from './Motions'; +import Overview from './Overview'; import { useTranslation } from './translate'; +import useCounter from './useCounter'; export { useCounter }; diff --git a/packages/page-council/src/useCounter.ts b/packages/page-council/src/useCounter.ts index 66f3e3cd53..3d9d13280b 100644 --- a/packages/page-council/src/useCounter.ts +++ b/packages/page-council/src/useCounter.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import type { DeriveCollectiveProposal } from '@polkadot/api-derive/types'; - import { useAccounts, useApi, useCall } from '@polkadot/react-hooks'; const transformCounter = { diff --git a/packages/page-democracy/src/Execute/DispatchEntry.tsx b/packages/page-democracy/src/Execute/DispatchEntry.tsx index 032058f782..e38b2af7e3 100644 --- a/packages/page-democracy/src/Execute/DispatchEntry.tsx +++ b/packages/page-democracy/src/Execute/DispatchEntry.tsx @@ -1,17 +1,17 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React from 'react'; + import type { DeriveDispatch } from '@polkadot/api-derive/types'; import type { BlockNumber } from '@polkadot/types/interfaces'; - -import React from 'react'; import { LinkExternal } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BlockToTime } from '@polkadot/react-query'; import { formatNumber } from '@polkadot/util'; -import ProposalCell from '../Overview/ProposalCell'; import PreImageButton from '../Overview/PreImageButton'; +import ProposalCell from '../Overview/ProposalCell'; interface Props { value: DeriveDispatch; diff --git a/packages/page-democracy/src/Execute/DispatchQueue.tsx b/packages/page-democracy/src/Execute/DispatchQueue.tsx index 5b7aca10a4..7b87dfced4 100644 --- a/packages/page-democracy/src/Execute/DispatchQueue.tsx +++ b/packages/page-democracy/src/Execute/DispatchQueue.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveDispatch } from '@polkadot/api-derive/types'; - import React, { useRef } from 'react'; + +import type { DeriveDispatch } from '@polkadot/api-derive/types'; import { Table } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-democracy/src/Execute/Scheduled.tsx b/packages/page-democracy/src/Execute/Scheduled.tsx index 8bb0cccc54..e16b91bfb7 100644 --- a/packages/page-democracy/src/Execute/Scheduled.tsx +++ b/packages/page-democracy/src/Execute/Scheduled.tsx @@ -1,15 +1,16 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { BlockNumber } from '@polkadot/types/interfaces'; -import type { ScheduledExt } from './types'; - import React from 'react'; + +import type { BlockNumber } from '@polkadot/types/interfaces'; import { CallExpander } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BlockToTime } from '@polkadot/react-query'; import { formatNumber } from '@polkadot/util'; +import type { ScheduledExt } from './types'; + interface Props { className?: string; value: ScheduledExt; diff --git a/packages/page-democracy/src/Execute/Scheduler.tsx b/packages/page-democracy/src/Execute/Scheduler.tsx index 70bc4cacb2..6d9bd9a3cf 100644 --- a/packages/page-democracy/src/Execute/Scheduler.tsx +++ b/packages/page-democracy/src/Execute/Scheduler.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useRef } from 'react'; + import type { Option } from '@polkadot/types'; import type { BlockNumber, Scheduled } from '@polkadot/types/interfaces'; -import type { ScheduledExt } from './types'; - -import React, { useRef } from 'react'; import { Table } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; +import type { ScheduledExt } from './types'; import { useTranslation } from '../translate'; import ScheduledView from './Scheduled'; diff --git a/packages/page-democracy/src/Execute/index.tsx b/packages/page-democracy/src/Execute/index.tsx index 2919910595..fc3e85fe6f 100644 --- a/packages/page-democracy/src/Execute/index.tsx +++ b/packages/page-democracy/src/Execute/index.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React from 'react'; + import { useApi } from '@polkadot/react-hooks'; import DispatchQueue from './DispatchQueue'; diff --git a/packages/page-democracy/src/Overview/External.tsx b/packages/page-democracy/src/Overview/External.tsx index d2f6654eac..3ecb9ccca4 100644 --- a/packages/page-democracy/src/Overview/External.tsx +++ b/packages/page-democracy/src/Overview/External.tsx @@ -1,15 +1,15 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveProposalExternal } from '@polkadot/api-derive/types'; - import React from 'react'; + +import type { DeriveProposalExternal } from '@polkadot/api-derive/types'; import { AddressMini, Button } from '@polkadot/react-components'; import { FormatBalance } from '@polkadot/react-query'; +import Fasttrack from './Fasttrack'; import PreImageButton from './PreImageButton'; import ProposalCell from './ProposalCell'; -import Fasttrack from './Fasttrack'; interface Props { className?: string; diff --git a/packages/page-democracy/src/Overview/ExternalCell.tsx b/packages/page-democracy/src/Overview/ExternalCell.tsx index 0ee383c011..bf2ded7819 100644 --- a/packages/page-democracy/src/Overview/ExternalCell.tsx +++ b/packages/page-democracy/src/Overview/ExternalCell.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React from 'react'; + import type { DeriveProposalImage } from '@polkadot/api-derive/types'; import type { Hash } from '@polkadot/types/interfaces'; - -import React from 'react'; -import { useApi, useCall } from '@polkadot/react-hooks'; import { CallExpander } from '@polkadot/react-components'; +import { useApi, useCall } from '@polkadot/react-hooks'; import { Holder } from '@polkadot/react-params'; import { useTranslation } from '../translate'; diff --git a/packages/page-democracy/src/Overview/Externals.tsx b/packages/page-democracy/src/Overview/Externals.tsx index f6afba5274..662ea69ad7 100644 --- a/packages/page-democracy/src/Overview/Externals.tsx +++ b/packages/page-democracy/src/Overview/Externals.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveProposalExternal } from '@polkadot/api-derive/types'; - import React, { useRef } from 'react'; + +import type { DeriveProposalExternal } from '@polkadot/api-derive/types'; import { Table } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-democracy/src/Overview/Fasttrack.tsx b/packages/page-democracy/src/Overview/Fasttrack.tsx index bbdc6636b7..768980ce06 100644 --- a/packages/page-democracy/src/Overview/Fasttrack.tsx +++ b/packages/page-democracy/src/Overview/Fasttrack.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SubmittableExtrinsic } from '@polkadot/api/types'; -import type { Hash, VoteThreshold } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; import React, { useEffect, useMemo, useState } from 'react'; + +import type { SubmittableExtrinsic } from '@polkadot/api/types'; +import type { Hash, VoteThreshold } from '@polkadot/types/interfaces'; import { Button, Input, InputAddress, InputNumber, Modal, TxButton } from '@polkadot/react-components'; import { useApi, useMembers, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-democracy/src/Overview/PreImage.tsx b/packages/page-democracy/src/Overview/PreImage.tsx index 0408c17d58..3ecc2168c2 100644 --- a/packages/page-democracy/src/Overview/PreImage.tsx +++ b/packages/page-democracy/src/Overview/PreImage.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; -import type { Hash } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; -import { Input, InputAddress, InputBalance, Extrinsic, Modal, TxButton } from '@polkadot/react-components'; + +import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; +import type { Hash } from '@polkadot/types/interfaces'; +import { Extrinsic, Input, InputAddress, InputBalance, Modal, TxButton } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import { Available } from '@polkadot/react-query'; import { BN_ZERO } from '@polkadot/util'; diff --git a/packages/page-democracy/src/Overview/PreImageButton.tsx b/packages/page-democracy/src/Overview/PreImageButton.tsx index 5b294196ac..6a19742136 100644 --- a/packages/page-democracy/src/Overview/PreImageButton.tsx +++ b/packages/page-democracy/src/Overview/PreImageButton.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Hash } from '@polkadot/types/interfaces'; - import React from 'react'; + +import type { Hash } from '@polkadot/types/interfaces'; import { Button } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-democracy/src/Overview/Proposal.tsx b/packages/page-democracy/src/Overview/Proposal.tsx index 9c4fbe4780..02a97e072b 100644 --- a/packages/page-democracy/src/Overview/Proposal.tsx +++ b/packages/page-democracy/src/Overview/Proposal.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveProposal } from '@polkadot/api-derive/types'; - import React from 'react'; import styled from 'styled-components'; + +import type { DeriveProposal } from '@polkadot/api-derive/types'; import { AddressMini, Button, Expander, LinkExternal } from '@polkadot/react-components'; import { FormatBalance } from '@polkadot/react-query'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/page-democracy/src/Overview/ProposalCell.tsx b/packages/page-democracy/src/Overview/ProposalCell.tsx index d7f05a1c19..10bd0da9f5 100644 --- a/packages/page-democracy/src/Overview/ProposalCell.tsx +++ b/packages/page-democracy/src/Overview/ProposalCell.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React from 'react'; + import type { Compact } from '@polkadot/types'; import type { Hash, Proposal, ProposalIndex } from '@polkadot/types/interfaces'; - -import React from 'react'; import { CallExpander } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-democracy/src/Overview/Proposals.tsx b/packages/page-democracy/src/Overview/Proposals.tsx index cbb0da7087..e8949fa4a6 100644 --- a/packages/page-democracy/src/Overview/Proposals.tsx +++ b/packages/page-democracy/src/Overview/Proposals.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveProposal } from '@polkadot/api-derive/types'; - import React, { useRef } from 'react'; + +import type { DeriveProposal } from '@polkadot/api-derive/types'; import { Table } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; -import ProposalDisplay from './Proposal'; import { useTranslation } from '../translate'; +import ProposalDisplay from './Proposal'; interface Props { className?: string; diff --git a/packages/page-democracy/src/Overview/Propose.tsx b/packages/page-democracy/src/Overview/Propose.tsx index 961ce671c1..b381b8b4e9 100644 --- a/packages/page-democracy/src/Overview/Propose.tsx +++ b/packages/page-democracy/src/Overview/Propose.tsx @@ -3,6 +3,7 @@ import BN from 'bn.js'; import React, { useCallback, useState } from 'react'; + import { Input, InputAddress, InputBalance, Modal, TxButton } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { Available } from '@polkadot/react-query'; diff --git a/packages/page-democracy/src/Overview/Referendum.tsx b/packages/page-democracy/src/Overview/Referendum.tsx index 9ec93cf931..0d5d7c34c7 100644 --- a/packages/page-democracy/src/Overview/Referendum.tsx +++ b/packages/page-democracy/src/Overview/Referendum.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveReferendumExt } from '@polkadot/api-derive/types'; -import type { Balance, BlockNumber } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; import React, { useMemo } from 'react'; import styled from 'styled-components'; + +import type { DeriveReferendumExt } from '@polkadot/api-derive/types'; +import type { Balance, BlockNumber } from '@polkadot/types/interfaces'; import { Badge, Button, Icon, LinkExternal } from '@polkadot/react-components'; import { useAccounts, useApi, useCall } from '@polkadot/react-hooks'; import { BlockToTime } from '@polkadot/react-query'; diff --git a/packages/page-democracy/src/Overview/ReferendumVote.tsx b/packages/page-democracy/src/Overview/ReferendumVote.tsx index 65871fa1e2..40964ef58a 100644 --- a/packages/page-democracy/src/Overview/ReferendumVote.tsx +++ b/packages/page-democracy/src/Overview/ReferendumVote.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React from 'react'; + import type { DeriveReferendumVote } from '@polkadot/api-derive/types'; import type { Vote } from '@polkadot/types/interfaces'; - -import React from 'react'; import { AddressMini } from '@polkadot/react-components'; interface Props { diff --git a/packages/page-democracy/src/Overview/ReferendumVotes.tsx b/packages/page-democracy/src/Overview/ReferendumVotes.tsx index be34aa0191..faa87969a1 100644 --- a/packages/page-democracy/src/Overview/ReferendumVotes.tsx +++ b/packages/page-democracy/src/Overview/ReferendumVotes.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveReferendumVote } from '@polkadot/api-derive/types'; - import BN from 'bn.js'; import React, { useMemo } from 'react'; + +import type { DeriveReferendumVote } from '@polkadot/api-derive/types'; import { Expander } from '@polkadot/react-components'; import { FormatBalance } from '@polkadot/react-query'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/page-democracy/src/Overview/Referendums.tsx b/packages/page-democracy/src/Overview/Referendums.tsx index 0d310dfab8..4bbe106108 100644 --- a/packages/page-democracy/src/Overview/Referendums.tsx +++ b/packages/page-democracy/src/Overview/Referendums.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveReferendumExt } from '@polkadot/api-derive/types'; - import React, { useRef } from 'react'; + +import type { DeriveReferendumExt } from '@polkadot/api-derive/types'; import { Table } from '@polkadot/react-components'; -import Referendum from './Referendum'; import { useTranslation } from '../translate'; +import Referendum from './Referendum'; interface Props { className?: string; diff --git a/packages/page-democracy/src/Overview/Seconding.tsx b/packages/page-democracy/src/Overview/Seconding.tsx index 1721d9a2e6..c405a5290f 100644 --- a/packages/page-democracy/src/Overview/Seconding.tsx +++ b/packages/page-democracy/src/Overview/Seconding.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveProposalImage } from '@polkadot/api-derive/types'; -import type { AccountId } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; import React, { useState } from 'react'; + +import type { DeriveProposalImage } from '@polkadot/api-derive/types'; +import type { AccountId } from '@polkadot/types/interfaces'; import { Button, InputAddress, Modal, ProposedAction, TxButton } from '@polkadot/react-components'; import { useAccounts, useApi, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-democracy/src/Overview/Summary.tsx b/packages/page-democracy/src/Overview/Summary.tsx index a96fc6f9ed..65612f3886 100644 --- a/packages/page-democracy/src/Overview/Summary.tsx +++ b/packages/page-democracy/src/Overview/Summary.tsx @@ -3,7 +3,8 @@ import BN from 'bn.js'; import React from 'react'; -import { SummaryBox, CardSummary } from '@polkadot/react-components'; + +import { CardSummary, SummaryBox } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/page-democracy/src/Overview/TreasuryCell.tsx b/packages/page-democracy/src/Overview/TreasuryCell.tsx index b2bb0d1a54..b08f243031 100644 --- a/packages/page-democracy/src/Overview/TreasuryCell.tsx +++ b/packages/page-democracy/src/Overview/TreasuryCell.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useEffect, useState } from 'react'; + import type { Compact, Option } from '@polkadot/types'; import type { ProposalIndex, TreasuryProposal } from '@polkadot/types/interfaces'; import type { TypeDef } from '@polkadot/types/types'; - -import React, { useEffect, useState } from 'react'; import { useApi, useCall } from '@polkadot/react-hooks'; import Params from '@polkadot/react-params'; import { getTypeDef } from '@polkadot/types/create'; diff --git a/packages/page-democracy/src/Overview/Voting.tsx b/packages/page-democracy/src/Overview/Voting.tsx index 162eacf9e0..b7a5f9a14c 100644 --- a/packages/page-democracy/src/Overview/Voting.tsx +++ b/packages/page-democracy/src/Overview/Voting.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { PropIndex, Proposal } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; import React, { useMemo, useState } from 'react'; + +import type { PropIndex, Proposal } from '@polkadot/types/interfaces'; import { Button, ConvictionDropdown, Modal, ProposedAction, TxButton, VoteAccount, VoteValue } from '@polkadot/react-components'; import { useAccounts, useApi, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-democracy/src/Overview/index.tsx b/packages/page-democracy/src/Overview/index.tsx index 7be272b409..9af72ee3a4 100644 --- a/packages/page-democracy/src/Overview/index.tsx +++ b/packages/page-democracy/src/Overview/index.tsx @@ -1,19 +1,19 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveReferendumExt } from '@polkadot/api-derive/types'; - import React from 'react'; + +import type { DeriveReferendumExt } from '@polkadot/api-derive/types'; import { Button } from '@polkadot/react-components'; import { useApi, useCall, useToggle } from '@polkadot/react-hooks'; import { useTranslation } from '../translate'; import Externals from './Externals'; +import PreImage from './PreImage'; import Proposals from './Proposals'; +import Propose from './Propose'; import Referendums from './Referendums'; import Summary from './Summary'; -import PreImage from './PreImage'; -import Propose from './Propose'; interface Props { className?: string; diff --git a/packages/page-democracy/src/index.tsx b/packages/page-democracy/src/index.tsx index 1b306cfd73..5261e0473f 100644 --- a/packages/page-democracy/src/index.tsx +++ b/packages/page-democracy/src/index.tsx @@ -3,11 +3,12 @@ import React, { useMemo } from 'react'; import { Route, Switch } from 'react-router'; + import { HelpOverlay, Tabs } from '@polkadot/react-components'; -import basicMd from './md/basic.md'; import Execute from './Execute'; import useDispatchCounter from './Execute/useCounter'; +import basicMd from './md/basic.md'; import Overview from './Overview'; import { useTranslation } from './translate'; diff --git a/packages/page-democracy/src/useChangeCalc.ts b/packages/page-democracy/src/useChangeCalc.ts index b90d1f2c97..460cafa75c 100644 --- a/packages/page-democracy/src/useChangeCalc.ts +++ b/packages/page-democracy/src/useChangeCalc.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { VoteThreshold } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; import { useEffect, useState } from 'react'; + +import type { VoteThreshold } from '@polkadot/types/interfaces'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BN_ZERO } from '@polkadot/util'; diff --git a/packages/page-democracy/src/useCounter.ts b/packages/page-democracy/src/useCounter.ts index 476ef35aa9..b354a90f08 100644 --- a/packages/page-democracy/src/useCounter.ts +++ b/packages/page-democracy/src/useCounter.ts @@ -1,7 +1,8 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { useState, useEffect } from 'react'; +import { useEffect, useState } from 'react'; + import { useAccounts, useApi, useCall, useIsMountedRef } from '@polkadot/react-hooks'; export default function useCounter (): number { diff --git a/packages/page-democracy/src/util.spec.ts b/packages/page-democracy/src/util.spec.ts index adc4fa576d..e657a98e14 100644 --- a/packages/page-democracy/src/util.spec.ts +++ b/packages/page-democracy/src/util.spec.ts @@ -2,8 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 import BN from 'bn.js'; -import { TypeRegistry } from '@polkadot/types/create'; + import { calcPassing } from '@polkadot/api-derive/democracy/util'; +import { TypeRegistry } from '@polkadot/types/create'; import { approxChanges } from './util'; diff --git a/packages/page-democracy/src/util.ts b/packages/page-democracy/src/util.ts index bf0afd9134..56db28a59f 100644 --- a/packages/page-democracy/src/util.ts +++ b/packages/page-democracy/src/util.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { VoteThreshold } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; + +import type { VoteThreshold } from '@polkadot/types/interfaces'; import { calcPassing } from '@polkadot/api-derive/democracy/util'; -import { BN_ZERO, BN_ONE, BN_TEN } from '@polkadot/util'; +import { BN_ONE, BN_TEN, BN_ZERO } from '@polkadot/util'; interface Approx { changeAye: BN; diff --git a/packages/page-explorer/src/BestHash.tsx b/packages/page-explorer/src/BestHash.tsx index fb1a81bc48..6e53eb074a 100644 --- a/packages/page-explorer/src/BestHash.tsx +++ b/packages/page-explorer/src/BestHash.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Header } from '@polkadot/types/interfaces'; - import React from 'react'; + +import type { Header } from '@polkadot/types/interfaces'; import { useApi, useCall } from '@polkadot/react-hooks'; interface Props { diff --git a/packages/page-explorer/src/BlockHeader.tsx b/packages/page-explorer/src/BlockHeader.tsx index b18f787986..e86c513d43 100644 --- a/packages/page-explorer/src/BlockHeader.tsx +++ b/packages/page-explorer/src/BlockHeader.tsx @@ -3,6 +3,7 @@ import React from 'react'; import { Link } from 'react-router-dom'; + import { HeaderExtended } from '@polkadot/api-derive'; import { AddressMini } from '@polkadot/react-components'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/page-explorer/src/BlockHeaders.tsx b/packages/page-explorer/src/BlockHeaders.tsx index b3eadfa544..ba0578a127 100644 --- a/packages/page-explorer/src/BlockHeaders.tsx +++ b/packages/page-explorer/src/BlockHeaders.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React, { useRef } from 'react'; + import { HeaderExtended } from '@polkadot/api-derive'; import { Table } from '@polkadot/react-components'; diff --git a/packages/page-explorer/src/BlockInfo/ByHash.tsx b/packages/page-explorer/src/BlockInfo/ByHash.tsx index 28cdd97487..1c516182e6 100644 --- a/packages/page-explorer/src/BlockInfo/ByHash.tsx +++ b/packages/page-explorer/src/BlockInfo/ByHash.tsx @@ -1,18 +1,18 @@ // Copyright 2017-2020 @polkadot/app-explorer authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { EventRecord, SignedBlock } from '@polkadot/types/interfaces'; -import type { KeyedEvent } from '@polkadot/react-query/types'; - import React, { useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; + +import type { KeyedEvent } from '@polkadot/react-query/types'; +import type { EventRecord, SignedBlock } from '@polkadot/types/interfaces'; import { HeaderExtended } from '@polkadot/api-derive'; import { AddressSmall, Columar, Column, LinkExternal, Table } from '@polkadot/react-components'; import { useApi, useIsMountedRef } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; -import { useTranslation } from '../translate'; import Events from '../Events'; +import { useTranslation } from '../translate'; import Extrinsics from './Extrinsics'; import Logs from './Logs'; diff --git a/packages/page-explorer/src/BlockInfo/ByNumber.tsx b/packages/page-explorer/src/BlockInfo/ByNumber.tsx index 8b9449f38f..246c704447 100644 --- a/packages/page-explorer/src/BlockInfo/ByNumber.tsx +++ b/packages/page-explorer/src/BlockInfo/ByNumber.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-explorer authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Hash } from '@polkadot/types/interfaces'; - import React, { useEffect, useState } from 'react'; + +import type { Hash } from '@polkadot/types/interfaces'; import { Spinner } from '@polkadot/react-components'; import { useApi, useIsMountedRef } from '@polkadot/react-hooks'; diff --git a/packages/page-explorer/src/BlockInfo/Extrinsic.tsx b/packages/page-explorer/src/BlockInfo/Extrinsic.tsx index 6b7d28552a..c45fab66bb 100644 --- a/packages/page-explorer/src/BlockInfo/Extrinsic.tsx +++ b/packages/page-explorer/src/BlockInfo/Extrinsic.tsx @@ -1,16 +1,16 @@ // Copyright 2017-2020 @polkadot/app-explorer authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { BlockNumber, Extrinsic } from '@polkadot/types/interfaces'; -import type { KeyedEvent } from '@polkadot/react-query/types'; - import React from 'react'; import styled from 'styled-components'; + +import type { KeyedEvent } from '@polkadot/react-query/types'; +import type { BlockNumber, Extrinsic } from '@polkadot/types/interfaces'; import { AddressMini, Call, Expander, LinkExternal } from '@polkadot/react-components'; import { formatNumber } from '@polkadot/util'; -import { useTranslation } from '../translate'; import Event from '../Event'; +import { useTranslation } from '../translate'; interface Props { blockNumber?: BlockNumber; diff --git a/packages/page-explorer/src/BlockInfo/Extrinsics.tsx b/packages/page-explorer/src/BlockInfo/Extrinsics.tsx index 11e91c7c2f..492abb8556 100644 --- a/packages/page-explorer/src/BlockInfo/Extrinsics.tsx +++ b/packages/page-explorer/src/BlockInfo/Extrinsics.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-explorer authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { BlockNumber, Extrinsic } from '@polkadot/types/interfaces'; -import type { KeyedEvent } from '@polkadot/react-query/types'; - import React, { useMemo } from 'react'; + +import type { KeyedEvent } from '@polkadot/react-query/types'; +import type { BlockNumber, Extrinsic } from '@polkadot/types/interfaces'; import { Table } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-explorer/src/BlockInfo/Logs.tsx b/packages/page-explorer/src/BlockInfo/Logs.tsx index b7fb6ec90f..fd273e3d55 100644 --- a/packages/page-explorer/src/BlockInfo/Logs.tsx +++ b/packages/page-explorer/src/BlockInfo/Logs.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-explorer authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useRef } from 'react'; + import type { DigestItem } from '@polkadot/types/interfaces'; import type { Codec, TypeDef } from '@polkadot/types/types'; - -import React, { useRef } from 'react'; -import { getTypeDef } from '@polkadot/types/create'; import { Expander, Table } from '@polkadot/react-components'; import Params from '@polkadot/react-params'; -import { Struct, Tuple, Raw, Vec } from '@polkadot/types'; +import { Raw, Struct, Tuple, Vec } from '@polkadot/types'; +import { getTypeDef } from '@polkadot/types/create'; import { useTranslation } from '../translate'; diff --git a/packages/page-explorer/src/BlockInfo/index.tsx b/packages/page-explorer/src/BlockInfo/index.tsx index c9d9d4e010..5e05cfa1e9 100644 --- a/packages/page-explorer/src/BlockInfo/index.tsx +++ b/packages/page-explorer/src/BlockInfo/index.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-explorer authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { BlockNumber } from '@polkadot/types/interfaces'; - import React, { useEffect, useState } from 'react'; import { useParams } from 'react-router-dom'; + +import type { BlockNumber } from '@polkadot/types/interfaces'; import { useApi, useCall } from '@polkadot/react-hooks'; import { isHex } from '@polkadot/util'; diff --git a/packages/page-explorer/src/Event.tsx b/packages/page-explorer/src/Event.tsx index dc5f337ed7..a26930b470 100644 --- a/packages/page-explorer/src/Event.tsx +++ b/packages/page-explorer/src/Event.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-explorer authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { EventRecord } from '@polkadot/types/interfaces'; - import React from 'react'; + +import type { EventRecord } from '@polkadot/types/interfaces'; import { Event as EventDisplay, Expander } from '@polkadot/react-components'; interface Props { diff --git a/packages/page-explorer/src/Events.tsx b/packages/page-explorer/src/Events.tsx index f3768b158c..3f4e40f270 100644 --- a/packages/page-explorer/src/Events.tsx +++ b/packages/page-explorer/src/Events.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-explorer authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { KeyedEvent } from '@polkadot/react-query/types'; - import React, { useMemo } from 'react'; import { Link } from 'react-router-dom'; import styled from 'styled-components'; + +import type { KeyedEvent } from '@polkadot/react-query/types'; import { Table } from '@polkadot/react-components'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/page-explorer/src/Forks.tsx b/packages/page-explorer/src/Forks.tsx index c05dea8fdb..b6ab92332b 100644 --- a/packages/page-explorer/src/Forks.tsx +++ b/packages/page-explorer/src/Forks.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-explorer authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useCallback, useEffect, useRef, useState } from 'react'; +import styled from 'styled-components'; + import type { ApiProps } from '@polkadot/react-api/types'; import type { ThemeProps } from '@polkadot/react-components/types'; import type { Header } from '@polkadot/types/interfaces'; - -import React, { useCallback, useEffect, useRef, useState } from 'react'; -import styled from 'styled-components'; import { CardSummary, IdentityIcon, SummaryBox } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/page-explorer/src/Main.tsx b/packages/page-explorer/src/Main.tsx index dbf68de874..7e4714eeed 100644 --- a/packages/page-explorer/src/Main.tsx +++ b/packages/page-explorer/src/Main.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-explorer authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { KeyedEvent } from '@polkadot/react-query/types'; - import React from 'react'; + +import type { KeyedEvent } from '@polkadot/react-query/types'; import { HeaderExtended } from '@polkadot/api-derive'; import { Columar, Column } from '@polkadot/react-components'; diff --git a/packages/page-explorer/src/NodeInfo/Peers.tsx b/packages/page-explorer/src/NodeInfo/Peers.tsx index 023292e2e3..408b8cb11f 100644 --- a/packages/page-explorer/src/NodeInfo/Peers.tsx +++ b/packages/page-explorer/src/NodeInfo/Peers.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-nodeinfo authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { PeerInfo } from '@polkadot/types/interfaces'; - import React, { useRef } from 'react'; import styled from 'styled-components'; + +import type { PeerInfo } from '@polkadot/types/interfaces'; +import { Table } from '@polkadot/react-components'; import { formatNumber } from '@polkadot/util'; import { useTranslation } from '../translate'; -import { Table } from '@polkadot/react-components'; interface Props { className?: string; diff --git a/packages/page-explorer/src/NodeInfo/Summary.tsx b/packages/page-explorer/src/NodeInfo/Summary.tsx index 72ea7ff2c8..66708d43ff 100644 --- a/packages/page-explorer/src/NodeInfo/Summary.tsx +++ b/packages/page-explorer/src/NodeInfo/Summary.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/app-nodeinfo authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Info } from './types'; +import React, { useEffect, useState } from 'react'; -import React, { useState, useEffect } from 'react'; -import { SummaryBox, CardSummary } from '@polkadot/react-components'; +import { CardSummary, SummaryBox } from '@polkadot/react-components'; import { BestNumber, Elapsed } from '@polkadot/react-query'; import { BN_ZERO, formatNumber } from '@polkadot/util'; +import type { Info } from './types'; import { useTranslation } from '../translate'; interface Props { diff --git a/packages/page-explorer/src/NodeInfo/index.tsx b/packages/page-explorer/src/NodeInfo/index.tsx index 52ddf800ae..ee1f0fbcd7 100644 --- a/packages/page-explorer/src/NodeInfo/index.tsx +++ b/packages/page-explorer/src/NodeInfo/index.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-nodeinfo authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Info } from './types'; - import React, { useEffect, useState } from 'react'; + import { ApiPromise } from '@polkadot/api'; import { useApi } from '@polkadot/react-hooks'; +import type { Info } from './types'; import Extrinsics from '../BlockInfo/Extrinsics'; import { useTranslation } from '../translate'; import Peers from './Peers'; diff --git a/packages/page-explorer/src/Query.tsx b/packages/page-explorer/src/Query.tsx index c6b34e6868..bc6e247515 100644 --- a/packages/page-explorer/src/Query.tsx +++ b/packages/page-explorer/src/Query.tsx @@ -3,6 +3,7 @@ import React, { useCallback, useState } from 'react'; import styled from 'styled-components'; + import { Button, FilterOverlay, Input } from '@polkadot/react-components'; import { isHex } from '@polkadot/util'; diff --git a/packages/page-explorer/src/Summary.tsx b/packages/page-explorer/src/Summary.tsx index 8816b382a7..894d7190a9 100644 --- a/packages/page-explorer/src/Summary.tsx +++ b/packages/page-explorer/src/Summary.tsx @@ -2,8 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 import React from 'react'; + +import { CardSummary, SummaryBox } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; -import { SummaryBox, CardSummary } from '@polkadot/react-components'; import { BestFinalized, BestNumber, BlockToTime, TimeNow, TotalIssuance } from '@polkadot/react-query'; import { BN_ONE } from '@polkadot/util'; diff --git a/packages/page-explorer/src/SummarySession.tsx b/packages/page-explorer/src/SummarySession.tsx index 7a9dd7709a..2c9d044f20 100644 --- a/packages/page-explorer/src/SummarySession.tsx +++ b/packages/page-explorer/src/SummarySession.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-explorer authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React from 'react'; + import type { DeriveSessionProgress } from '@polkadot/api-derive/types'; import type { Forcing } from '@polkadot/types/interfaces'; - -import React from 'react'; import { CardSummary } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { Elapsed } from '@polkadot/react-query'; diff --git a/packages/page-explorer/src/index.tsx b/packages/page-explorer/src/index.tsx index 85409b13f6..7394093195 100644 --- a/packages/page-explorer/src/index.tsx +++ b/packages/page-explorer/src/index.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-explorer authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { KeyedEvent } from '@polkadot/react-query/types'; - import React, { useContext, useRef } from 'react'; import { Route, Switch } from 'react-router'; + +import type { KeyedEvent } from '@polkadot/react-query/types'; import Tabs from '@polkadot/react-components/Tabs'; import { useApi } from '@polkadot/react-hooks'; import { BlockAuthorsContext, EventsContext } from '@polkadot/react-query'; diff --git a/packages/page-extrinsics/src/Balance.tsx b/packages/page-extrinsics/src/Balance.tsx index da128195ae..7eeb0819ea 100644 --- a/packages/page-extrinsics/src/Balance.tsx +++ b/packages/page-extrinsics/src/Balance.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; - import React from 'react'; + +import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; import { InputBalance } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-extrinsics/src/Selection.tsx b/packages/page-extrinsics/src/Selection.tsx index bec6fe4faa..7936709983 100644 --- a/packages/page-extrinsics/src/Selection.tsx +++ b/packages/page-extrinsics/src/Selection.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-extrinsics authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SubmittableExtrinsic } from '@polkadot/api/types'; - import React, { useCallback, useState } from 'react'; + +import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { Button, Extrinsic, InputAddress, TxButton } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import { BalanceFree } from '@polkadot/react-query'; diff --git a/packages/page-extrinsics/src/index.tsx b/packages/page-extrinsics/src/index.tsx index fcbee79114..3b590e6eb0 100644 --- a/packages/page-extrinsics/src/index.tsx +++ b/packages/page-extrinsics/src/index.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-extrinsics authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AppProps as Props } from '@polkadot/react-components/types'; - import React, { useRef } from 'react'; + +import type { AppProps as Props } from '@polkadot/react-components/types'; import { Tabs } from '@polkadot/react-components'; import Selection from './Selection'; diff --git a/packages/page-generic-asset/src/AssetCard.tsx b/packages/page-generic-asset/src/AssetCard.tsx index 203300344a..d6fe747d2d 100644 --- a/packages/page-generic-asset/src/AssetCard.tsx +++ b/packages/page-generic-asset/src/AssetCard.tsx @@ -2,7 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import React, { useCallback } from 'react'; -import { Card, Button } from '@polkadot/react-components'; + +import { Button, Card } from '@polkadot/react-components'; import AssetRow from './AssetRow'; import { useTranslation } from './translate'; diff --git a/packages/page-generic-asset/src/AssetRow.tsx b/packages/page-generic-asset/src/AssetRow.tsx index 2520d62057..b458fe5745 100644 --- a/packages/page-generic-asset/src/AssetRow.tsx +++ b/packages/page-generic-asset/src/AssetRow.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React, { useState } from 'react'; + import { CopyButton } from '@polkadot/react-components'; import Row from '@polkadot/react-components/Row'; diff --git a/packages/page-generic-asset/src/Assets.tsx b/packages/page-generic-asset/src/Assets.tsx index f989c8340e..5f9e74a09b 100644 --- a/packages/page-generic-asset/src/Assets.tsx +++ b/packages/page-generic-asset/src/Assets.tsx @@ -1,15 +1,15 @@ // Copyright 2019 @polkadot/app-generic-asset authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { I18nProps } from '@polkadot/react-components/types'; - import BN from 'bn.js'; import React, { useState } from 'react'; -import { Button, CardGrid } from '@polkadot/react-components'; -import { withMulti, withObservable } from '@polkadot/react-api/hoc'; -import assetRegistry, { AssetsSubjectInfo } from './assetsRegistry'; +import type { I18nProps } from '@polkadot/react-components/types'; +import { withMulti, withObservable } from '@polkadot/react-api/hoc'; +import { Button, CardGrid } from '@polkadot/react-components'; + import AssetCard from './AssetCard'; +import assetRegistry, { AssetsSubjectInfo } from './assetsRegistry'; import CreateModal from './modals/Create'; import translate from './translate'; diff --git a/packages/page-generic-asset/src/Transfer.tsx b/packages/page-generic-asset/src/Transfer.tsx index 6658a90441..1e7ff678be 100644 --- a/packages/page-generic-asset/src/Transfer.tsx +++ b/packages/page-generic-asset/src/Transfer.tsx @@ -1,15 +1,15 @@ // Copyright 2019 @polkadot/app-generic-asset authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; - import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; -import { Button, InputAddress, InputBalance, TxButton, Dropdown } from '@polkadot/react-components'; + +import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; +import { withMulti, withObservable } from '@polkadot/react-api/hoc'; +import { Button, Dropdown, InputAddress, InputBalance, TxButton } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import { Available } from '@polkadot/react-query'; -import { withMulti, withObservable } from '@polkadot/react-api/hoc'; import { BN_ZERO } from '@polkadot/util'; import assetRegistry, { AssetsSubjectInfo } from './assetsRegistry'; diff --git a/packages/page-generic-asset/src/index.tsx b/packages/page-generic-asset/src/index.tsx index a72a1fba93..c7c6477126 100644 --- a/packages/page-generic-asset/src/index.tsx +++ b/packages/page-generic-asset/src/index.tsx @@ -3,11 +3,11 @@ import React, { useRef } from 'react'; import { Route, Switch } from 'react-router'; + import { Tabs } from '@polkadot/react-components'; -import Transfer from './Transfer'; import Assets from './Assets'; - +import Transfer from './Transfer'; import { useTranslation } from './translate'; interface Props { diff --git a/packages/page-generic-asset/src/modals/Create.tsx b/packages/page-generic-asset/src/modals/Create.tsx index d534283f98..5a7493eee0 100644 --- a/packages/page-generic-asset/src/modals/Create.tsx +++ b/packages/page-generic-asset/src/modals/Create.tsx @@ -3,6 +3,7 @@ import BN from 'bn.js'; import React, { useState } from 'react'; + import { Button, Input, InputNumber, Modal } from '@polkadot/react-components'; import { BN_ZERO } from '@polkadot/util'; diff --git a/packages/page-js/src/ActionButtons.tsx b/packages/page-js/src/ActionButtons.tsx index 7e4e7e2dae..5963c06c19 100644 --- a/packages/page-js/src/ActionButtons.tsx +++ b/packages/page-js/src/ActionButtons.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React, { useCallback, useState } from 'react'; + import { Button, Input, Popup } from '@polkadot/react-components'; import { useTranslation } from './translate'; diff --git a/packages/page-js/src/Output.tsx b/packages/page-js/src/Output.tsx index 8efbea3081..7eea52f880 100644 --- a/packages/page-js/src/Output.tsx +++ b/packages/page-js/src/Output.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/app-js authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from '@polkadot/react-components/types'; -import type { Log } from './types'; - import React from 'react'; import styled from 'styled-components'; + +import type { ThemeProps } from '@polkadot/react-components/types'; import { isError, isNull, isUndefined } from '@polkadot/util'; +import type { Log } from './types'; + interface Props { children?: React.ReactNode; className?: string; diff --git a/packages/page-js/src/Playground.tsx b/packages/page-js/src/Playground.tsx index 0d0b477786..cf7597f4c5 100644 --- a/packages/page-js/src/Playground.tsx +++ b/packages/page-js/src/Playground.tsx @@ -1,28 +1,27 @@ // Copyright 2017-2020 @polkadot/app-js authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useCallback, useEffect, useRef, useState } from 'react'; +import styled from 'styled-components'; + import type { ApiPromise } from '@polkadot/api'; import type { KeyringInstance } from '@polkadot/keyring/types'; import type { ApiProps } from '@polkadot/react-api/types'; import type { AppProps as Props } from '@polkadot/react-components/types'; -import type { Log, LogType, Snippet } from './types'; - -import React, { useCallback, useRef, useState, useEffect } from 'react'; -import styled from 'styled-components'; import { Button, Dropdown, Editor } from '@polkadot/react-components'; import { useApi, useToggle } from '@polkadot/react-hooks'; -import uiKeyring from '@polkadot/ui-keyring'; import * as types from '@polkadot/types'; +import uiKeyring from '@polkadot/ui-keyring'; import * as util from '@polkadot/util'; import * as hashing from '@polkadot/util-crypto'; -import { STORE_EXAMPLES, STORE_SELECTED, CUSTOM_LABEL } from './constants'; -import makeWrapper from './snippets/wrapping'; -import allSnippets from './snippets'; -import { useTranslation } from './translate'; - -import Output from './Output'; +import type { Log, LogType, Snippet } from './types'; import ActionButtons from './ActionButtons'; +import { CUSTOM_LABEL, STORE_EXAMPLES, STORE_SELECTED } from './constants'; +import Output from './Output'; +import allSnippets from './snippets'; +import makeWrapper from './snippets/wrapping'; +import { useTranslation } from './translate'; interface Injected { api: ApiPromise; diff --git a/packages/page-js/src/index.tsx b/packages/page-js/src/index.tsx index 0bba04c573..da8fe06835 100644 --- a/packages/page-js/src/index.tsx +++ b/packages/page-js/src/index.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-js authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AppProps as Props } from '@polkadot/react-components/types'; - import React from 'react'; +import type { AppProps as Props } from '@polkadot/react-components/types'; + import Playground from './Playground'; function JsApp (props: Props): React.ReactElement { diff --git a/packages/page-js/src/snippets/index.ts b/packages/page-js/src/snippets/index.ts index e13c38f9b6..6840c434d1 100644 --- a/packages/page-js/src/snippets/index.ts +++ b/packages/page-js/src/snippets/index.ts @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { Snippet } from './../types'; - import { constsStakingParameters } from './consts-examples'; import { extrinsicMakeTransfer } from './extrinsics-examples'; import { rpcNetworkAuthoring, rpcNewHead, rpcQueryState, rpcSysthemInfo } from './rpc-examples'; -import { storageGetInfo, storageSystemEvents, storageKeys, storageListenToBalanceChange, storageListenToMultipleBalancesChange, storageRetrieveInfoOnQueryKeys } from './storage-examples'; +import { storageGetInfo, storageKeys, storageListenToBalanceChange, storageListenToMultipleBalancesChange, storageRetrieveInfoOnQueryKeys, storageSystemEvents } from './storage-examples'; const snippets: Snippet[] = [ rpcNetworkAuthoring, diff --git a/packages/page-js/src/types.ts b/packages/page-js/src/types.ts index cf62f01801..b73fa06e15 100644 --- a/packages/page-js/src/types.ts +++ b/packages/page-js/src/types.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/app-js authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SemanticShorthandItem } from 'semantic-ui-react/dist/commonjs/generic'; import type { LabelProps } from 'semantic-ui-react/dist/commonjs/elements/Label'; +import type { SemanticShorthandItem } from 'semantic-ui-react/dist/commonjs/generic'; export type LogType = 'error' | 'log'; diff --git a/packages/page-parachains/src/Overview/Parachain.tsx b/packages/page-parachains/src/Overview/Parachain.tsx index 37e252306e..ca57ac860b 100644 --- a/packages/page-parachains/src/Overview/Parachain.tsx +++ b/packages/page-parachains/src/Overview/Parachain.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { HeadData } from '@polkadot/types/interfaces'; -import type { DeriveParachain } from '@polkadot/api-derive/types'; -import type { Option } from '@polkadot/types'; -import type { ThemeProps } from '@polkadot/react-components/types'; - import React, { useCallback } from 'react'; import { useHistory } from 'react-router-dom'; import styled from 'styled-components'; + +import type { DeriveParachain } from '@polkadot/api-derive/types'; +import type { ThemeProps } from '@polkadot/react-components/types'; +import type { Option } from '@polkadot/types'; +import type { HeadData } from '@polkadot/types/interfaces'; import { Badge, Button, Icon } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/page-parachains/src/Overview/Parachains.tsx b/packages/page-parachains/src/Overview/Parachains.tsx index f6783f16da..7e57eefb3c 100644 --- a/packages/page-parachains/src/Overview/Parachains.tsx +++ b/packages/page-parachains/src/Overview/Parachains.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveParachain } from '@polkadot/api-derive/types'; - import React, { useRef } from 'react'; import styled from 'styled-components'; + +import type { DeriveParachain } from '@polkadot/api-derive/types'; import { Table } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-parachains/src/Overview/Proposal.tsx b/packages/page-parachains/src/Overview/Proposal.tsx index ba106404bd..8d9beff7ed 100644 --- a/packages/page-parachains/src/Overview/Proposal.tsx +++ b/packages/page-parachains/src/Overview/Proposal.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ProposalExt } from './types'; - import React, { useMemo } from 'react'; -import { AddressSmall, AddressMini } from '@polkadot/react-components'; + +import { AddressMini, AddressSmall } from '@polkadot/react-components'; import { FormatBalance } from '@polkadot/react-query'; import { formatNumber } from '@polkadot/util'; +import type { ProposalExt } from './types'; + interface Props { proposal: ProposalExt; } diff --git a/packages/page-parachains/src/Overview/Proposals.tsx b/packages/page-parachains/src/Overview/Proposals.tsx index 09838cba5b..4f0744bdfc 100644 --- a/packages/page-parachains/src/Overview/Proposals.tsx +++ b/packages/page-parachains/src/Overview/Proposals.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ProposalExt } from './types'; - import React, { useRef } from 'react'; + import { Table } from '@polkadot/react-components'; +import type { ProposalExt } from './types'; import { useTranslation } from '../translate'; import Proposal from './Proposal'; diff --git a/packages/page-parachains/src/Overview/Register.tsx b/packages/page-parachains/src/Overview/Register.tsx index 8b849a9551..846283d4ea 100644 --- a/packages/page-parachains/src/Overview/Register.tsx +++ b/packages/page-parachains/src/Overview/Register.tsx @@ -1,15 +1,14 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; - import BN from 'bn.js'; import React, { useMemo, useRef } from 'react'; + +import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; +import { Button, Dropdown, InputFile, InputNumber, InputWasm, Modal, TxButton } from '@polkadot/react-components'; import { useApi, useFormField, useModal } from '@polkadot/react-hooks'; import { BN_THOUSAND, u8aToHex, u8aToString } from '@polkadot/util'; -import { Button, Dropdown, InputFile, InputNumber, InputWasm, Modal, TxButton } from '@polkadot/react-components'; - import { useTranslation } from '../translate'; interface Props { diff --git a/packages/page-parachains/src/Overview/Summary.tsx b/packages/page-parachains/src/Overview/Summary.tsx index a1c91d05ac..e3a0851d31 100644 --- a/packages/page-parachains/src/Overview/Summary.tsx +++ b/packages/page-parachains/src/Overview/Summary.tsx @@ -3,7 +3,8 @@ import BN from 'bn.js'; import React from 'react'; -import { SummaryBox, CardSummary } from '@polkadot/react-components'; + +import { CardSummary, SummaryBox } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import { BestNumber } from '@polkadot/react-query'; import { formatNumber, isNumber } from '@polkadot/util'; diff --git a/packages/page-parachains/src/Overview/index.tsx b/packages/page-parachains/src/Overview/index.tsx index 0fe43f6bd5..22205bb701 100644 --- a/packages/page-parachains/src/Overview/index.tsx +++ b/packages/page-parachains/src/Overview/index.tsx @@ -1,16 +1,16 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveParachain } from '@polkadot/api-derive/types'; -import type { Option } from '@polkadot/types'; -import type { ParaId, ParachainProposal } from '@polkadot/types/interfaces'; -import type { ProposalExt } from './types'; - import BN from 'bn.js'; import React from 'react'; + +import type { DeriveParachain } from '@polkadot/api-derive/types'; +import type { Option } from '@polkadot/types'; +import type { ParachainProposal, ParaId } from '@polkadot/types/interfaces'; import { Button } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; +import type { ProposalExt } from './types'; import Transfer from '../Transfer'; import Parachains from './Parachains'; import Proposals from './Proposals'; diff --git a/packages/page-parachains/src/Overview/types.ts b/packages/page-parachains/src/Overview/types.ts index 3388ad8c01..9ee0b1d951 100644 --- a/packages/page-parachains/src/Overview/types.ts +++ b/packages/page-parachains/src/Overview/types.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ParaId, ParachainProposal } from '@polkadot/types/interfaces'; +import type { ParachainProposal, ParaId } from '@polkadot/types/interfaces'; export interface ProposalExt { id: ParaId; diff --git a/packages/page-parachains/src/Parachain/Deregister.tsx b/packages/page-parachains/src/Parachain/Deregister.tsx index 094c9079ca..b544de6bb6 100644 --- a/packages/page-parachains/src/Parachain/Deregister.tsx +++ b/packages/page-parachains/src/Parachain/Deregister.tsx @@ -1,15 +1,14 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useCallback, useMemo, useRef } from 'react'; + import type { DeriveParachainInfo } from '@polkadot/api-derive/types'; import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; - -import React, { useCallback, useMemo, useRef } from 'react'; +import { Modal, Static, TxButton } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; -import { Modal, Static, TxButton } from '@polkadot/react-components'; import ParachainInfo from '../ParachainInfo'; - import { useTranslation } from '../translate'; interface Props { diff --git a/packages/page-parachains/src/Parachain/Details.tsx b/packages/page-parachains/src/Parachain/Details.tsx index 647dde40dc..726149e0cb 100644 --- a/packages/page-parachains/src/Parachain/Details.tsx +++ b/packages/page-parachains/src/Parachain/Details.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveParachainFull } from '@polkadot/api-derive/types'; -import type { Bytes, Option } from '@polkadot/types'; - import FileSaver from 'file-saver'; import React, { useCallback } from 'react'; + +import type { DeriveParachainFull } from '@polkadot/api-derive/types'; +import type { Bytes, Option } from '@polkadot/types'; import { Card, IconLink, Labelled, Output, Static } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; diff --git a/packages/page-parachains/src/Parachain/DispatchQueue.tsx b/packages/page-parachains/src/Parachain/DispatchQueue.tsx index 2042eaacab..a4c538ed07 100644 --- a/packages/page-parachains/src/Parachain/DispatchQueue.tsx +++ b/packages/page-parachains/src/Parachain/DispatchQueue.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { UpwardMessage } from '@polkadot/types/interfaces'; - import React from 'react'; import styled from 'styled-components'; + +import type { UpwardMessage } from '@polkadot/types/interfaces'; import { Card, Output, Static } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-parachains/src/Parachain/index.tsx b/packages/page-parachains/src/Parachain/index.tsx index 3654e77ead..9e445911fd 100644 --- a/packages/page-parachains/src/Parachain/index.tsx +++ b/packages/page-parachains/src/Parachain/index.tsx @@ -1,21 +1,20 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveParachainInfo, DeriveParachainFull } from '@polkadot/api-derive/types'; - import React, { useCallback } from 'react'; import { useHistory, useParams } from 'react-router-dom'; import styled from 'styled-components'; + +import type { DeriveParachainFull, DeriveParachainInfo } from '@polkadot/api-derive/types'; import { Button, CardSummary, Columar, Column, Icon, Menu, Popup, Spinner, SummaryBox } from '@polkadot/react-components'; import { useApi, useCall, useModal, useToggle } from '@polkadot/react-hooks'; import { isNull, isUndefined } from '@polkadot/util'; import ParachainInfo from '../ParachainInfo'; -import Deregister from './Deregister'; -import DispatchQueue from './DispatchQueue'; -import Details from './Details'; - import { useTranslation } from '../translate'; +import Deregister from './Deregister'; +import Details from './Details'; +import DispatchQueue from './DispatchQueue'; interface Props { basePath: string; diff --git a/packages/page-parachains/src/ParachainInfo.tsx b/packages/page-parachains/src/ParachainInfo.tsx index 1d5d1d287a..82cd89bb75 100644 --- a/packages/page-parachains/src/ParachainInfo.tsx +++ b/packages/page-parachains/src/ParachainInfo.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveParachainInfo } from '@polkadot/api-derive/types'; - import React from 'react'; + +import type { DeriveParachainInfo } from '@polkadot/api-derive/types'; import { AvatarItem, Icon } from '@polkadot/react-components'; import { useTranslation } from './translate'; diff --git a/packages/page-parachains/src/Transfer.tsx b/packages/page-parachains/src/Transfer.tsx index 0fe143d39b..5b29fcc692 100644 --- a/packages/page-parachains/src/Transfer.tsx +++ b/packages/page-parachains/src/Transfer.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SubmittableExtrinsic } from '@polkadot/api/types'; -import type { DeriveParachain } from '@polkadot/api-derive/types'; - import BN from 'bn.js'; import React, { useMemo, useState } from 'react'; import styled from 'styled-components'; + +import type { DeriveParachain } from '@polkadot/api-derive/types'; +import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { Button, Dropdown, Input, InputAddress, InputBalance, InputNumber, Modal, Toggle, TxButton } from '@polkadot/react-components'; import { useAccounts, useApi, useToggle } from '@polkadot/react-hooks'; import { Available } from '@polkadot/react-query'; diff --git a/packages/page-parachains/src/index.tsx b/packages/page-parachains/src/index.tsx index e30c95df93..ae25183ec1 100644 --- a/packages/page-parachains/src/index.tsx +++ b/packages/page-parachains/src/index.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-parachains authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveParachainInfo } from '@polkadot/api-derive/types'; - import React, { useMemo, useRef } from 'react'; import { matchPath, Route, Switch } from 'react-router'; import { useLocation } from 'react-router-dom'; + +import type { DeriveParachainInfo } from '@polkadot/api-derive/types'; import { Tabs } from '@polkadot/react-components'; import { useApi, useSudo } from '@polkadot/react-hooks'; diff --git a/packages/page-parachains/src/util.ts b/packages/page-parachains/src/util.ts index 289d5f1b5b..44ae056a39 100644 --- a/packages/page-parachains/src/util.ts +++ b/packages/page-parachains/src/util.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; + import type { DeriveParachainInfo } from '@polkadot/api-derive/types'; export function parachainName (t: TFunction, info: DeriveParachainInfo | null): string { diff --git a/packages/page-poll/src/index.tsx b/packages/page-poll/src/index.tsx index 12d474a304..41023d18d0 100644 --- a/packages/page-poll/src/index.tsx +++ b/packages/page-poll/src/index.tsx @@ -1,16 +1,16 @@ // Copyright 2017-2020 @polkadot/app-poll authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Approvals, Balance, BlockNumber } from '@polkadot/types/interfaces'; -import type { ITuple } from '@polkadot/types/types'; - import BN from 'bn.js'; import React, { useEffect, useRef, useState } from 'react'; import { Trans } from 'react-i18next'; import styled from 'styled-components'; + +import type { Approvals, Balance, BlockNumber } from '@polkadot/types/interfaces'; +import type { ITuple } from '@polkadot/types/types'; import { Button, Columar, InputAddress, Progress, Spinner, Tabs, Toggle, TxButton } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; -import { FormatBalance, BlockToTime } from '@polkadot/react-query'; +import { BlockToTime, FormatBalance } from '@polkadot/react-query'; import { BN_ONE, BN_ZERO, bnMax, formatBalance, formatNumber } from '@polkadot/util'; import { useTranslation } from './translate'; diff --git a/packages/page-rpc/src/Rpc/Account.tsx b/packages/page-rpc/src/Rpc/Account.tsx index 8b97aefbdb..4f09bb0929 100644 --- a/packages/page-rpc/src/Rpc/Account.tsx +++ b/packages/page-rpc/src/Rpc/Account.tsx @@ -4,6 +4,7 @@ import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; + import { InputAddress, Labelled } from '@polkadot/react-components'; import { Nonce } from '@polkadot/react-query'; import { BN_ZERO } from '@polkadot/util'; diff --git a/packages/page-rpc/src/Rpc/Results.tsx b/packages/page-rpc/src/Rpc/Results.tsx index 297fe32aff..d827316139 100644 --- a/packages/page-rpc/src/Rpc/Results.tsx +++ b/packages/page-rpc/src/Rpc/Results.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-rpc authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React from 'react'; + import type { QueueTx } from '@polkadot/react-components/Status/types'; import type { Codec } from '@polkadot/types/types'; - -import React from 'react'; import { Output } from '@polkadot/react-components'; import { isUndefined } from '@polkadot/util'; diff --git a/packages/page-rpc/src/Rpc/Selection.tsx b/packages/page-rpc/src/Rpc/Selection.tsx index f0b73a2c55..1110ed3be9 100644 --- a/packages/page-rpc/src/Rpc/Selection.tsx +++ b/packages/page-rpc/src/Rpc/Selection.tsx @@ -1,15 +1,15 @@ // Copyright 2017-2020 @polkadot/app-rpc authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ParamDef, RawParam } from '@polkadot/react-params/types'; -import type { QueueTxRpcAdd } from '@polkadot/react-components/Status/types'; -import type { DefinitionRpcExt } from '@polkadot/types/types'; - import React, { useCallback, useMemo, useState } from 'react'; + +import type { QueueTxRpcAdd } from '@polkadot/react-components/Status/types'; +import type { ParamDef, RawParam } from '@polkadot/react-params/types'; +import type { DefinitionRpcExt } from '@polkadot/types/types'; import { Button, InputRpc } from '@polkadot/react-components'; import Params from '@polkadot/react-params'; -import jsonrpc from '@polkadot/types/interfaces/jsonrpc'; import { getTypeDef } from '@polkadot/types/create'; +import jsonrpc from '@polkadot/types/interfaces/jsonrpc'; import { isNull } from '@polkadot/util'; import { useTranslation } from '../translate'; diff --git a/packages/page-rpc/src/Rpc/index.tsx b/packages/page-rpc/src/Rpc/index.tsx index eec9aec4ab..a07902fc77 100644 --- a/packages/page-rpc/src/Rpc/index.tsx +++ b/packages/page-rpc/src/Rpc/index.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React, { useContext } from 'react'; + import { StatusContext } from '@polkadot/react-components'; import Results from './Results'; diff --git a/packages/page-rpc/src/index.tsx b/packages/page-rpc/src/index.tsx index bc25d855e7..219c4fc3db 100644 --- a/packages/page-rpc/src/index.tsx +++ b/packages/page-rpc/src/index.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-rpc authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AppProps as Props } from '@polkadot/react-components/types'; - import React, { useRef } from 'react'; import { Route, Switch } from 'react-router'; + +import type { AppProps as Props } from '@polkadot/react-components/types'; import Tabs from '@polkadot/react-components/Tabs'; import Rpc from './Rpc'; diff --git a/packages/page-settings/src/Developer.tsx b/packages/page-settings/src/Developer.tsx index 8a71dcc89c..eaf95068bd 100644 --- a/packages/page-settings/src/Developer.tsx +++ b/packages/page-settings/src/Developer.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-settings authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ActionStatus } from '@polkadot/react-components/Status/types'; - import React, { useCallback, useEffect, useState } from 'react'; import { Trans } from 'react-i18next'; import store from 'store'; import styled from 'styled-components'; + +import type { ActionStatus } from '@polkadot/react-components/Status/types'; import { registry } from '@polkadot/react-api'; import { Button, Editor, InputFile } from '@polkadot/react-components'; import { isJsonObject, stringToU8a, u8aToString } from '@polkadot/util'; diff --git a/packages/page-settings/src/General.tsx b/packages/page-settings/src/General.tsx index 0c83e30c67..0a697bf6e8 100644 --- a/packages/page-settings/src/General.tsx +++ b/packages/page-settings/src/General.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-settings authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Option } from '@polkadot/apps-config/settings/types'; +import React, { useCallback, useEffect, useMemo, useState } from 'react'; -import React, { useCallback, useEffect, useState, useMemo } from 'react'; +import type { Option } from '@polkadot/apps-config/settings/types'; import { createLanguages, createSs58 } from '@polkadot/apps-config'; import { isLedgerCapable } from '@polkadot/react-api'; import { Button, Dropdown } from '@polkadot/react-components'; diff --git a/packages/page-settings/src/I18n/StringInput.tsx b/packages/page-settings/src/I18n/StringInput.tsx index 84561cc024..322da00fb8 100644 --- a/packages/page-settings/src/I18n/StringInput.tsx +++ b/packages/page-settings/src/I18n/StringInput.tsx @@ -3,6 +3,7 @@ import React, { useCallback } from 'react'; import styled from 'styled-components'; + import { Input } from '@polkadot/react-components'; interface Props { diff --git a/packages/page-settings/src/I18n/index.tsx b/packages/page-settings/src/I18n/index.tsx index b2b6963994..5a3bd17527 100644 --- a/packages/page-settings/src/I18n/index.tsx +++ b/packages/page-settings/src/I18n/index.tsx @@ -4,6 +4,7 @@ import FileSaver from 'file-saver'; import React, { useCallback, useEffect, useState } from 'react'; import styled from 'styled-components'; + import { Button, Columar, Column, Dropdown, Progress, Spinner, Toggle } from '@polkadot/react-components'; import i18n from '@polkadot/react-components/i18n'; import languageCache from '@polkadot/react-components/i18n/cache'; diff --git a/packages/page-settings/src/Metadata/Extensions.tsx b/packages/page-settings/src/Metadata/Extensions.tsx index 6c7cfb310e..95ad1432c5 100644 --- a/packages/page-settings/src/Metadata/Extensions.tsx +++ b/packages/page-settings/src/Metadata/Extensions.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/app-settings authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ChainInfo } from '../types'; - import React, { useCallback, useMemo, useState } from 'react'; + import { extensionLogos } from '@polkadot/apps-config'; import { Button, Dropdown, Spinner } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; +import type { ChainInfo } from '../types'; import { useTranslation } from '../translate'; import useExtensions from '../useExtensions'; import iconOption from './iconOption'; diff --git a/packages/page-settings/src/Metadata/NetworkSpecs.tsx b/packages/page-settings/src/Metadata/NetworkSpecs.tsx index d161b11db3..d0a08ee7a4 100644 --- a/packages/page-settings/src/Metadata/NetworkSpecs.tsx +++ b/packages/page-settings/src/Metadata/NetworkSpecs.tsx @@ -1,16 +1,16 @@ // Copyright 2017-2020 @polkadot/app-settings authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ChainInfo } from '../types'; - import React, { useCallback, useEffect, useReducer, useState } from 'react'; import styled from 'styled-components'; + import { Button, ChainImg, Columar, Column, Input, QrNetworkSpecs, Spinner } from '@polkadot/react-components'; import { useApi, useDebounce } from '@polkadot/react-hooks'; import { NetworkSpecsStruct } from '@polkadot/ui-settings'; -import ChainColorIndicator from './ChainColorIndicator'; +import type { ChainInfo } from '../types'; import { useTranslation } from '../translate'; +import ChainColorIndicator from './ChainColorIndicator'; interface Props { chainInfo: ChainInfo | null; diff --git a/packages/page-settings/src/Metadata/index.tsx b/packages/page-settings/src/Metadata/index.tsx index 892a2c0316..5307fbed76 100644 --- a/packages/page-settings/src/Metadata/index.tsx +++ b/packages/page-settings/src/Metadata/index.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React from 'react'; + import { useApi } from '@polkadot/react-hooks'; import { useTranslation } from '../translate'; diff --git a/packages/page-settings/src/index.tsx b/packages/page-settings/src/index.tsx index 682bfc1c66..84c3ea5d27 100644 --- a/packages/page-settings/src/index.tsx +++ b/packages/page-settings/src/index.tsx @@ -1,19 +1,19 @@ // Copyright 2017-2020 @polkadot/app-settings authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AppProps as Props } from '@polkadot/react-components/types'; - import React, { useMemo } from 'react'; import { Route, Switch } from 'react-router'; + +import type { AppProps as Props } from '@polkadot/react-components/types'; import { HelpOverlay, Tabs } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; -import md from './md/basics.md'; -import { useTranslation } from './translate'; import Developer from './Developer'; -import I18n from './I18n'; -import Metadata from './Metadata'; import General from './General'; +import I18n from './I18n'; +import md from './md/basics.md'; +import Metadata from './Metadata'; +import { useTranslation } from './translate'; import useCounter from './useCounter'; export { useCounter }; diff --git a/packages/page-settings/src/useChainInfo.ts b/packages/page-settings/src/useChainInfo.ts index 3ffd5e07a0..4a15e12026 100644 --- a/packages/page-settings/src/useChainInfo.ts +++ b/packages/page-settings/src/useChainInfo.ts @@ -1,16 +1,16 @@ // Copyright 2017-2020 @polkadot/app-settings authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ChainInfo } from './types'; - import { useMemo } from 'react'; import { getSystemChainColor, getSystemIcon } from '@polkadot/apps-config'; -import { getSpecTypes } from '@polkadot/types-known'; import { DEFAULT_DECIMALS, DEFAULT_SS58, registry } from '@polkadot/react-api'; import { useApi } from '@polkadot/react-hooks'; +import { getSpecTypes } from '@polkadot/types-known'; import { isNumber } from '@polkadot/util'; +import type { ChainInfo } from './types'; + export default function useChainInfo (): ChainInfo | null { const { api, isApiReady, systemChain, systemName } = useApi(); diff --git a/packages/page-settings/src/useExtensions.ts b/packages/page-settings/src/useExtensions.ts index c458a4e982..af99c43f82 100644 --- a/packages/page-settings/src/useExtensions.ts +++ b/packages/page-settings/src/useExtensions.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-settings authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { InjectedExtension, InjectedMetadataKnown, MetadataDef } from '@polkadot/extension-inject/types'; - import { useEffect, useMemo, useState } from 'react'; import store from 'store'; + +import type { InjectedExtension, InjectedMetadataKnown, MetadataDef } from '@polkadot/extension-inject/types'; import { ApiPromise } from '@polkadot/api'; import { registry } from '@polkadot/react-api'; import { useApi } from '@polkadot/react-hooks'; diff --git a/packages/page-settings/src/util.tsx b/packages/page-settings/src/util.tsx index 944c374b9a..288bcb6927 100644 --- a/packages/page-settings/src/util.tsx +++ b/packages/page-settings/src/util.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-settings authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React from 'react'; + import type { Option } from '@polkadot/apps-config/settings/types'; import type { SettingsStruct } from '@polkadot/ui-settings/types'; - -import React from 'react'; import { ChainImg, Dropdown, IdentityIcon } from '@polkadot/react-components'; import uiSettings from '@polkadot/ui-settings'; diff --git a/packages/page-signing/src/Hash.tsx b/packages/page-signing/src/Hash.tsx index 7b2f91934c..ba26360ace 100644 --- a/packages/page-signing/src/Hash.tsx +++ b/packages/page-signing/src/Hash.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React, { useCallback, useState } from 'react'; + import { Input, Output, Static } from '@polkadot/react-components'; import { hexToU8a, isHex, stringToU8a } from '@polkadot/util'; import { blake2AsHex } from '@polkadot/util-crypto'; diff --git a/packages/page-signing/src/Sign.tsx b/packages/page-signing/src/Sign.tsx index 3aa78ea7b7..09c33c92e7 100644 --- a/packages/page-signing/src/Sign.tsx +++ b/packages/page-signing/src/Sign.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-signing authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Signer } from '@polkadot/api/types'; -import type { KeyringPair } from '@polkadot/keyring/types'; - import React, { useCallback, useEffect, useState } from 'react'; import styled from 'styled-components'; + +import type { Signer } from '@polkadot/api/types'; +import type { KeyringPair } from '@polkadot/keyring/types'; import { web3FromSource } from '@polkadot/extension-dapp'; import { Button, Input, InputAddress, Output, Static } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-signing/src/Unlock.tsx b/packages/page-signing/src/Unlock.tsx index 2bea949305..eaaceb888c 100644 --- a/packages/page-signing/src/Unlock.tsx +++ b/packages/page-signing/src/Unlock.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-signing authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { KeyringPair } from '@polkadot/keyring/types'; - import React, { useCallback, useEffect, useState } from 'react'; + +import type { KeyringPair } from '@polkadot/keyring/types'; import { Button, InputAddress, Modal, Password } from '@polkadot/react-components'; import { useTranslation } from './translate'; diff --git a/packages/page-signing/src/Verify.tsx b/packages/page-signing/src/Verify.tsx index c92d0421cd..72eadfd9f9 100644 --- a/packages/page-signing/src/Verify.tsx +++ b/packages/page-signing/src/Verify.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-signing authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { KeypairType } from '@polkadot/util-crypto/types'; - import React, { useCallback, useEffect, useState } from 'react'; import styled from 'styled-components'; + +import type { KeypairType } from '@polkadot/util-crypto/types'; import { Badge, Dropdown, Input, InputAddress, Static } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import keyring from '@polkadot/ui-keyring'; diff --git a/packages/page-signing/src/index.tsx b/packages/page-signing/src/index.tsx index 18afca7700..14b8703781 100644 --- a/packages/page-signing/src/index.tsx +++ b/packages/page-signing/src/index.tsx @@ -1,16 +1,16 @@ // Copyright 2017-2020 @polkadot/app-signing authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AppProps as Props } from '@polkadot/react-components/types'; - import React, { useRef } from 'react'; import { Route, Switch } from 'react-router'; + +import type { AppProps as Props } from '@polkadot/react-components/types'; import Tabs from '@polkadot/react-components/Tabs'; import Hash from './Hash'; import Sign from './Sign'; -import Verify from './Verify'; import { useTranslation } from './translate'; +import Verify from './Verify'; function SigningApp ({ basePath }: Props): React.ReactElement { const { t } = useTranslation(); diff --git a/packages/page-society/src/Overview/Bid.tsx b/packages/page-society/src/Overview/Bid.tsx index f8b6ea1af4..eaddb2fd55 100644 --- a/packages/page-society/src/Overview/Bid.tsx +++ b/packages/page-society/src/Overview/Bid.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-society authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Bid } from '@polkadot/types/interfaces'; - import React, { useEffect, useState } from 'react'; + +import type { Bid } from '@polkadot/types/interfaces'; import { AddressSmall, TxButton } from '@polkadot/react-components'; import { useAccounts } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; diff --git a/packages/page-society/src/Overview/BidNew.tsx b/packages/page-society/src/Overview/BidNew.tsx index 3d723a6aeb..5cab77fa61 100644 --- a/packages/page-society/src/Overview/BidNew.tsx +++ b/packages/page-society/src/Overview/BidNew.tsx @@ -3,6 +3,7 @@ import BN from 'bn.js'; import React, { useState } from 'react'; + import { InputAddress, InputBalance, Modal, TxButton } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-society/src/Overview/Bids.tsx b/packages/page-society/src/Overview/Bids.tsx index 67b9782936..b1710ef61b 100644 --- a/packages/page-society/src/Overview/Bids.tsx +++ b/packages/page-society/src/Overview/Bids.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-society authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Bid } from '@polkadot/types/interfaces'; - import React, { useRef } from 'react'; + +import type { Bid } from '@polkadot/types/interfaces'; import { Table } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-society/src/Overview/Candidate.tsx b/packages/page-society/src/Overview/Candidate.tsx index ed6443501a..999eb155d8 100644 --- a/packages/page-society/src/Overview/Candidate.tsx +++ b/packages/page-society/src/Overview/Candidate.tsx @@ -1,16 +1,16 @@ // Copyright 2017-2020 @polkadot/app-society authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React from 'react'; + import type { DeriveSocietyCandidate } from '@polkadot/api-derive/types'; import type { Option } from '@polkadot/types'; import type { AccountId, SocietyVote } from '@polkadot/types/interfaces'; -import type { VoteType } from '../types'; - -import React from 'react'; import { AddressSmall } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; +import type { VoteType } from '../types'; import CandidateVoting from './CandidateVoting'; import Votes from './Votes'; diff --git a/packages/page-society/src/Overview/CandidateVoting.tsx b/packages/page-society/src/Overview/CandidateVoting.tsx index 9d61a4dae5..d60ccc3fe0 100644 --- a/packages/page-society/src/Overview/CandidateVoting.tsx +++ b/packages/page-society/src/Overview/CandidateVoting.tsx @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import React, { useRef, useState } from 'react'; + +import { Button, Dropdown, InputAddress, Modal, TxButton } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; import { useTranslation } from '../translate'; -import { Button, Dropdown, InputAddress, Modal, TxButton } from '@polkadot/react-components'; interface Props { candidateId: string; diff --git a/packages/page-society/src/Overview/Candidates.tsx b/packages/page-society/src/Overview/Candidates.tsx index 09c7e08b97..313a077dea 100644 --- a/packages/page-society/src/Overview/Candidates.tsx +++ b/packages/page-society/src/Overview/Candidates.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-society authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveSocietyCandidate } from '@polkadot/api-derive/types'; - import React, { useRef } from 'react'; + +import type { DeriveSocietyCandidate } from '@polkadot/api-derive/types'; import { Table } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-society/src/Overview/Defender.tsx b/packages/page-society/src/Overview/Defender.tsx index 77b2a3d2b0..31ce66a2ca 100644 --- a/packages/page-society/src/Overview/Defender.tsx +++ b/packages/page-society/src/Overview/Defender.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-society authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useRef } from 'react'; + import type { DeriveSociety, DeriveSocietyMember } from '@polkadot/api-derive/types'; import type { SocietyVote } from '@polkadot/types/interfaces'; -import type { VoteType } from '../types'; - -import React, { useRef } from 'react'; import { AddressSmall, Table } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; +import type { VoteType } from '../types'; import { useTranslation } from '../translate'; import DefenderVoting from './DefenderVoting'; import Votes from './Votes'; diff --git a/packages/page-society/src/Overview/DefenderVoting.tsx b/packages/page-society/src/Overview/DefenderVoting.tsx index b1376c04f8..78121e7b74 100644 --- a/packages/page-society/src/Overview/DefenderVoting.tsx +++ b/packages/page-society/src/Overview/DefenderVoting.tsx @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import React, { useRef, useState } from 'react'; + +import { Button, Dropdown, InputAddress, Modal, TxButton } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; import { useTranslation } from '../translate'; -import { Button, Dropdown, InputAddress, Modal, TxButton } from '@polkadot/react-components'; interface Props { isMember: boolean; diff --git a/packages/page-society/src/Overview/Member.tsx b/packages/page-society/src/Overview/Member.tsx index 851d5cf6b8..cae5b2daa5 100644 --- a/packages/page-society/src/Overview/Member.tsx +++ b/packages/page-society/src/Overview/Member.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-society authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveSocietyMember } from '@polkadot/api-derive/types'; - import React, { useEffect, useRef, useState } from 'react'; + +import type { DeriveSocietyMember } from '@polkadot/api-derive/types'; import { AddressSmall, Icon, Modal, Tag } from '@polkadot/react-components'; import { useApi, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-society/src/Overview/Members.tsx b/packages/page-society/src/Overview/Members.tsx index 9ac6693fec..11640ccfa4 100644 --- a/packages/page-society/src/Overview/Members.tsx +++ b/packages/page-society/src/Overview/Members.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-society authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveSociety, DeriveSocietyMember } from '@polkadot/api-derive/types'; - import React, { useMemo, useRef } from 'react'; + +import type { DeriveSociety, DeriveSocietyMember } from '@polkadot/api-derive/types'; import { Table } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-society/src/Overview/Summary.tsx b/packages/page-society/src/Overview/Summary.tsx index c24445808b..b0f24f87c5 100644 --- a/packages/page-society/src/Overview/Summary.tsx +++ b/packages/page-society/src/Overview/Summary.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-society authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveSociety } from '@polkadot/api-derive/types'; -import type { BlockNumber } from '@polkadot/types/interfaces'; - import React, { useMemo } from 'react'; import styled from 'styled-components'; -import { SummaryBox, CardSummary } from '@polkadot/react-components'; + +import type { DeriveSociety } from '@polkadot/api-derive/types'; +import type { BlockNumber } from '@polkadot/types/interfaces'; +import { CardSummary, SummaryBox } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; diff --git a/packages/page-society/src/Overview/Votes.tsx b/packages/page-society/src/Overview/Votes.tsx index 85efd849e4..1c22332b1a 100644 --- a/packages/page-society/src/Overview/Votes.tsx +++ b/packages/page-society/src/Overview/Votes.tsx @@ -1,10 +1,9 @@ // Copyright 2017-2020 @polkadot/app-society authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { VoteSplit, VoteType } from '../types'; - import React, { useEffect, useState } from 'react'; +import type { VoteSplit, VoteType } from '../types'; import { useTranslation } from '../translate'; import VotesExpander from './VotesExpander'; diff --git a/packages/page-society/src/Overview/VotesExpander.tsx b/packages/page-society/src/Overview/VotesExpander.tsx index 631ec00148..fb1f34bca2 100644 --- a/packages/page-society/src/Overview/VotesExpander.tsx +++ b/packages/page-society/src/Overview/VotesExpander.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/app-society authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { VoteType } from '../types'; - import React from 'react'; + import { AddressMini, Expander } from '@polkadot/react-components'; +import type { VoteType } from '../types'; + interface Props { label: string; votes: VoteType[]; diff --git a/packages/page-society/src/Overview/index.tsx b/packages/page-society/src/Overview/index.tsx index 50d87fc223..a097156951 100644 --- a/packages/page-society/src/Overview/index.tsx +++ b/packages/page-society/src/Overview/index.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/app-society authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveSociety } from '@polkadot/api-derive/types'; - import React from 'react'; import styled from 'styled-components'; + +import type { DeriveSociety } from '@polkadot/api-derive/types'; import { Button } from '@polkadot/react-components'; import { useApi, useCall, useToggle } from '@polkadot/react-hooks'; +import { useTranslation } from '../translate'; import useMembers from '../useMembers'; import BidNew from './BidNew'; import Bids from './Bids'; @@ -16,8 +17,6 @@ import Defender from './Defender'; import Members from './Members'; import Summary from './Summary'; -import { useTranslation } from '../translate'; - interface Props { className?: string; } diff --git a/packages/page-society/src/index.tsx b/packages/page-society/src/index.tsx index 5b9cea7919..9a35bb4ef3 100644 --- a/packages/page-society/src/index.tsx +++ b/packages/page-society/src/index.tsx @@ -3,6 +3,7 @@ import React, { useRef } from 'react'; import { Route, Switch } from 'react-router'; + import { Tabs } from '@polkadot/react-components'; import Overview from './Overview'; diff --git a/packages/page-society/src/useCounter.ts b/packages/page-society/src/useCounter.ts index 46c8fb2a62..6fb954a1d6 100644 --- a/packages/page-society/src/useCounter.ts +++ b/packages/page-society/src/useCounter.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import type { Bid } from '@polkadot/types/interfaces'; - import { useApi, useCall } from '@polkadot/react-hooks'; export default function useCounter (): number { diff --git a/packages/page-society/src/useMembers.ts b/packages/page-society/src/useMembers.ts index 4c8846a62b..a584c20291 100644 --- a/packages/page-society/src/useMembers.ts +++ b/packages/page-society/src/useMembers.ts @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/app-society authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveSocietyMember } from '@polkadot/api-derive/types'; -import type { OwnMembers } from './types'; - import { useEffect, useState } from 'react'; + +import type { DeriveSocietyMember } from '@polkadot/api-derive/types'; import { useAccounts, useApi, useCall } from '@polkadot/react-hooks'; +import type { OwnMembers } from './types'; + function transform (allAccounts: string[], members: DeriveSocietyMember[]): OwnMembers { const allMembers = members .filter((member): boolean => !member.isSuspended) diff --git a/packages/page-staking/src/Actions/Account/BondExtra.tsx b/packages/page-staking/src/Actions/Account/BondExtra.tsx index 9005609467..fb27195063 100644 --- a/packages/page-staking/src/Actions/Account/BondExtra.tsx +++ b/packages/page-staking/src/Actions/Account/BondExtra.tsx @@ -1,17 +1,17 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveBalancesAll, DeriveStakingAccount } from '@polkadot/api-derive/types'; -import type { AmountValidateState } from '../types'; - import BN from 'bn.js'; import React, { useMemo, useState } from 'react'; + +import type { DeriveBalancesAll, DeriveStakingAccount } from '@polkadot/api-derive/types'; import { ApiPromise } from '@polkadot/api'; import { InputAddress, InputBalance, Modal, TxButton } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BalanceFree } from '@polkadot/react-query'; import { BN_ZERO } from '@polkadot/util'; +import type { AmountValidateState } from '../types'; import { useTranslation } from '../../translate'; import ValidateAmount from './InputValidateAmount'; diff --git a/packages/page-staking/src/Actions/Account/InjectKeys.tsx b/packages/page-staking/src/Actions/Account/InjectKeys.tsx index a4f109fb6e..8601261cd1 100644 --- a/packages/page-staking/src/Actions/Account/InjectKeys.tsx +++ b/packages/page-staking/src/Actions/Account/InjectKeys.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { KeypairType } from '@polkadot/util-crypto/types'; - import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react'; + +import type { KeypairType } from '@polkadot/util-crypto/types'; import { Button, Dropdown, Input, Modal, StatusContext } from '@polkadot/react-components'; import keyring from '@polkadot/ui-keyring'; import { assert, u8aToHex } from '@polkadot/util'; diff --git a/packages/page-staking/src/Actions/Account/InputValidateAmount.tsx b/packages/page-staking/src/Actions/Account/InputValidateAmount.tsx index 748017bf9c..6d8225dd55 100644 --- a/packages/page-staking/src/Actions/Account/InputValidateAmount.tsx +++ b/packages/page-staking/src/Actions/Account/InputValidateAmount.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; -import type { AmountValidateState } from '../types'; - import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; + +import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BN_TEN, BN_THOUSAND, BN_ZERO, formatBalance } from '@polkadot/util'; +import type { AmountValidateState } from '../types'; import { useTranslation } from '../../translate'; interface Props { diff --git a/packages/page-staking/src/Actions/Account/InputValidationController.tsx b/packages/page-staking/src/Actions/Account/InputValidationController.tsx index d62d4c1504..e5fd52194d 100644 --- a/packages/page-staking/src/Actions/Account/InputValidationController.tsx +++ b/packages/page-staking/src/Actions/Account/InputValidationController.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useEffect, useState } from 'react'; + import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; import type { Option } from '@polkadot/types'; import type { AccountId, StakingLedger } from '@polkadot/types/interfaces'; - -import React, { useEffect, useState } from 'react'; import { useApi, useCall } from '@polkadot/react-hooks'; import { useTranslation } from '../../translate'; diff --git a/packages/page-staking/src/Actions/Account/InputValidationSessionKey.tsx b/packages/page-staking/src/Actions/Account/InputValidationSessionKey.tsx index ed7266feda..9f19390d1d 100644 --- a/packages/page-staking/src/Actions/Account/InputValidationSessionKey.tsx +++ b/packages/page-staking/src/Actions/Account/InputValidationSessionKey.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { I18nProps } from '@polkadot/react-components/types'; - import React, { useEffect, useState } from 'react'; +import type { I18nProps } from '@polkadot/react-components/types'; + import { useTranslation } from '../../translate'; interface Props extends I18nProps { diff --git a/packages/page-staking/src/Actions/Account/ListNominees.tsx b/packages/page-staking/src/Actions/Account/ListNominees.tsx index 4591fb2028..5d9e0a5cbb 100644 --- a/packages/page-staking/src/Actions/Account/ListNominees.tsx +++ b/packages/page-staking/src/Actions/Account/ListNominees.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveEraExposure, DeriveSessionIndexes } from '@polkadot/api-derive/types'; - import BN from 'bn.js'; import React, { useMemo } from 'react'; + +import type { DeriveEraExposure, DeriveSessionIndexes } from '@polkadot/api-derive/types'; import { AddressMini, Expander } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-staking/src/Actions/Account/Nominate.tsx b/packages/page-staking/src/Actions/Account/Nominate.tsx index 52e041da9f..5e9e82d441 100644 --- a/packages/page-staking/src/Actions/Account/Nominate.tsx +++ b/packages/page-staking/src/Actions/Account/Nominate.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { NominateInfo } from '../partials/types'; -import type { SortedTargets } from '../../types'; - import React, { useState } from 'react'; import styled from 'styled-components'; + import { Modal, TxButton } from '@polkadot/react-components'; +import type { SortedTargets } from '../../types'; +import type { NominateInfo } from '../partials/types'; import { useTranslation } from '../../translate'; import NominatePartial from '../partials/Nominate'; diff --git a/packages/page-staking/src/Actions/Account/SetControllerAccount.tsx b/packages/page-staking/src/Actions/Account/SetControllerAccount.tsx index 5562e4eb43..d1a25ee21b 100644 --- a/packages/page-staking/src/Actions/Account/SetControllerAccount.tsx +++ b/packages/page-staking/src/Actions/Account/SetControllerAccount.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React, { useCallback, useState } from 'react'; + import { InputAddress, Modal, TxButton } from '@polkadot/react-components'; import { useTranslation } from '../../translate'; diff --git a/packages/page-staking/src/Actions/Account/SetRewardDestination.tsx b/packages/page-staking/src/Actions/Account/SetRewardDestination.tsx index 840dc09ce4..a6b57015db 100644 --- a/packages/page-staking/src/Actions/Account/SetRewardDestination.tsx +++ b/packages/page-staking/src/Actions/Account/SetRewardDestination.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { RewardDestination } from '@polkadot/types/interfaces'; -import type { DestinationType } from '../types'; - import React, { useMemo, useState } from 'react'; + +import type { RewardDestination } from '@polkadot/types/interfaces'; import { Dropdown, InputAddress, Modal, TxButton } from '@polkadot/react-components'; +import type { DestinationType } from '../types'; import { useTranslation } from '../../translate'; import { createDestCurr } from '../destOptions'; diff --git a/packages/page-staking/src/Actions/Account/SetSessionKey.tsx b/packages/page-staking/src/Actions/Account/SetSessionKey.tsx index 3db6741657..4946777c57 100644 --- a/packages/page-staking/src/Actions/Account/SetSessionKey.tsx +++ b/packages/page-staking/src/Actions/Account/SetSessionKey.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SessionInfo } from '../partials/types'; - import React, { useState } from 'react'; + import { Modal, TxButton } from '@polkadot/react-components'; +import type { SessionInfo } from '../partials/types'; import { useTranslation } from '../../translate'; import SessionKeyPartital from '../partials/SessionKey'; diff --git a/packages/page-staking/src/Actions/Account/Unbond.tsx b/packages/page-staking/src/Actions/Account/Unbond.tsx index 51eee67f2b..a111a1cbe6 100644 --- a/packages/page-staking/src/Actions/Account/Unbond.tsx +++ b/packages/page-staking/src/Actions/Account/Unbond.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AccountId, StakingLedger } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; import React, { useState } from 'react'; import styled from 'styled-components'; + +import type { AccountId, StakingLedger } from '@polkadot/types/interfaces'; import { InputAddress, InputBalance, Modal, Static, Toggle, TxButton } from '@polkadot/react-components'; import { BlockToTime } from '@polkadot/react-query'; diff --git a/packages/page-staking/src/Actions/Account/Validate.tsx b/packages/page-staking/src/Actions/Account/Validate.tsx index 167b0cea16..9d662e9846 100644 --- a/packages/page-staking/src/Actions/Account/Validate.tsx +++ b/packages/page-staking/src/Actions/Account/Validate.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ValidateInfo } from '../partials/types'; - import React, { useState } from 'react'; + import { Modal, TxButton } from '@polkadot/react-components'; +import type { ValidateInfo } from '../partials/types'; import { useTranslation } from '../../translate'; import ValidatePartial from '../partials/Validate'; diff --git a/packages/page-staking/src/Actions/Account/index.tsx b/packages/page-staking/src/Actions/Account/index.tsx index 24f3f641b4..febb89fa39 100644 --- a/packages/page-staking/src/Actions/Account/index.tsx +++ b/packages/page-staking/src/Actions/Account/index.tsx @@ -1,21 +1,21 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveBalancesAll, DeriveStakingAccount } from '@polkadot/api-derive/types'; -import type { Option } from '@polkadot/types'; -import type { SlashingSpans, UnappliedSlash } from '@polkadot/types/interfaces'; -import type { StakerState } from '@polkadot/react-hooks/types'; -import type { SortedTargets } from '../../types'; -import type { Slash } from '../types'; - import BN from 'bn.js'; import React, { useCallback, useContext, useMemo } from 'react'; import styled from 'styled-components'; + +import type { DeriveBalancesAll, DeriveStakingAccount } from '@polkadot/api-derive/types'; +import type { StakerState } from '@polkadot/react-hooks/types'; +import type { Option } from '@polkadot/types'; +import type { SlashingSpans, UnappliedSlash } from '@polkadot/types/interfaces'; import { ApiPromise } from '@polkadot/api'; import { AddressInfo, AddressMini, AddressSmall, Badge, Button, Menu, Popup, StakingBonded, StakingRedeemable, StakingUnbonding, StatusContext, TxButton } from '@polkadot/react-components'; import { useApi, useCall, useToggle } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; +import type { SortedTargets } from '../../types'; +import type { Slash } from '../types'; import { useTranslation } from '../../translate'; import BondExtra from './BondExtra'; import InjectKeys from './InjectKeys'; diff --git a/packages/page-staking/src/Actions/NewNominator.tsx b/packages/page-staking/src/Actions/NewNominator.tsx index 19640bbc1d..89799f7889 100644 --- a/packages/page-staking/src/Actions/NewNominator.tsx +++ b/packages/page-staking/src/Actions/NewNominator.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { BondInfo, NominateInfo } from './partials/types'; -import type { SortedTargets } from '../types'; - import React, { useCallback, useState } from 'react'; + import { Button, Modal, TxButton } from '@polkadot/react-components'; import { useApi, useToggle } from '@polkadot/react-hooks'; import { isFunction } from '@polkadot/util'; +import type { SortedTargets } from '../types'; +import type { BondInfo, NominateInfo } from './partials/types'; import { useTranslation } from '../translate'; import BondPartial from './partials/Bond'; import NominatePartial from './partials/Nominate'; diff --git a/packages/page-staking/src/Actions/NewStash.tsx b/packages/page-staking/src/Actions/NewStash.tsx index ffaf07b415..e5537a55e3 100644 --- a/packages/page-staking/src/Actions/NewStash.tsx +++ b/packages/page-staking/src/Actions/NewStash.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { BondInfo } from './partials/types'; - import React, { useCallback, useState } from 'react'; + import { Button, Modal, TxButton } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; +import type { BondInfo } from './partials/types'; import { useTranslation } from '../translate'; import BondPartial from './partials/Bond'; diff --git a/packages/page-staking/src/Actions/NewValidator.tsx b/packages/page-staking/src/Actions/NewValidator.tsx index 45633a932d..ebde4b5494 100644 --- a/packages/page-staking/src/Actions/NewValidator.tsx +++ b/packages/page-staking/src/Actions/NewValidator.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { BondInfo, SessionInfo, ValidateInfo } from './partials/types'; - import React, { useCallback, useState } from 'react'; + import { Button, Modal, TxButton } from '@polkadot/react-components'; import { useApi, useToggle } from '@polkadot/react-hooks'; import { isFunction } from '@polkadot/util'; +import type { BondInfo, SessionInfo, ValidateInfo } from './partials/types'; import { useTranslation } from '../translate'; import BondPartial from './partials/Bond'; import SessionKeyPartial from './partials/SessionKey'; diff --git a/packages/page-staking/src/Actions/index.tsx b/packages/page-staking/src/Actions/index.tsx index f689b4cebf..c410be7fdc 100644 --- a/packages/page-staking/src/Actions/index.tsx +++ b/packages/page-staking/src/Actions/index.tsx @@ -1,16 +1,16 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { StakerState } from '@polkadot/react-hooks/types'; -import type { SortedTargets } from '../types'; - import BN from 'bn.js'; import React, { useMemo, useRef, useState } from 'react'; + +import type { StakerState } from '@polkadot/react-hooks/types'; import { Button, Table, ToggleGroup } from '@polkadot/react-components'; import { useAvailableSlashes } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; import { BN_ZERO } from '@polkadot/util'; +import type { SortedTargets } from '../types'; import ElectionBanner from '../ElectionBanner'; import { useTranslation } from '../translate'; import Account from './Account'; diff --git a/packages/page-staking/src/Actions/partials/Bond.tsx b/packages/page-staking/src/Actions/partials/Bond.tsx index 036346bd4e..8811c91205 100644 --- a/packages/page-staking/src/Actions/partials/Bond.tsx +++ b/packages/page-staking/src/Actions/partials/Bond.tsx @@ -1,17 +1,17 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; -import type { AmountValidateState, DestinationType } from '../types'; -import type { BondInfo } from './types'; - import BN from 'bn.js'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; + +import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; import { Dropdown, InputAddress, InputBalance, Modal, Static } from '@polkadot/react-components'; -import { BalanceFree, BlockToTime } from '@polkadot/react-query'; import { useApi, useCall } from '@polkadot/react-hooks'; +import { BalanceFree, BlockToTime } from '@polkadot/react-query'; import { BN_ZERO } from '@polkadot/util'; +import type { AmountValidateState, DestinationType } from '../types'; +import type { BondInfo } from './types'; import { useTranslation } from '../../translate'; import InputValidateAmount from '../Account/InputValidateAmount'; import InputValidationController from '../Account/InputValidationController'; diff --git a/packages/page-staking/src/Actions/partials/Nominate.tsx b/packages/page-staking/src/Actions/partials/Nominate.tsx index 4c035312d8..2d6fa2c8ee 100644 --- a/packages/page-staking/src/Actions/partials/Nominate.tsx +++ b/packages/page-staking/src/Actions/partials/Nominate.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { NominateInfo } from './types'; -import type { SortedTargets } from '../../types'; - import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; + import { InputAddress, InputAddressMulti, Modal } from '@polkadot/react-components'; import { useApi, useFavorites } from '@polkadot/react-hooks'; +import type { SortedTargets } from '../../types'; +import type { NominateInfo } from './types'; import { MAX_NOMINATIONS, STORE_FAVS_BASE } from '../../constants'; import { useTranslation } from '../../translate'; diff --git a/packages/page-staking/src/Actions/partials/SessionKey.tsx b/packages/page-staking/src/Actions/partials/SessionKey.tsx index 52edd946b6..a2dc55bf49 100644 --- a/packages/page-staking/src/Actions/partials/SessionKey.tsx +++ b/packages/page-staking/src/Actions/partials/SessionKey.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SessionInfo } from './types'; - import React, { useEffect, useState } from 'react'; -import { InputAddress, Input, Modal } from '@polkadot/react-components'; + +import { Input, InputAddress, Modal } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import { isHex } from '@polkadot/util'; +import type { SessionInfo } from './types'; import { useTranslation } from '../../translate'; interface Props { diff --git a/packages/page-staking/src/Actions/partials/Validate.tsx b/packages/page-staking/src/Actions/partials/Validate.tsx index 56b3495819..29626caa03 100644 --- a/packages/page-staking/src/Actions/partials/Validate.tsx +++ b/packages/page-staking/src/Actions/partials/Validate.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ValidateInfo } from './types'; - import BN from 'bn.js'; import React, { useCallback } from 'react'; + import { InputAddress, InputNumber, Modal } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; -import { BN_ZERO, BN_HUNDRED as MAX_COMM } from '@polkadot/util'; +import { BN_HUNDRED as MAX_COMM, BN_ZERO } from '@polkadot/util'; +import type { ValidateInfo } from './types'; import { useTranslation } from '../../translate'; interface Props { diff --git a/packages/page-staking/src/Actions/types.ts b/packages/page-staking/src/Actions/types.ts index 59c989bff6..b94c5e3ad0 100644 --- a/packages/page-staking/src/Actions/types.ts +++ b/packages/page-staking/src/Actions/types.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AccountId, Balance, UnappliedSlashOther } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; +import type { AccountId, Balance, UnappliedSlashOther } from '@polkadot/types/interfaces'; + export interface AmountValidateState { error: string | null; warning: string | null; diff --git a/packages/page-staking/src/Actions/useInactives.ts b/packages/page-staking/src/Actions/useInactives.ts index d22c608ec7..965d96ad50 100644 --- a/packages/page-staking/src/Actions/useInactives.ts +++ b/packages/page-staking/src/Actions/useInactives.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import { useEffect, useState } from 'react'; + import type { DeriveSessionIndexes } from '@polkadot/api-derive/types'; import type { Option } from '@polkadot/types'; import type { EraIndex, Exposure, Nominations, SlashingSpans } from '@polkadot/types/interfaces'; - -import { useEffect, useState } from 'react'; import { ApiPromise } from '@polkadot/api'; import { useApi, useCall, useIsMountedRef } from '@polkadot/react-hooks'; diff --git a/packages/page-staking/src/Actions/useUnbondDuration.ts b/packages/page-staking/src/Actions/useUnbondDuration.ts index dfb002077f..8de52e16e3 100644 --- a/packages/page-staking/src/Actions/useUnbondDuration.ts +++ b/packages/page-staking/src/Actions/useUnbondDuration.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveSessionInfo } from '@polkadot/api-derive/types'; - import BN from 'bn.js'; import { useMemo } from 'react'; + +import type { DeriveSessionInfo } from '@polkadot/api-derive/types'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BN_ONE } from '@polkadot/util'; diff --git a/packages/page-staking/src/Filtering.tsx b/packages/page-staking/src/Filtering.tsx index c02ad29b0b..57380b0acd 100644 --- a/packages/page-staking/src/Filtering.tsx +++ b/packages/page-staking/src/Filtering.tsx @@ -3,6 +3,7 @@ import queryString from 'query-string'; import React, { useCallback, useEffect } from 'react'; + import { Input, Toggle } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import { isString } from '@polkadot/util'; diff --git a/packages/page-staking/src/Legend.tsx b/packages/page-staking/src/Legend.tsx index 94ff20efe9..1e89dd7772 100644 --- a/packages/page-staking/src/Legend.tsx +++ b/packages/page-staking/src/Legend.tsx @@ -3,6 +3,7 @@ import React from 'react'; import styled from 'styled-components'; + import { Badge, Icon } from '@polkadot/react-components'; import { useTranslation } from './translate'; diff --git a/packages/page-staking/src/MaxBadge.tsx b/packages/page-staking/src/MaxBadge.tsx index b58407e784..0661ce6001 100644 --- a/packages/page-staking/src/MaxBadge.tsx +++ b/packages/page-staking/src/MaxBadge.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React from 'react'; + import { Badge } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; diff --git a/packages/page-staking/src/Overview/Address/Favorite.tsx b/packages/page-staking/src/Overview/Address/Favorite.tsx index 2c29d2cd3a..c709ff5be4 100644 --- a/packages/page-staking/src/Overview/Address/Favorite.tsx +++ b/packages/page-staking/src/Overview/Address/Favorite.tsx @@ -3,6 +3,7 @@ import React, { useCallback } from 'react'; import styled from 'styled-components'; + import { Icon } from '@polkadot/react-components'; interface Props { diff --git a/packages/page-staking/src/Overview/Address/NominatedBy.tsx b/packages/page-staking/src/Overview/Address/NominatedBy.tsx index 6ebd547dee..d3799384fb 100644 --- a/packages/page-staking/src/Overview/Address/NominatedBy.tsx +++ b/packages/page-staking/src/Overview/Address/NominatedBy.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SlashingSpans } from '@polkadot/types/interfaces'; -import type { NominatedBy as NominatedByType } from '../../types'; - import React, { useMemo } from 'react'; + +import type { SlashingSpans } from '@polkadot/types/interfaces'; import { AddressMini, Expander } from '@polkadot/react-components'; import { formatNumber } from '@polkadot/util'; +import type { NominatedBy as NominatedByType } from '../../types'; import { useTranslation } from '../../translate'; interface Props { diff --git a/packages/page-staking/src/Overview/Address/StakeOther.tsx b/packages/page-staking/src/Overview/Address/StakeOther.tsx index 2844c40b10..21785e3a9f 100644 --- a/packages/page-staking/src/Overview/Address/StakeOther.tsx +++ b/packages/page-staking/src/Overview/Address/StakeOther.tsx @@ -1,15 +1,16 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { NominatorValue } from './types'; - import BN from 'bn.js'; import React, { useMemo } from 'react'; + import { AddressMini, Expander } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; import { BN_ZERO } from '@polkadot/util'; +import type { NominatorValue } from './types'; + interface Props { stakeOther?: BN; nominators: NominatorValue[]; diff --git a/packages/page-staking/src/Overview/Address/Status.tsx b/packages/page-staking/src/Overview/Address/Status.tsx index 805352b733..43606bf638 100644 --- a/packages/page-staking/src/Overview/Address/Status.tsx +++ b/packages/page-staking/src/Overview/Address/Status.tsx @@ -3,6 +3,7 @@ import BN from 'bn.js'; import React, { useMemo } from 'react'; + import { Badge, Icon } from '@polkadot/react-components'; import { useAccounts } from '@polkadot/react-hooks'; diff --git a/packages/page-staking/src/Overview/Address/index.tsx b/packages/page-staking/src/Overview/Address/index.tsx index eb85b2d9b4..c4e3132b3b 100644 --- a/packages/page-staking/src/Overview/Address/index.tsx +++ b/packages/page-staking/src/Overview/Address/index.tsx @@ -1,24 +1,24 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import BN from 'bn.js'; +import React, { useCallback, useMemo } from 'react'; + import type { DeriveAccountInfo } from '@polkadot/api-derive/types'; import type { Option } from '@polkadot/types'; import type { SlashingSpans, ValidatorPrefs } from '@polkadot/types/interfaces'; -import type { NominatedBy as NominatedByType, ValidatorInfo } from '../../types'; -import type { NominatorValue } from './types'; - -import BN from 'bn.js'; -import React, { useCallback, useMemo } from 'react'; import { ApiPromise } from '@polkadot/api'; import { AddressSmall, Icon, LinkExternal } from '@polkadot/react-components'; import { checkVisibility } from '@polkadot/react-components/util'; import { useApi, useCall } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; +import type { NominatedBy as NominatedByType, ValidatorInfo } from '../../types'; +import type { NominatorValue } from './types'; import Favorite from './Favorite'; import NominatedBy from './NominatedBy'; -import Status from './Status'; import StakeOther from './StakeOther'; +import Status from './Status'; interface Props { address: string; diff --git a/packages/page-staking/src/Overview/CurrentList.tsx b/packages/page-staking/src/Overview/CurrentList.tsx index 266df9344f..c040872ec4 100644 --- a/packages/page-staking/src/Overview/CurrentList.tsx +++ b/packages/page-staking/src/Overview/CurrentList.tsx @@ -1,16 +1,16 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveHeartbeats, DeriveStakingOverview } from '@polkadot/api-derive/types'; -import type { AccountId } from '@polkadot/types/interfaces'; -import type { Authors } from '@polkadot/react-query/BlockAuthors'; -import type { SortedTargets, ValidatorInfo } from '../types'; - import React, { useCallback, useContext, useMemo, useRef, useState } from 'react'; + +import type { DeriveHeartbeats, DeriveStakingOverview } from '@polkadot/api-derive/types'; +import type { Authors } from '@polkadot/react-query/BlockAuthors'; +import type { AccountId } from '@polkadot/types/interfaces'; import { Table } from '@polkadot/react-components'; import { useApi, useCall, useLoadingDelay } from '@polkadot/react-hooks'; import { BlockAuthorsContext } from '@polkadot/react-query'; +import type { SortedTargets, ValidatorInfo } from '../types'; import Filtering from '../Filtering'; import Legend from '../Legend'; import { useTranslation } from '../translate'; diff --git a/packages/page-staking/src/Overview/Summary.tsx b/packages/page-staking/src/Overview/Summary.tsx index a113266bbc..f973ec6c5c 100644 --- a/packages/page-staking/src/Overview/Summary.tsx +++ b/packages/page-staking/src/Overview/Summary.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveStakingOverview } from '@polkadot/api-derive/types'; - import React, { useContext } from 'react'; import styled from 'styled-components'; + +import type { DeriveStakingOverview } from '@polkadot/api-derive/types'; import SummarySession from '@polkadot/app-explorer/SummarySession'; import { CardSummary, IdentityIcon, SummaryBox } from '@polkadot/react-components'; import { BlockAuthorsContext } from '@polkadot/react-query'; diff --git a/packages/page-staking/src/Overview/index.tsx b/packages/page-staking/src/Overview/index.tsx index b8fcf907e3..a5370b8161 100644 --- a/packages/page-staking/src/Overview/index.tsx +++ b/packages/page-staking/src/Overview/index.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveStakingOverview } from '@polkadot/api-derive/types'; -import type { SortedTargets } from '../types'; - import React from 'react'; +import type { DeriveStakingOverview } from '@polkadot/api-derive/types'; + +import type { SortedTargets } from '../types'; import CurrentList from './CurrentList'; interface Props { diff --git a/packages/page-staking/src/Payouts/PayButton.tsx b/packages/page-staking/src/Payouts/PayButton.tsx index c28580844c..1577299d79 100644 --- a/packages/page-staking/src/Payouts/PayButton.tsx +++ b/packages/page-staking/src/Payouts/PayButton.tsx @@ -1,16 +1,16 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useEffect, useState } from 'react'; +import styled from 'styled-components'; + import type { SubmittableExtrinsic } from '@polkadot/api/types'; import type { EraIndex } from '@polkadot/types/interfaces'; -import type { PayoutValidator } from './types'; - -import React, { useState, useEffect } from 'react'; -import styled from 'styled-components'; import { ApiPromise } from '@polkadot/api'; -import { AddressMini, Button, Modal, InputAddress, Static, TxButton } from '@polkadot/react-components'; -import { useApi, useAccounts, useToggle } from '@polkadot/react-hooks'; +import { AddressMini, Button, InputAddress, Modal, Static, TxButton } from '@polkadot/react-components'; +import { useAccounts, useApi, useToggle } from '@polkadot/react-hooks'; +import type { PayoutValidator } from './types'; import { useTranslation } from '../translate'; interface Props { diff --git a/packages/page-staking/src/Payouts/Stash.tsx b/packages/page-staking/src/Payouts/Stash.tsx index 9af371bac9..545b938c04 100644 --- a/packages/page-staking/src/Payouts/Stash.tsx +++ b/packages/page-staking/src/Payouts/Stash.tsx @@ -1,20 +1,20 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SubmittableExtrinsic } from '@polkadot/api/types'; -import type { DeriveStakerReward, DeriveStakingAccount } from '@polkadot/api-derive/types'; -import type { PayoutStash } from './types'; - import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; + +import type { DeriveStakerReward, DeriveStakingAccount } from '@polkadot/api-derive/types'; +import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { ApiPromise } from '@polkadot/api'; import { AddressSmall, TxButton } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BlockToTime, FormatBalance } from '@polkadot/react-query'; +import type { PayoutStash } from './types'; import { useTranslation } from '../translate'; -import { createErasString } from './util'; import useEraBlocks from './useEraBlocks'; +import { createErasString } from './util'; interface Props { className?: string; diff --git a/packages/page-staking/src/Payouts/Validator.tsx b/packages/page-staking/src/Payouts/Validator.tsx index 884d259da6..fd5a26adeb 100644 --- a/packages/page-staking/src/Payouts/Validator.tsx +++ b/packages/page-staking/src/Payouts/Validator.tsx @@ -1,17 +1,17 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { PayoutValidator } from './types'; - import BN from 'bn.js'; import React, { useMemo } from 'react'; + import { AddressMini, AddressSmall, Expander } from '@polkadot/react-components'; import { BlockToTime, FormatBalance } from '@polkadot/react-query'; +import type { PayoutValidator } from './types'; import { useTranslation } from '../translate'; import PayButton from './PayButton'; -import { createErasString } from './util'; import useEraBlocks from './useEraBlocks'; +import { createErasString } from './util'; interface Props { className?: string; diff --git a/packages/page-staking/src/Payouts/index.tsx b/packages/page-staking/src/Payouts/index.tsx index 40696ad4a3..3e35c31277 100644 --- a/packages/page-staking/src/Payouts/index.tsx +++ b/packages/page-staking/src/Payouts/index.tsx @@ -2,24 +2,24 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { DeriveStakerReward } from '@polkadot/api-derive/types'; -import type { StakerState } from '@polkadot/react-hooks/types'; -import type { PayoutStash, PayoutValidator } from './types'; - import BN from 'bn.js'; import React, { useMemo, useRef, useState } from 'react'; import styled from 'styled-components'; + +import type { DeriveStakerReward } from '@polkadot/api-derive/types'; +import type { StakerState } from '@polkadot/react-hooks/types'; import { ApiPromise } from '@polkadot/api'; import { Button, Table, ToggleGroup } from '@polkadot/react-components'; import { useApi, useCall, useOwnEraRewards } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; import { BN_ZERO, isFunction } from '@polkadot/util'; +import type { PayoutStash, PayoutValidator } from './types'; import ElectionBanner from '../ElectionBanner'; import { useTranslation } from '../translate'; -import useStakerPayouts from './useStakerPayouts'; import PayButton from './PayButton'; import Stash from './Stash'; +import useStakerPayouts from './useStakerPayouts'; import Validator from './Validator'; interface Props { diff --git a/packages/page-staking/src/Payouts/types.ts b/packages/page-staking/src/Payouts/types.ts index e993b84c4f..584401f419 100644 --- a/packages/page-staking/src/Payouts/types.ts +++ b/packages/page-staking/src/Payouts/types.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import BN from 'bn.js'; + import type { DeriveStakerReward } from '@polkadot/api-derive/types'; import type { Balance, EraIndex } from '@polkadot/types/interfaces'; -import BN from 'bn.js'; - export interface PayoutEraValidator { era: EraIndex; stashes: Record; diff --git a/packages/page-staking/src/Payouts/useEraBlocks.ts b/packages/page-staking/src/Payouts/useEraBlocks.ts index 6726f4005a..9cf57b2db2 100644 --- a/packages/page-staking/src/Payouts/useEraBlocks.ts +++ b/packages/page-staking/src/Payouts/useEraBlocks.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Forcing } from '@polkadot/types/interfaces'; -import type { DeriveSessionProgress } from '@polkadot/api-derive/types'; - import BN from 'bn.js'; import { useMemo } from 'react'; + +import type { DeriveSessionProgress } from '@polkadot/api-derive/types'; +import type { Forcing } from '@polkadot/types/interfaces'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BN_ONE } from '@polkadot/util'; diff --git a/packages/page-staking/src/Payouts/useStakerPayouts.ts b/packages/page-staking/src/Payouts/useStakerPayouts.ts index abda341304..7a1d08549a 100644 --- a/packages/page-staking/src/Payouts/useStakerPayouts.ts +++ b/packages/page-staking/src/Payouts/useStakerPayouts.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Option } from '@polkadot/types'; -import type { EraIndex } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; import { useMemo } from 'react'; + +import type { Option } from '@polkadot/types'; +import type { EraIndex } from '@polkadot/types/interfaces'; import { useApi, useCall } from '@polkadot/react-hooks'; import { isFunction } from '@polkadot/util'; diff --git a/packages/page-staking/src/Payouts/util.tsx b/packages/page-staking/src/Payouts/util.tsx index 264a2f1792..c440c94056 100644 --- a/packages/page-staking/src/Payouts/util.tsx +++ b/packages/page-staking/src/Payouts/util.tsx @@ -1,8 +1,9 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import React from 'react'; import BN from 'bn.js'; +import React from 'react'; + import { formatNumber } from '@polkadot/util'; function isSingle (entry: BN | [BN, BN]): entry is BN { diff --git a/packages/page-staking/src/Query/ChartPoints.tsx b/packages/page-staking/src/Query/ChartPoints.tsx index 8467615cb6..35c7cadec5 100644 --- a/packages/page-staking/src/Query/ChartPoints.tsx +++ b/packages/page-staking/src/Query/ChartPoints.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveStakerPoints } from '@polkadot/api-derive/types'; -import type { ChartInfo, LineDataEntry, Props } from './types'; - import React, { useMemo, useRef } from 'react'; + +import type { DeriveStakerPoints } from '@polkadot/api-derive/types'; import { Chart, Spinner } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; +import type { ChartInfo, LineDataEntry, Props } from './types'; import { useTranslation } from '../translate'; const COLORS_POINTS = [undefined, '#acacac']; diff --git a/packages/page-staking/src/Query/ChartPrefs.tsx b/packages/page-staking/src/Query/ChartPrefs.tsx index eda54b0b6b..c5db39aa2b 100644 --- a/packages/page-staking/src/Query/ChartPrefs.tsx +++ b/packages/page-staking/src/Query/ChartPrefs.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveStakerPrefs } from '@polkadot/api-derive/types'; -import type { ChartInfo, LineDataEntry, Props } from './types'; - import BN from 'bn.js'; import React, { useMemo, useRef } from 'react'; + +import type { DeriveStakerPrefs } from '@polkadot/api-derive/types'; import { Chart, Spinner } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; +import type { ChartInfo, LineDataEntry, Props } from './types'; import { useTranslation } from '../translate'; const MULT = new BN(100 * 100); diff --git a/packages/page-staking/src/Query/ChartRewards.tsx b/packages/page-staking/src/Query/ChartRewards.tsx index 171793fa1f..97da8f1e75 100644 --- a/packages/page-staking/src/Query/ChartRewards.tsx +++ b/packages/page-staking/src/Query/ChartRewards.tsx @@ -1,15 +1,15 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveEraRewards, DeriveOwnSlashes, DeriveStakerPoints } from '@polkadot/api-derive/types'; -import type { ChartInfo, LineDataEntry, Props } from './types'; - import BN from 'bn.js'; import React, { useMemo } from 'react'; + +import type { DeriveEraRewards, DeriveOwnSlashes, DeriveStakerPoints } from '@polkadot/api-derive/types'; import { Chart, Spinner } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { formatBalance } from '@polkadot/util'; +import type { ChartInfo, LineDataEntry, Props } from './types'; import { useTranslation } from '../translate'; import { balanceToNumber } from './util'; diff --git a/packages/page-staking/src/Query/ChartStake.tsx b/packages/page-staking/src/Query/ChartStake.tsx index e7008df69b..c5e90575e5 100644 --- a/packages/page-staking/src/Query/ChartStake.tsx +++ b/packages/page-staking/src/Query/ChartStake.tsx @@ -1,15 +1,15 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveOwnExposure } from '@polkadot/api-derive/types'; -import type { ChartInfo, LineDataEntry, Props } from './types'; - import BN from 'bn.js'; import React, { useMemo } from 'react'; + +import type { DeriveOwnExposure } from '@polkadot/api-derive/types'; import { Chart, Spinner } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { formatBalance } from '@polkadot/util'; +import type { ChartInfo, LineDataEntry, Props } from './types'; import { useTranslation } from '../translate'; import { balanceToNumber } from './util'; diff --git a/packages/page-staking/src/Query/Validator.tsx b/packages/page-staking/src/Query/Validator.tsx index 7e6bf39f92..490583fa25 100644 --- a/packages/page-staking/src/Query/Validator.tsx +++ b/packages/page-staking/src/Query/Validator.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Props } from './types'; - import React from 'react'; import styled from 'styled-components'; + import { Columar, Column } from '@polkadot/react-components'; +import type { Props } from './types'; import ChartPoints from './ChartPoints'; import ChartPrefs from './ChartPrefs'; import ChartRewards from './ChartRewards'; diff --git a/packages/page-staking/src/Query/index.tsx b/packages/page-staking/src/Query/index.tsx index b27a7424f1..ce44ebc497 100644 --- a/packages/page-staking/src/Query/index.tsx +++ b/packages/page-staking/src/Query/index.tsx @@ -3,6 +3,7 @@ import React, { useCallback, useState } from 'react'; import { useParams } from 'react-router-dom'; + import { Button, InputAddressSimple } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-staking/src/Query/useBlockCounts.tsx b/packages/page-staking/src/Query/useBlockCounts.tsx index 67d383dd1f..3b63981dfe 100644 --- a/packages/page-staking/src/Query/useBlockCounts.tsx +++ b/packages/page-staking/src/Query/useBlockCounts.tsx @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import { useEffect, useState } from 'react'; + import type { DeriveSessionIndexes } from '@polkadot/api-derive/types'; import type { u32 } from '@polkadot/types'; -import type { SessionRewards } from '../types'; - -import { useEffect, useState } from 'react'; import { useApi, useCall, useIsMountedRef } from '@polkadot/react-hooks'; import { isFunction } from '@polkadot/util'; +import type { SessionRewards } from '../types'; + export default function useBlockCounts (accountId: string, sessionRewards: SessionRewards[]): u32[] { const { api } = useApi(); const mountedRef = useIsMountedRef(); diff --git a/packages/page-staking/src/Query/util.ts b/packages/page-staking/src/Query/util.ts index 9b2ba006c7..178bc48667 100644 --- a/packages/page-staking/src/Query/util.ts +++ b/packages/page-staking/src/Query/util.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import BN from 'bn.js'; + import { BN_ZERO, isBn, isFunction } from '@polkadot/util'; interface ToBN { diff --git a/packages/page-staking/src/Slashes/Era.tsx b/packages/page-staking/src/Slashes/Era.tsx index 84c8dcadf6..ae2734a3d4 100644 --- a/packages/page-staking/src/Slashes/Era.tsx +++ b/packages/page-staking/src/Slashes/Era.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SubmittableExtrinsic } from '@polkadot/api/types'; -import type { SlashEra } from './types'; - import React, { useCallback, useRef, useState } from 'react'; + +import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { Button, Table, TxButton } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; +import type { SlashEra } from './types'; import { useTranslation } from '../translate'; import Row from './Row'; import Summary from './Summary'; diff --git a/packages/page-staking/src/Slashes/Row.tsx b/packages/page-staking/src/Slashes/Row.tsx index d51e7a04c7..6bb27b70b1 100644 --- a/packages/page-staking/src/Slashes/Row.tsx +++ b/packages/page-staking/src/Slashes/Row.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Slash } from './types'; - import React, { useCallback } from 'react'; + import { AddressMini, AddressSmall, Badge, Checkbox, Expander } from '@polkadot/react-components'; import { FormatBalance } from '@polkadot/react-query'; import { formatNumber } from '@polkadot/util'; +import type { Slash } from './types'; import { useTranslation } from '../translate'; interface Props { diff --git a/packages/page-staking/src/Slashes/Summary.tsx b/packages/page-staking/src/Slashes/Summary.tsx index 9dd5336a40..dd03251cff 100644 --- a/packages/page-staking/src/Slashes/Summary.tsx +++ b/packages/page-staking/src/Slashes/Summary.tsx @@ -1,16 +1,16 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveSessionProgress } from '@polkadot/api-derive/types'; -import type { SlashEra } from './types'; - import BN from 'bn.js'; import React, { useMemo } from 'react'; + +import type { DeriveSessionProgress } from '@polkadot/api-derive/types'; import { CardSummary, SummaryBox } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; import { formatNumber } from '@polkadot/util'; +import type { SlashEra } from './types'; import { useTranslation } from '../translate'; interface Props { diff --git a/packages/page-staking/src/Slashes/index.tsx b/packages/page-staking/src/Slashes/index.tsx index 5754bce43e..5c4c5bbecd 100644 --- a/packages/page-staking/src/Slashes/index.tsx +++ b/packages/page-staking/src/Slashes/index.tsx @@ -1,17 +1,17 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { StakerState } from '@polkadot/react-hooks/types'; -import type { UnappliedSlash } from '@polkadot/types/interfaces'; -import type { Slash, SlashEra } from './types'; - import BN from 'bn.js'; import React, { useMemo, useState } from 'react'; + +import type { StakerState } from '@polkadot/react-hooks/types'; +import type { UnappliedSlash } from '@polkadot/types/interfaces'; import { getSlashProposalThreshold } from '@polkadot/apps-config'; import { Table, ToggleGroup } from '@polkadot/react-components'; import { useAccounts, useApi, useMembers } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; +import type { Slash, SlashEra } from './types'; import { useTranslation } from '../translate'; import Era from './Era'; diff --git a/packages/page-staking/src/Slashes/types.ts b/packages/page-staking/src/Slashes/types.ts index c609d555f4..7fd31e5d2f 100644 --- a/packages/page-staking/src/Slashes/types.ts +++ b/packages/page-staking/src/Slashes/types.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { UnappliedSlash } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; +import type { UnappliedSlash } from '@polkadot/types/interfaces'; + export interface Slash { era: BN; isMine: boolean; diff --git a/packages/page-staking/src/Targets/Nominate.tsx b/packages/page-staking/src/Targets/Nominate.tsx index aae5f7b76e..7cfe8b02c5 100644 --- a/packages/page-staking/src/Targets/Nominate.tsx +++ b/packages/page-staking/src/Targets/Nominate.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { StakerState } from '@polkadot/react-hooks/types'; - import React, { useCallback, useMemo, useState } from 'react'; import styled from 'styled-components'; + +import type { StakerState } from '@polkadot/react-hooks/types'; import { AddressMini, Button, InputAddress, Modal, Static, TxButton } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-staking/src/Targets/Summary.tsx b/packages/page-staking/src/Targets/Summary.tsx index 80f0f8f265..a2b82ee9ea 100644 --- a/packages/page-staking/src/Targets/Summary.tsx +++ b/packages/page-staking/src/Targets/Summary.tsx @@ -3,7 +3,8 @@ import BN from 'bn.js'; import React, { useMemo } from 'react'; -import { SummaryBox, CardSummary } from '@polkadot/react-components'; + +import { CardSummary, SummaryBox } from '@polkadot/react-components'; import { FormatBalance } from '@polkadot/react-query'; import { useTranslation } from '../translate'; diff --git a/packages/page-staking/src/Targets/Validator.tsx b/packages/page-staking/src/Targets/Validator.tsx index ae5ec8202d..4a5a4a1f3e 100644 --- a/packages/page-staking/src/Targets/Validator.tsx +++ b/packages/page-staking/src/Targets/Validator.tsx @@ -1,18 +1,18 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveAccountInfo } from '@polkadot/api-derive/types'; -import type { UnappliedSlash } from '@polkadot/types/interfaces'; -import type { NominatedBy, ValidatorInfo } from '../types'; - import BN from 'bn.js'; import React, { useCallback, useMemo } from 'react'; + +import type { DeriveAccountInfo } from '@polkadot/api-derive/types'; +import type { UnappliedSlash } from '@polkadot/types/interfaces'; import { AddressSmall, Badge, Checkbox, Icon } from '@polkadot/react-components'; import { checkVisibility } from '@polkadot/react-components/util'; -import { FormatBalance } from '@polkadot/react-query'; import { useApi, useBlockTime, useCall } from '@polkadot/react-hooks'; +import { FormatBalance } from '@polkadot/react-query'; import { formatNumber } from '@polkadot/util'; +import type { NominatedBy, ValidatorInfo } from '../types'; import MaxBadge from '../MaxBadge'; import Favorite from '../Overview/Address/Favorite'; import { useTranslation } from '../translate'; diff --git a/packages/page-staking/src/Targets/index.tsx b/packages/page-staking/src/Targets/index.tsx index df8a924d12..64f68480cf 100644 --- a/packages/page-staking/src/Targets/index.tsx +++ b/packages/page-staking/src/Targets/index.tsx @@ -1,26 +1,26 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveStakingOverview, DeriveHasIdentity } from '@polkadot/api-derive/types'; -import type { StakerState } from '@polkadot/react-hooks/types'; -import type { NominatedBy, SortedTargets, TargetSortBy, ValidatorInfo } from '../types'; - import BN from 'bn.js'; import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import styled from 'styled-components'; + +import type { DeriveHasIdentity, DeriveStakingOverview } from '@polkadot/api-derive/types'; +import type { StakerState } from '@polkadot/react-hooks/types'; import { Button, Icon, Table, Toggle } from '@polkadot/react-components'; import { useApi, useAvailableSlashes, useBlocksPerDays, useCall } from '@polkadot/react-hooks'; +import type { NominatedBy, SortedTargets, TargetSortBy, ValidatorInfo } from '../types'; +import { MAX_NOMINATIONS } from '../constants'; import ElectionBanner from '../ElectionBanner'; import Filtering from '../Filtering'; import Legend from '../Legend'; -import { MAX_NOMINATIONS } from '../constants'; import { useTranslation } from '../translate'; import useNominations from '../useNominations'; import Nominate from './Nominate'; import Summary from './Summary'; -import Validator from './Validator'; import useOwnNominators from './useOwnNominators'; +import Validator from './Validator'; interface Props { className?: string; diff --git a/packages/page-staking/src/Targets/useOwnNominators.ts b/packages/page-staking/src/Targets/useOwnNominators.ts index efd909dcf2..53c11c7688 100644 --- a/packages/page-staking/src/Targets/useOwnNominators.ts +++ b/packages/page-staking/src/Targets/useOwnNominators.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { StakerState } from '@polkadot/react-hooks/types'; - import { useMemo } from 'react'; +import type { StakerState } from '@polkadot/react-hooks/types'; + export default function useOwnNominators (ownStashes?: StakerState[]): StakerState[] | undefined { return useMemo( () => ownStashes ? ownStashes.filter(({ isOwnController, isStashValidating }) => isOwnController && !isStashValidating) : undefined, diff --git a/packages/page-staking/src/index.tsx b/packages/page-staking/src/index.tsx index 336a390e9a..939af377d3 100644 --- a/packages/page-staking/src/index.tsx +++ b/packages/page-staking/src/index.tsx @@ -1,28 +1,28 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveStakingOverview } from '@polkadot/api-derive/types'; -import type { AppProps as Props, ThemeProps } from '@polkadot/react-components/types'; -import type { ElectionStatus } from '@polkadot/types/interfaces'; - import React, { useMemo } from 'react'; import { Route, Switch } from 'react-router'; import { useLocation } from 'react-router-dom'; import styled from 'styled-components'; + +import type { DeriveStakingOverview } from '@polkadot/api-derive/types'; +import type { AppProps as Props, ThemeProps } from '@polkadot/react-components/types'; +import type { ElectionStatus } from '@polkadot/types/interfaces'; import { HelpOverlay } from '@polkadot/react-components'; import Tabs from '@polkadot/react-components/Tabs'; import { useAccounts, useApi, useAvailableSlashes, useCall, useFavorites, useOwnStashInfos, useStashIds } from '@polkadot/react-hooks'; import { isFunction } from '@polkadot/util'; -import basicMd from './md/basic.md'; import Actions from './Actions'; +import { STORE_FAVS_BASE } from './constants'; +import basicMd from './md/basic.md'; import Overview from './Overview'; +import Summary from './Overview/Summary'; import Payouts from './Payouts'; import Query from './Query'; -import Summary from './Overview/Summary'; import Slashes from './Slashes'; import Targets from './Targets'; -import { STORE_FAVS_BASE } from './constants'; import { useTranslation } from './translate'; import useSortedTargets from './useSortedTargets'; diff --git a/packages/page-staking/src/types.ts b/packages/page-staking/src/types.ts index 728e69aef0..76b4044cef 100644 --- a/packages/page-staking/src/types.ts +++ b/packages/page-staking/src/types.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AccountId, Balance, BlockNumber, EraIndex, Exposure, Hash, SessionIndex, ValidatorPrefs, ValidatorPrefsTo196 } from '@polkadot/types/interfaces'; -import type { Inflation } from '@polkadot/react-hooks/types'; - import BN from 'bn.js'; +import type { Inflation } from '@polkadot/react-hooks/types'; +import type { AccountId, Balance, BlockNumber, EraIndex, Exposure, Hash, SessionIndex, ValidatorPrefs, ValidatorPrefsTo196 } from '@polkadot/types/interfaces'; + export type Nominators = Record; export type AccountFilter = 'all' | 'controller' | 'session' | 'stash' | 'unbonded'; diff --git a/packages/page-staking/src/useNominations.ts b/packages/page-staking/src/useNominations.ts index a6573dc457..f2ca10a32d 100644 --- a/packages/page-staking/src/useNominations.ts +++ b/packages/page-staking/src/useNominations.ts @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import { useMemo } from 'react'; + import type { Option, StorageKey } from '@polkadot/types'; import type { Nominations } from '@polkadot/types/interfaces'; -import type { NominatedBy } from './types'; - -import { useMemo } from 'react'; import { useApi, useCall } from '@polkadot/react-hooks'; +import type { NominatedBy } from './types'; + type Result = Record; function extractNominators (nominations: [StorageKey, Option][]): Result { diff --git a/packages/page-staking/src/useSortedTargets.ts b/packages/page-staking/src/useSortedTargets.ts index 280df67763..238a8eb854 100644 --- a/packages/page-staking/src/useSortedTargets.ts +++ b/packages/page-staking/src/useSortedTargets.ts @@ -1,18 +1,19 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 +import BN from 'bn.js'; +import { useMemo } from 'react'; + import type { ApiPromise } from '@polkadot/api'; import type { DeriveSessionInfo, DeriveStakingElected, DeriveStakingWaiting } from '@polkadot/api-derive/types'; import type { Option } from '@polkadot/types'; import type { Balance, ValidatorPrefsTo196 } from '@polkadot/types/interfaces'; -import type { SortedTargets, TargetSortBy, ValidatorInfo } from './types'; - -import BN from 'bn.js'; -import { useMemo } from 'react'; import { registry } from '@polkadot/react-api'; import { calcInflation, useAccounts, useApi, useCall } from '@polkadot/react-hooks'; import { BN_ONE, BN_ZERO } from '@polkadot/util'; +import type { SortedTargets, TargetSortBy, ValidatorInfo } from './types'; + interface LastEra { eraLength: BN; lastEra: BN; diff --git a/packages/page-storage/src/Queries.tsx b/packages/page-storage/src/Queries.tsx index 6a251d8889..6da171e3ef 100644 --- a/packages/page-storage/src/Queries.tsx +++ b/packages/page-storage/src/Queries.tsx @@ -1,10 +1,9 @@ // Copyright 2017-2020 @polkadot/app-storage authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { QueryTypes } from './types'; - import React from 'react'; +import type { QueryTypes } from './types'; import Query from './Query'; interface Props { diff --git a/packages/page-storage/src/Query.tsx b/packages/page-storage/src/Query.tsx index 4470d6eadf..e0259eecca 100644 --- a/packages/page-storage/src/Query.tsx +++ b/packages/page-storage/src/Query.tsx @@ -1,20 +1,21 @@ // Copyright 2017-2020 @polkadot/app-storage authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { QueryableStorageEntry } from '@polkadot/api/types'; -import type { RenderFn, DefaultProps, ComponentRenderer } from '@polkadot/react-api/hoc/types'; -import type { ConstValue } from '@polkadot/react-components/InputConsts/types'; -import type { Option, Raw } from '@polkadot/types'; -import type { QueryTypes, StorageModuleQuery } from './types'; - import React, { useCallback, useMemo } from 'react'; import styled from 'styled-components'; -import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey'; -import { Button, Labelled } from '@polkadot/react-components'; + +import type { QueryableStorageEntry } from '@polkadot/api/types'; +import type { ComponentRenderer, DefaultProps, RenderFn } from '@polkadot/react-api/hoc/types'; +import type { ConstValue } from '@polkadot/react-components/InputConsts/types'; +import type { Option, Raw } from '@polkadot/types'; import { withCallDiv } from '@polkadot/react-api/hoc'; +import { Button, Labelled } from '@polkadot/react-components'; import valueToText from '@polkadot/react-params/valueToText'; +import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey'; import { compactStripLength, isU8a, u8aToHex, u8aToString } from '@polkadot/util'; +import type { QueryTypes, StorageModuleQuery } from './types'; + interface Props { className?: string; onRemove: (id: number) => void; diff --git a/packages/page-storage/src/Selection/Consts.tsx b/packages/page-storage/src/Selection/Consts.tsx index bb572a5550..26c922f587 100644 --- a/packages/page-storage/src/Selection/Consts.tsx +++ b/packages/page-storage/src/Selection/Consts.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-storage authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useCallback, useState } from 'react'; + import type { ConstantCodec } from '@polkadot/metadata/decorate/types'; import type { ConstValue } from '@polkadot/react-components/InputConsts/types'; -import type { ComponentProps as Props } from '../types'; - -import React, { useCallback, useState } from 'react'; import { Button, InputConsts } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; +import type { ComponentProps as Props } from '../types'; import { useTranslation } from '../translate'; function Consts ({ onAdd }: Props): React.ReactElement { diff --git a/packages/page-storage/src/Selection/Modules.tsx b/packages/page-storage/src/Selection/Modules.tsx index b50ac50498..cf334fa570 100644 --- a/packages/page-storage/src/Selection/Modules.tsx +++ b/packages/page-storage/src/Selection/Modules.tsx @@ -1,13 +1,12 @@ // Copyright 2017-2020 @polkadot/app-storage authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useCallback, useState } from 'react'; + import type { QueryableStorageEntry } from '@polkadot/api/types'; +import type { RawParams } from '@polkadot/react-params/types'; import type { StorageEntryTypeLatest } from '@polkadot/types/interfaces'; import type { TypeDef } from '@polkadot/types/types'; -import type { RawParams } from '@polkadot/react-params/types'; -import type { ComponentProps as Props } from '../types'; - -import React, { useCallback, useState } from 'react'; import { ApiPromise } from '@polkadot/api'; import { Button, InputStorage } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; @@ -16,6 +15,7 @@ import { getTypeDef } from '@polkadot/types'; import { TypeDefInfo } from '@polkadot/types/types'; import { isNull, isUndefined } from '@polkadot/util'; +import type { ComponentProps as Props } from '../types'; import { useTranslation } from '../translate'; interface TypeDefExt extends TypeDef { diff --git a/packages/page-storage/src/Selection/Raw.tsx b/packages/page-storage/src/Selection/Raw.tsx index b0ae29c02f..4701ccea4a 100644 --- a/packages/page-storage/src/Selection/Raw.tsx +++ b/packages/page-storage/src/Selection/Raw.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-storage authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ComponentProps as Props } from '../types'; - import React, { useCallback, useState } from 'react'; -import { Button, Input } from '@polkadot/react-components'; -import { useTranslation } from '../translate'; +import { Button, Input } from '@polkadot/react-components'; import { compactAddLength, u8aToU8a } from '@polkadot/util'; +import type { ComponentProps as Props } from '../types'; +import { useTranslation } from '../translate'; + function Raw ({ onAdd }: Props): React.ReactElement { const { t } = useTranslation(); const [{ isValid, key }, setValue] = useState<{ isValid: boolean; key: Uint8Array }>({ isValid: false, key: new Uint8Array([]) }); diff --git a/packages/page-storage/src/Selection/index.tsx b/packages/page-storage/src/Selection/index.tsx index 5db72c8724..688d896894 100644 --- a/packages/page-storage/src/Selection/index.tsx +++ b/packages/page-storage/src/Selection/index.tsx @@ -1,16 +1,16 @@ // Copyright 2017-2020 @polkadot/app-storage authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { QueryTypes, ParitalQueryTypes } from '../types'; - import React, { useCallback, useRef } from 'react'; import { Route, Switch } from 'react-router'; + import { Tabs } from '@polkadot/react-components'; +import type { ParitalQueryTypes, QueryTypes } from '../types'; +import { useTranslation } from '../translate'; import Consts from './Consts'; import Modules from './Modules'; import Raw from './Raw'; -import { useTranslation } from '../translate'; interface Props { basePath: string; diff --git a/packages/page-storage/src/index.tsx b/packages/page-storage/src/index.tsx index f4a214776c..a5edb5cfc7 100644 --- a/packages/page-storage/src/index.tsx +++ b/packages/page-storage/src/index.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-storage authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AppProps as Props } from '@polkadot/react-components/types'; -import type { QueryTypes } from './types'; - import React, { useCallback, useState } from 'react'; import styled from 'styled-components'; +import type { AppProps as Props } from '@polkadot/react-components/types'; + +import type { QueryTypes } from './types'; import Queries from './Queries'; import Selection from './Selection'; diff --git a/packages/page-sudo/src/SetKey.tsx b/packages/page-sudo/src/SetKey.tsx index 5694de979b..292c6b183b 100644 --- a/packages/page-sudo/src/SetKey.tsx +++ b/packages/page-sudo/src/SetKey.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import React, { useEffect, useState } from 'react'; -import { AddressMini, InputAddress, Labelled, TxButton } from '@polkadot/react-components'; - import styled from 'styled-components'; +import { AddressMini, InputAddress, Labelled, TxButton } from '@polkadot/react-components'; + import { useTranslation } from './translate'; interface Props { diff --git a/packages/page-sudo/src/Sudo.tsx b/packages/page-sudo/src/Sudo.tsx index 2f2f53144a..2727f02766 100644 --- a/packages/page-sudo/src/Sudo.tsx +++ b/packages/page-sudo/src/Sudo.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-js authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SubmittableExtrinsic } from '@polkadot/api/types'; - import BN from 'bn.js'; import React, { useCallback, useState } from 'react'; import styled from 'styled-components'; -import { Button, Icon, Extrinsic, Toggle, TxButton, InputNumber } from '@polkadot/react-components'; + +import type { SubmittableExtrinsic } from '@polkadot/api/types'; +import { Button, Extrinsic, Icon, InputNumber, Toggle, TxButton } from '@polkadot/react-components'; import { useApi, useToggle } from '@polkadot/react-hooks'; import { BN_ZERO } from '@polkadot/util'; diff --git a/packages/page-sudo/src/index.tsx b/packages/page-sudo/src/index.tsx index 526abc6659..0bf3cf6821 100644 --- a/packages/page-sudo/src/index.tsx +++ b/packages/page-sudo/src/index.tsx @@ -1,16 +1,15 @@ // Copyright 2017-2020 @polkadot/app-js authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AppProps as Props } from '@polkadot/react-components/types'; - import React, { useRef } from 'react'; import { Route, Switch } from 'react-router'; + +import type { AppProps as Props } from '@polkadot/react-components/types'; import { Icon, Tabs } from '@polkadot/react-components'; import { useSudo } from '@polkadot/react-hooks'; import SetKey from './SetKey'; import Sudo from './Sudo'; - import { useTranslation } from './translate'; function SudoApp ({ basePath }: Props): React.ReactElement { diff --git a/packages/page-tech-comm/src/Overview/Members.tsx b/packages/page-tech-comm/src/Overview/Members.tsx index bae4b1b082..178bf7f959 100644 --- a/packages/page-tech-comm/src/Overview/Members.tsx +++ b/packages/page-tech-comm/src/Overview/Members.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-tech-comm authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AccountId } from '@polkadot/types/interfaces'; - import React, { useRef } from 'react'; + +import type { AccountId } from '@polkadot/types/interfaces'; import { AddressSmall, Table, Tag } from '@polkadot/react-components'; import { useTranslation } from '../translate'; diff --git a/packages/page-tech-comm/src/Overview/Summary.tsx b/packages/page-tech-comm/src/Overview/Summary.tsx index 5d7a51eb86..4a2c41eb90 100644 --- a/packages/page-tech-comm/src/Overview/Summary.tsx +++ b/packages/page-tech-comm/src/Overview/Summary.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-tech-comm authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { u32 } from '@polkadot/types'; -import type { ComponentProps as Props } from '../types'; - import React from 'react'; -import { SummaryBox, CardSummary } from '@polkadot/react-components'; + +import type { u32 } from '@polkadot/types'; +import { CardSummary, SummaryBox } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; +import type { ComponentProps as Props } from '../types'; import { useTranslation } from '../translate'; function Summary ({ className = '', members, proposals }: Props): React.ReactElement { diff --git a/packages/page-tech-comm/src/Overview/index.tsx b/packages/page-tech-comm/src/Overview/index.tsx index e4dd3809be..88fd45c50c 100644 --- a/packages/page-tech-comm/src/Overview/index.tsx +++ b/packages/page-tech-comm/src/Overview/index.tsx @@ -1,10 +1,9 @@ // Copyright 2017-2020 @polkadot/app-tech-comm authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ComponentProps as Props } from '../types'; - import React from 'react'; +import type { ComponentProps as Props } from '../types'; import Members from './Members'; import Summary from './Summary'; diff --git a/packages/page-tech-comm/src/Proposals/Close.tsx b/packages/page-tech-comm/src/Proposals/Close.tsx index d4a856c561..de3478e9ba 100644 --- a/packages/page-tech-comm/src/Proposals/Close.tsx +++ b/packages/page-tech-comm/src/Proposals/Close.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-tech-comm authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Hash, Proposal, ProposalIndex } from '@polkadot/types/interfaces'; - import React, { useState } from 'react'; + +import type { Hash, Proposal, ProposalIndex } from '@polkadot/types/interfaces'; import { Button, InputAddress, Modal, ProposedAction, TxButton } from '@polkadot/react-components'; import { useApi, useToggle, useWeight } from '@polkadot/react-hooks'; diff --git a/packages/page-tech-comm/src/Proposals/Proposal.tsx b/packages/page-tech-comm/src/Proposals/Proposal.tsx index c49de64b55..7a96786d9e 100644 --- a/packages/page-tech-comm/src/Proposals/Proposal.tsx +++ b/packages/page-tech-comm/src/Proposals/Proposal.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-tech-comm authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useMemo } from 'react'; + import type { Option } from '@polkadot/types'; import type { AccountId, Hash, Proposal as ProposalType, Votes } from '@polkadot/types/interfaces'; - -import React, { useMemo } from 'react'; +import ProposalCell from '@polkadot/app-democracy/Overview/ProposalCell'; import { AddressMini, TxButton } from '@polkadot/react-components'; import { useAccounts, useApi, useCall, useVotingStatus, useWeight } from '@polkadot/react-hooks'; import { BlockToTime } from '@polkadot/react-query'; -import ProposalCell from '@polkadot/app-democracy/Overview/ProposalCell'; import { formatNumber } from '@polkadot/util'; import { useTranslation } from '../translate'; diff --git a/packages/page-tech-comm/src/Proposals/Propose.tsx b/packages/page-tech-comm/src/Proposals/Propose.tsx index 2a87efb6cf..02e8252584 100644 --- a/packages/page-tech-comm/src/Proposals/Propose.tsx +++ b/packages/page-tech-comm/src/Proposals/Propose.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-tech-comm authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SubmittableExtrinsic } from '@polkadot/api/types'; - import BN from 'bn.js'; import React, { useCallback, useState } from 'react'; + +import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { Button, Extrinsic, InputAddress, InputNumber, Modal, TxButton } from '@polkadot/react-components'; import { useApi, useModal } from '@polkadot/react-hooks'; diff --git a/packages/page-tech-comm/src/Proposals/Voting.tsx b/packages/page-tech-comm/src/Proposals/Voting.tsx index 8a926234ef..9ad12fac18 100644 --- a/packages/page-tech-comm/src/Proposals/Voting.tsx +++ b/packages/page-tech-comm/src/Proposals/Voting.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-tech-comm authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AccountId, Hash } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; import React, { useState } from 'react'; + +import type { AccountId, Hash } from '@polkadot/types/interfaces'; import { Button, Modal, TxButton, VoteAccount } from '@polkadot/react-components'; import { useAccounts, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-tech-comm/src/Proposals/index.tsx b/packages/page-tech-comm/src/Proposals/index.tsx index 75f466d37a..28c502c7b6 100644 --- a/packages/page-tech-comm/src/Proposals/index.tsx +++ b/packages/page-tech-comm/src/Proposals/index.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-tech-comm authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Hash } from '@polkadot/types/interfaces'; -import type { ComponentProps as Props } from '../types'; - import React, { useRef } from 'react'; + +import type { Hash } from '@polkadot/types/interfaces'; import { Button, Table } from '@polkadot/react-components'; +import type { ComponentProps as Props } from '../types'; import { useTranslation } from '../translate'; import Proposal from './Proposal'; import Propose from './Propose'; diff --git a/packages/page-tech-comm/src/index.tsx b/packages/page-tech-comm/src/index.tsx index e98157fef9..c61bd4e27e 100644 --- a/packages/page-tech-comm/src/index.tsx +++ b/packages/page-tech-comm/src/index.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/app-tech-comm authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Option } from '@polkadot/types'; -import type { AccountId, Hash } from '@polkadot/types/interfaces'; - import React, { useMemo } from 'react'; import { Route, Switch } from 'react-router'; -import { useApi, useCall, useMembers } from '@polkadot/react-hooks'; + +import type { Option } from '@polkadot/types'; +import type { AccountId, Hash } from '@polkadot/types/interfaces'; import { Tabs } from '@polkadot/react-components'; +import { useApi, useCall, useMembers } from '@polkadot/react-hooks'; import Overview from './Overview'; import Proposals from './Proposals'; diff --git a/packages/page-tech-comm/src/useCounter.ts b/packages/page-tech-comm/src/useCounter.ts index c6f01aaddb..de41a3955c 100644 --- a/packages/page-tech-comm/src/useCounter.ts +++ b/packages/page-tech-comm/src/useCounter.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import type { Hash } from '@polkadot/types/interfaces'; - import { useApi, useCall } from '@polkadot/react-hooks'; const transformCounter = { diff --git a/packages/page-treasury/src/Overview/Council.tsx b/packages/page-treasury/src/Overview/Council.tsx index d1bb9a1037..0315ab1174 100644 --- a/packages/page-treasury/src/Overview/Council.tsx +++ b/packages/page-treasury/src/Overview/Council.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-treasury authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useEffect, useRef, useState } from 'react'; + import type { SubmittableExtrinsic } from '@polkadot/api/types'; import type { ProposalIndex } from '@polkadot/types/interfaces'; - -import React, { useEffect, useRef, useState } from 'react'; import { getTreasuryProposalThreshold } from '@polkadot/apps-config'; import { Button, Dropdown, InputAddress, Modal, TxButton } from '@polkadot/react-components'; import { useApi, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-treasury/src/Overview/Proposal.tsx b/packages/page-treasury/src/Overview/Proposal.tsx index 05fc6c3d7c..fe4d060567 100644 --- a/packages/page-treasury/src/Overview/Proposal.tsx +++ b/packages/page-treasury/src/Overview/Proposal.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-treasury authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveTreasuryProposal } from '@polkadot/api-derive/types'; - import React, { useMemo } from 'react'; + +import type { DeriveTreasuryProposal } from '@polkadot/api-derive/types'; import { AddressMini, AddressSmall, LinkExternal } from '@polkadot/react-components'; import { FormatBalance } from '@polkadot/react-query'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/page-treasury/src/Overview/ProposalCreate.tsx b/packages/page-treasury/src/Overview/ProposalCreate.tsx index 3f2570e3fe..0334cbcb0f 100644 --- a/packages/page-treasury/src/Overview/ProposalCreate.tsx +++ b/packages/page-treasury/src/Overview/ProposalCreate.tsx @@ -3,6 +3,7 @@ import BN from 'bn.js'; import React, { useMemo, useState } from 'react'; + import { Button, InputAddress, InputBalance, Modal, Static, TxButton } from '@polkadot/react-components'; import { useApi, useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-treasury/src/Overview/Proposals.tsx b/packages/page-treasury/src/Overview/Proposals.tsx index d3c1450dc7..48ab68f871 100644 --- a/packages/page-treasury/src/Overview/Proposals.tsx +++ b/packages/page-treasury/src/Overview/Proposals.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-treasury authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveTreasuryProposal } from '@polkadot/api-derive/types'; - import React, { useCallback, useMemo } from 'react'; import { useHistory } from 'react-router-dom'; + +import type { DeriveTreasuryProposal } from '@polkadot/api-derive/types'; import { Table } from '@polkadot/react-components'; -import Proposal from './Proposal'; import { useTranslation } from '../translate'; +import Proposal from './Proposal'; interface Props { className?: string; diff --git a/packages/page-treasury/src/Overview/Summary.tsx b/packages/page-treasury/src/Overview/Summary.tsx index d47bf4dcb9..03567b5f7b 100644 --- a/packages/page-treasury/src/Overview/Summary.tsx +++ b/packages/page-treasury/src/Overview/Summary.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-treasury authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveBalancesAccount } from '@polkadot/api-derive/types'; -import type { Balance } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; import React from 'react'; -import { SummaryBox, CardSummary } from '@polkadot/react-components'; + +import type { DeriveBalancesAccount } from '@polkadot/api-derive/types'; +import type { Balance } from '@polkadot/types/interfaces'; +import { CardSummary, SummaryBox } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; import { formatNumber, stringToU8a } from '@polkadot/util'; diff --git a/packages/page-treasury/src/Overview/index.tsx b/packages/page-treasury/src/Overview/index.tsx index fa723d06b2..1674b5acd9 100644 --- a/packages/page-treasury/src/Overview/index.tsx +++ b/packages/page-treasury/src/Overview/index.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-treasury authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveTreasuryProposals } from '@polkadot/api-derive/types'; - import React from 'react'; + +import type { DeriveTreasuryProposals } from '@polkadot/api-derive/types'; import { Button } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-treasury/src/Tips/Tip.tsx b/packages/page-treasury/src/Tips/Tip.tsx index 00532b1611..1763f7dd83 100644 --- a/packages/page-treasury/src/Tips/Tip.tsx +++ b/packages/page-treasury/src/Tips/Tip.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-treasury authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AccountId, Balance, BlockNumber, OpenTip, OpenTipTo225 } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; import React, { useEffect, useMemo, useState } from 'react'; import styled from 'styled-components'; -import { AddressSmall, AddressMini, Checkbox, Expander, Icon, LinkExternal, TxButton } from '@polkadot/react-components'; + +import type { AccountId, Balance, BlockNumber, OpenTip, OpenTipTo225 } from '@polkadot/types/interfaces'; +import { AddressMini, AddressSmall, Checkbox, Expander, Icon, LinkExternal, TxButton } from '@polkadot/react-components'; import { useAccounts } from '@polkadot/react-hooks'; import { BlockToTime, FormatBalance } from '@polkadot/react-query'; import { BN_ZERO, formatNumber } from '@polkadot/util'; diff --git a/packages/page-treasury/src/Tips/TipCreate.tsx b/packages/page-treasury/src/Tips/TipCreate.tsx index 89df626fe9..32f59e6c65 100644 --- a/packages/page-treasury/src/Tips/TipCreate.tsx +++ b/packages/page-treasury/src/Tips/TipCreate.tsx @@ -3,6 +3,7 @@ import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; + import { Button, Input, InputAddress, InputBalance, Modal, TxButton } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-treasury/src/Tips/TipEndorse.tsx b/packages/page-treasury/src/Tips/TipEndorse.tsx index 70094115c3..954af5359e 100644 --- a/packages/page-treasury/src/Tips/TipEndorse.tsx +++ b/packages/page-treasury/src/Tips/TipEndorse.tsx @@ -3,6 +3,7 @@ import BN from 'bn.js'; import React, { useState } from 'react'; + import { Button, InputAddress, InputBalance, Modal, TxButton } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; diff --git a/packages/page-treasury/src/Tips/TipReason.tsx b/packages/page-treasury/src/Tips/TipReason.tsx index eb8635c8b1..fb0d007e33 100644 --- a/packages/page-treasury/src/Tips/TipReason.tsx +++ b/packages/page-treasury/src/Tips/TipReason.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-treasury authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Hash } from '@polkadot/types/interfaces'; -import type { Bytes, Option } from '@polkadot/types'; - import React from 'react'; + +import type { Bytes, Option } from '@polkadot/types'; +import type { Hash } from '@polkadot/types/interfaces'; import { useApi, useCall } from '@polkadot/react-hooks'; import { hexToString } from '@polkadot/util'; diff --git a/packages/page-treasury/src/Tips/Tips.tsx b/packages/page-treasury/src/Tips/Tips.tsx index e9a7683974..9803326532 100644 --- a/packages/page-treasury/src/Tips/Tips.tsx +++ b/packages/page-treasury/src/Tips/Tips.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-treasury authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Option } from '@polkadot/types'; -import type { BlockNumber, OpenTip, OpenTipTo225 } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; import React, { useMemo, useRef, useState } from 'react'; import styled from 'styled-components'; + +import type { Option } from '@polkadot/types'; +import type { BlockNumber, OpenTip, OpenTipTo225 } from '@polkadot/types/interfaces'; import { Table, Toggle } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; diff --git a/packages/page-treasury/src/Tips/index.tsx b/packages/page-treasury/src/Tips/index.tsx index 38459d7e15..f8f8cdf165 100644 --- a/packages/page-treasury/src/Tips/index.tsx +++ b/packages/page-treasury/src/Tips/index.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-treasury authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SubmittableExtrinsic } from '@polkadot/api/types'; - import BN from 'bn.js'; import React, { useCallback, useMemo, useState } from 'react'; + +import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { Button, TxButton } from '@polkadot/react-components'; import { useAccounts, useApi } from '@polkadot/react-hooks'; diff --git a/packages/page-treasury/src/index.tsx b/packages/page-treasury/src/index.tsx index e8bec54bd1..4a4d8248df 100644 --- a/packages/page-treasury/src/index.tsx +++ b/packages/page-treasury/src/index.tsx @@ -3,13 +3,13 @@ import React, { useEffect, useMemo, useState } from 'react'; import { Route, Switch } from 'react-router'; + import { HelpOverlay, Tabs } from '@polkadot/react-components'; import { useApi, useIncrement, useIsMountedRef, useMembers } from '@polkadot/react-hooks'; import basicMd from './md/basic.md'; import Overview from './Overview'; import Tips from './Tips'; - import { useTranslation } from './translate'; export { default as useCounter } from './useCounter'; diff --git a/packages/page-treasury/src/useCounter.ts b/packages/page-treasury/src/useCounter.ts index 295ca66c87..9e8f1ed1f4 100644 --- a/packages/page-treasury/src/useCounter.ts +++ b/packages/page-treasury/src/useCounter.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-treasury authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveTreasuryProposals } from '@polkadot/api-derive/types'; +import { useEffect, useState } from 'react'; -import { useState, useEffect } from 'react'; +import type { DeriveTreasuryProposals } from '@polkadot/api-derive/types'; import { useAccounts, useApi, useCall } from '@polkadot/react-hooks'; export default function useCounter (): number { diff --git a/packages/react-api/src/Api.tsx b/packages/react-api/src/Api.tsx index 091b83d63e..fb015d65ef 100644 --- a/packages/react-api/src/Api.tsx +++ b/packages/react-api/src/Api.tsx @@ -1,27 +1,27 @@ // Copyright 2017-2020 @polkadot/react-api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { InjectedExtension } from '@polkadot/extension-inject/types'; -import type { KeyringStore } from '@polkadot/ui-keyring/types'; -import type { ChainProperties, ChainType } from '@polkadot/types/interfaces'; -import type { ApiProps, ApiState } from './types'; - import React, { useContext, useEffect, useMemo, useState } from 'react'; import store from 'store'; + +import type { InjectedExtension } from '@polkadot/extension-inject/types'; +import type { ChainProperties, ChainType } from '@polkadot/types/interfaces'; +import type { KeyringStore } from '@polkadot/ui-keyring/types'; +import { deriveMapCache, setDeriveCache } from '@polkadot/api-derive/util'; import { ApiPromise } from '@polkadot/api/promise'; -import { setDeriveCache, deriveMapCache } from '@polkadot/api-derive/util'; -import { POLKADOT_DENOM_BLOCK, POLKADOT_GENESIS, ethereumNetworks, typesChain, typesSpec, typesBundle, typesRpc } from '@polkadot/apps-config'; +import { ethereumNetworks, POLKADOT_DENOM_BLOCK, POLKADOT_GENESIS, typesBundle, typesChain, typesRpc, typesSpec } from '@polkadot/apps-config'; import { web3Accounts, web3Enable } from '@polkadot/extension-dapp'; -import { WsProvider } from '@polkadot/rpc-provider'; -import { StatusContext } from '@polkadot/react-components/Status'; import { TokenUnit } from '@polkadot/react-components/InputNumber'; +import { StatusContext } from '@polkadot/react-components/Status'; import ApiSigner from '@polkadot/react-signer/signers/ApiSigner'; +import { WsProvider } from '@polkadot/rpc-provider'; import keyring from '@polkadot/ui-keyring'; import uiSettings from '@polkadot/ui-settings'; import { formatBalance, isTestChain } from '@polkadot/util'; import { setSS58Format } from '@polkadot/util-crypto'; import { defaults as addressDefaults } from '@polkadot/util-crypto/address/defaults'; +import type { ApiProps, ApiState } from './types'; import ApiContext from './ApiContext'; import registry from './typeRegistry'; diff --git a/packages/react-api/src/ApiContext.ts b/packages/react-api/src/ApiContext.ts index 03b4c64d73..ed9f408944 100644 --- a/packages/react-api/src/ApiContext.ts +++ b/packages/react-api/src/ApiContext.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ApiProps } from './types'; - import React from 'react'; +import type { ApiProps } from './types'; + const ApiContext: React.Context = React.createContext({} as unknown as ApiProps); const ApiConsumer: React.Consumer = ApiContext.Consumer; const ApiProvider: React.Provider = ApiContext.Provider; diff --git a/packages/react-api/src/hoc/api.tsx b/packages/react-api/src/hoc/api.tsx index b4b3842153..66d440934f 100644 --- a/packages/react-api/src/hoc/api.tsx +++ b/packages/react-api/src/hoc/api.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/react-api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ApiProps, SubtractProps } from '../types'; -import type { DefaultProps } from './types'; - import React from 'react'; + import { assert } from '@polkadot/util'; +import type { ApiProps, SubtractProps } from '../types'; +import type { DefaultProps } from './types'; import { ApiConsumer } from '../ApiContext'; export default function withApi

(Inner: React.ComponentType

, defaultProps: DefaultProps = {}): React.ComponentType { diff --git a/packages/react-api/src/hoc/call.tsx b/packages/react-api/src/hoc/call.tsx index 7a599e818a..e4d22eacb8 100644 --- a/packages/react-api/src/hoc/call.tsx +++ b/packages/react-api/src/hoc/call.tsx @@ -9,14 +9,14 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ -import type { ApiProps, CallState as State, SubtractProps } from '../types'; -import type { Options } from './types'; - import React from 'react'; + import { assert, isNull, isUndefined } from '@polkadot/util'; -import { isEqual, triggerChange } from '../util'; +import type { ApiProps, CallState as State, SubtractProps } from '../types'; +import type { Options } from './types'; import echoTransform from '../transform/echo'; +import { isEqual, triggerChange } from '../util'; import withApi from './api'; // FIXME This is not correct, we need some junction of derive, query & consts diff --git a/packages/react-api/src/hoc/callDiv.tsx b/packages/react-api/src/hoc/callDiv.tsx index 9e1fa921fa..80a600e098 100644 --- a/packages/react-api/src/hoc/callDiv.tsx +++ b/packages/react-api/src/hoc/callDiv.tsx @@ -1,11 +1,10 @@ // Copyright 2017-2020 @polkadot/react-api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefaultProps, Options } from './types'; -import type { BaseProps } from '../types'; - import React from 'react'; +import type { BaseProps } from '../types'; +import type { DefaultProps, Options } from './types'; import withCall from './call'; interface Props extends BaseProps { diff --git a/packages/react-api/src/hoc/calls.ts b/packages/react-api/src/hoc/calls.ts index db09400c9e..56a347131a 100644 --- a/packages/react-api/src/hoc/calls.ts +++ b/packages/react-api/src/hoc/calls.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-api authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React from 'react'; + import type { ApiProps, SubtractProps } from '../types'; import type { Options } from './types'; - -import React from 'react'; import withCall from './call'; type Call = string | [string, Options]; diff --git a/packages/react-api/src/hoc/observable.tsx b/packages/react-api/src/hoc/observable.tsx index 3a3d57de42..500f7daca5 100644 --- a/packages/react-api/src/hoc/observable.tsx +++ b/packages/react-api/src/hoc/observable.tsx @@ -3,13 +3,12 @@ // TODO: Lots of duplicated code between this and withObservable, surely there is a better way of doing this? -import type { CallState } from '../types'; -import type { HOC, Options, DefaultProps, RenderFn } from './types'; - import React from 'react'; import { Observable, of } from 'rxjs'; import { catchError, map } from 'rxjs/operators'; +import type { CallState } from '../types'; +import type { DefaultProps, HOC, Options, RenderFn } from './types'; import echoTransform from '../transform/echo'; import { intervalObservable, isEqual, triggerChange } from '../util'; diff --git a/packages/react-api/src/hoc/onlyOn.tsx b/packages/react-api/src/hoc/onlyOn.tsx index 7422184486..24027013d4 100644 --- a/packages/react-api/src/hoc/onlyOn.tsx +++ b/packages/react-api/src/hoc/onlyOn.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Environment } from '../types'; - import { ComponentType } from 'react'; + +import type { Environment } from '../types'; import { getEnvironment } from '../util'; const onlyOn = (environment: Environment) => >(component: T): T | (() => null) => { diff --git a/packages/react-api/src/hoc/types.ts b/packages/react-api/src/hoc/types.ts index 200d63ec7b..2191c99294 100644 --- a/packages/react-api/src/hoc/types.ts +++ b/packages/react-api/src/hoc/types.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { OnChangeCb } from '../types'; - import React from 'react'; +import type { OnChangeCb } from '../types'; + export type Transform = (value: any, index: number) => any; export interface DefaultProps { diff --git a/packages/react-api/src/index.ts b/packages/react-api/src/index.ts index f01a0a78e0..87e3d68eb7 100644 --- a/packages/react-api/src/index.ts +++ b/packages/react-api/src/index.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/react-api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import Api, { DEFAULT_DECIMALS, DEFAULT_SS58, api } from './Api'; +import Api, { api, DEFAULT_DECIMALS, DEFAULT_SS58 } from './Api'; import ApiContext from './ApiContext'; -import { withApi, withCalls, withCallDiv, withMulti, withObservable } from './hoc'; +import { withApi, withCallDiv, withCalls, withMulti, withObservable } from './hoc'; import { clearLedger, getLedger, isLedger, isLedgerCapable } from './ledger'; import registry from './typeRegistry'; diff --git a/packages/react-api/src/types.ts b/packages/react-api/src/types.ts index 136d6f3ae0..83fbc34cd7 100644 --- a/packages/react-api/src/types.ts +++ b/packages/react-api/src/types.ts @@ -1,9 +1,8 @@ // Copyright 2017-2020 @polkadot/react-api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { InjectedExtension } from '@polkadot/extension-inject/types'; import type { SubmittableExtrinsicFunction } from '@polkadot/api/promise/types'; - +import type { InjectedExtension } from '@polkadot/extension-inject/types'; import { ApiPromise } from '@polkadot/api/promise'; // helpers for HOC props diff --git a/packages/react-api/src/util/intervalObservable.ts b/packages/react-api/src/util/intervalObservable.ts index ad365a670b..6479188542 100644 --- a/packages/react-api/src/util/intervalObservable.ts +++ b/packages/react-api/src/util/intervalObservable.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { CallState } from '../types'; - import { Subscription } from 'rxjs'; import { interval } from 'rxjs/observable/interval'; +import type { CallState } from '../types'; + const interval$ = interval(500); export default function intervalObservable (that: React.Component): Subscription { diff --git a/packages/react-api/src/util/triggerChange.ts b/packages/react-api/src/util/triggerChange.ts index 1dd853dcf9..29e120f802 100644 --- a/packages/react-api/src/util/triggerChange.ts +++ b/packages/react-api/src/util/triggerChange.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { OnChangeCb } from '../types'; - import { isFunction, isObservable } from '@polkadot/util'; +import type { OnChangeCb } from '../types'; + export default function triggerChange (value?: unknown, ...callOnResult: (OnChangeCb | undefined)[]): void { if (!callOnResult || !callOnResult.length) { return; diff --git a/packages/react-components/src/AccountIndex.tsx b/packages/react-components/src/AccountIndex.tsx index c1c73002c2..f7af3c61c0 100644 --- a/packages/react-components/src/AccountIndex.tsx +++ b/packages/react-components/src/AccountIndex.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useMemo } from 'react'; +import styled from 'styled-components'; + import type { DeriveAccountInfo } from '@polkadot/api-derive/types'; import type { ThemeProps } from '@polkadot/react-components/types'; import type { AccountId, Address } from '@polkadot/types/interfaces'; - -import React, { useMemo } from 'react'; -import styled from 'styled-components'; import { useApi, useCall } from '@polkadot/react-hooks'; interface Props { diff --git a/packages/react-components/src/AccountName.tsx b/packages/react-components/src/AccountName.tsx index 04981106ac..027cdd8d4c 100644 --- a/packages/react-components/src/AccountName.tsx +++ b/packages/react-components/src/AccountName.tsx @@ -2,19 +2,19 @@ // SPDX-License-Identifier: Apache-2.0 import type { IconName } from '@fortawesome/fontawesome-svg-core'; +import React, { useCallback, useContext, useEffect, useState } from 'react'; +import styled from 'styled-components'; + import type { DeriveAccountInfo, DeriveAccountRegistration } from '@polkadot/api-derive/types'; import type { ThemeProps } from '@polkadot/react-components/types'; import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; - -import React, { useCallback, useContext, useEffect, useState } from 'react'; -import styled from 'styled-components'; -import registry from '@polkadot/react-api/typeRegistry'; import { AccountSidebarToggle } from '@polkadot/app-accounts/Sidebar'; -import { useCall, useApi } from '@polkadot/react-hooks'; +import registry from '@polkadot/react-api/typeRegistry'; +import { useApi, useCall } from '@polkadot/react-hooks'; import { isFunction, stringToU8a } from '@polkadot/util'; -import { getAddressName } from './util'; import Badge from './Badge'; +import { getAddressName } from './util'; interface Props { children?: React.ReactNode; diff --git a/packages/react-components/src/ActionItem.tsx b/packages/react-components/src/ActionItem.tsx index 9892d4499f..2390d9bdca 100644 --- a/packages/react-components/src/ActionItem.tsx +++ b/packages/react-components/src/ActionItem.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Proposal } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; import React from 'react'; import styled from 'styled-components'; +import type { Proposal } from '@polkadot/types/interfaces'; + import Card from './Card'; import ProposedAction, { styles as proposedActionStyles } from './ProposedAction'; import { styles as rowStyles } from './Row'; diff --git a/packages/react-components/src/AddressInfo.tsx b/packages/react-components/src/AddressInfo.tsx index 4bf8be8a73..19f3f7444f 100644 --- a/packages/react-components/src/AddressInfo.tsx +++ b/packages/react-components/src/AddressInfo.tsx @@ -2,23 +2,23 @@ // SPDX-License-Identifier: Apache-2.0 import type { TFunction } from 'i18next'; -import type { DeriveBalancesAll, DeriveDemocracyLock, DeriveStakingAccount } from '@polkadot/api-derive/types'; -import type { BlockNumber, LockIdentifier, ValidatorPrefsTo145 } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; import React from 'react'; import styled from 'styled-components'; -import { BN_ZERO, formatBalance, formatNumber, hexToString, isObject } from '@polkadot/util'; -import { Expander, Icon, Tooltip } from '@polkadot/react-components'; + +import type { DeriveBalancesAll, DeriveDemocracyLock, DeriveStakingAccount } from '@polkadot/api-derive/types'; +import type { BlockNumber, LockIdentifier, ValidatorPrefsTo145 } from '@polkadot/types/interfaces'; import { withCalls, withMulti } from '@polkadot/react-api/hoc'; +import { Expander, Icon, Tooltip } from '@polkadot/react-components'; import { useAccounts, useApi, useCall } from '@polkadot/react-hooks'; import { BlockToTime, FormatBalance } from '@polkadot/react-query'; +import { BN_ZERO, formatBalance, formatNumber, hexToString, isObject } from '@polkadot/util'; +import CryptoType from './CryptoType'; import DemocracyLocks from './DemocracyLocks'; +import Label from './Label'; import StakingRedeemable from './StakingRedeemable'; import StakingUnbonding from './StakingUnbonding'; -import CryptoType from './CryptoType'; -import Label from './Label'; import { useTranslation } from './translate'; // true to display, or (for bonded) provided values [own, ...all extras] diff --git a/packages/react-components/src/AddressMini.tsx b/packages/react-components/src/AddressMini.tsx index db9b247c9e..040ad12c2d 100644 --- a/packages/react-components/src/AddressMini.tsx +++ b/packages/react-components/src/AddressMini.tsx @@ -1,19 +1,19 @@ // Copyright 2017-2020 @polkadot/app-staking authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { KeyringItemType } from '@polkadot/ui-keyring/types'; -import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; import React from 'react'; import styled from 'styled-components'; -import { toShortAddress } from './util'; +import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; +import type { KeyringItemType } from '@polkadot/ui-keyring/types'; + import AccountName from './AccountName'; import BalanceDisplay from './Balance'; import BondedDisplay from './Bonded'; import IdentityIcon from './IdentityIcon'; import LockedVote from './LockedVote'; +import { toShortAddress } from './util'; interface Props { balance?: BN | BN[]; diff --git a/packages/react-components/src/AddressRow.tsx b/packages/react-components/src/AddressRow.tsx index fdf7ef5488..4621259e55 100644 --- a/packages/react-components/src/AddressRow.tsx +++ b/packages/react-components/src/AddressRow.tsx @@ -1,16 +1,16 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; - import React from 'react'; import styled from 'styled-components'; + +import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; import { useAccountInfo } from '@polkadot/react-hooks'; import BaseIdentityIcon from '@polkadot/react-identicon'; -import { toShortAddress } from './util'; import IdentityIcon from './IdentityIcon'; import Row, { RowProps } from './Row'; +import { toShortAddress } from './util'; export interface Props extends RowProps { isContract?: boolean; diff --git a/packages/react-components/src/AddressSmall.tsx b/packages/react-components/src/AddressSmall.tsx index ae5fcc92fb..a41dd626c0 100644 --- a/packages/react-components/src/AddressSmall.tsx +++ b/packages/react-components/src/AddressSmall.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Address, AccountId } from '@polkadot/types/interfaces'; - import React from 'react'; import styled from 'styled-components'; +import type { AccountId, Address } from '@polkadot/types/interfaces'; + import AccountName from './AccountName'; import IdentityIcon from './IdentityIcon'; diff --git a/packages/react-components/src/AddressToggle.tsx b/packages/react-components/src/AddressToggle.tsx index 33d0a3607c..409db31fc1 100644 --- a/packages/react-components/src/AddressToggle.tsx +++ b/packages/react-components/src/AddressToggle.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveAccountInfo } from '@polkadot/api-derive/types'; - import React, { useCallback, useMemo } from 'react'; import styled from 'styled-components'; + +import type { DeriveAccountInfo } from '@polkadot/api-derive/types'; import { useApi, useCall } from '@polkadot/react-hooks'; import AddressMini from './AddressMini'; diff --git a/packages/react-components/src/Available.tsx b/packages/react-components/src/Available.tsx index 0f2e17e8b5..0b5afd395b 100644 --- a/packages/react-components/src/Available.tsx +++ b/packages/react-components/src/Available.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; - import React from 'react'; + +import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; import { Available } from '@polkadot/react-query'; export interface Props { diff --git a/packages/react-components/src/Badge.tsx b/packages/react-components/src/Badge.tsx index 07819dfba4..07c7ede811 100644 --- a/packages/react-components/src/Badge.tsx +++ b/packages/react-components/src/Badge.tsx @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import type { IconName } from '@fortawesome/fontawesome-svg-core'; - import React, { useState } from 'react'; import styled from 'styled-components'; diff --git a/packages/react-components/src/Balance.tsx b/packages/react-components/src/Balance.tsx index 3c92bc663e..cdac821a7e 100644 --- a/packages/react-components/src/Balance.tsx +++ b/packages/react-components/src/Balance.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; import React from 'react'; + +import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; import { Balance, FormatBalance } from '@polkadot/react-query'; import { BN_ZERO } from '@polkadot/util'; diff --git a/packages/react-components/src/Bonded.tsx b/packages/react-components/src/Bonded.tsx index 5a924d3a8e..a57695699d 100644 --- a/packages/react-components/src/Bonded.tsx +++ b/packages/react-components/src/Bonded.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; import React from 'react'; + +import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; import { Bonded } from '@polkadot/react-query'; import { renderProvided } from './Balance'; diff --git a/packages/react-components/src/Button/Button.tsx b/packages/react-components/src/Button/Button.tsx index 4518bd3ac0..72399256ab 100644 --- a/packages/react-components/src/Button/Button.tsx +++ b/packages/react-components/src/Button/Button.tsx @@ -1,12 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from '../types'; -import type { ButtonProps } from './types'; - import React, { useCallback } from 'react'; import styled from 'styled-components'; +import type { ThemeProps } from '../types'; +import type { ButtonProps } from './types'; import Icon from '../Icon'; import Spinner from '../Spinner'; diff --git a/packages/react-components/src/Button/Group.tsx b/packages/react-components/src/Button/Group.tsx index 57f54400b3..590e80ad2e 100644 --- a/packages/react-components/src/Button/Group.tsx +++ b/packages/react-components/src/Button/Group.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { GroupProps } from './types'; - import React from 'react'; import styled from 'styled-components'; +import type { GroupProps } from './types'; + function ButtonGroup ({ children, className = '', isCentered }: GroupProps): React.ReactElement { return (

diff --git a/packages/react-components/src/Button/index.tsx b/packages/react-components/src/Button/index.tsx index 9533c25fa3..6a53aa4ec5 100644 --- a/packages/react-components/src/Button/index.tsx +++ b/packages/react-components/src/Button/index.tsx @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import type { ButtonType } from './types'; - import IButton from './Button'; import Group from './Group'; diff --git a/packages/react-components/src/Button/types.ts b/packages/react-components/src/Button/types.ts index bb2f6ee90f..3d4e026db1 100644 --- a/packages/react-components/src/Button/types.ts +++ b/packages/react-components/src/Button/types.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { IconName } from '@fortawesome/fontawesome-svg-core'; + import type { BareProps } from '../types'; export type Button$Callback = () => void | Promise; diff --git a/packages/react-components/src/Call.tsx b/packages/react-components/src/Call.tsx index 20b2e722eb..cb6f6ad335 100644 --- a/packages/react-components/src/Call.tsx +++ b/packages/react-components/src/Call.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Hash } from '@polkadot/types/interfaces'; -import type { Codec, IExtrinsic, IMethod, TypeDef } from '@polkadot/types/types'; - import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; + +import type { Hash } from '@polkadot/types/interfaces'; +import type { Codec, IExtrinsic, IMethod, TypeDef } from '@polkadot/types/types'; import Params from '@polkadot/react-params'; import { FormatBalance } from '@polkadot/react-query'; import { GenericCall, getTypeDef } from '@polkadot/types'; diff --git a/packages/react-components/src/CallExpander.tsx b/packages/react-components/src/CallExpander.tsx index ee4628276c..4205367d94 100644 --- a/packages/react-components/src/CallExpander.tsx +++ b/packages/react-components/src/CallExpander.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Call } from '@polkadot/types/interfaces'; - import React from 'react'; +import type { Call } from '@polkadot/types/interfaces'; + import CallDisplay from './Call'; import Expander from './Expander'; diff --git a/packages/react-components/src/CardGrid.tsx b/packages/react-components/src/CardGrid.tsx index c51c4c2c2d..e7c1138b42 100644 --- a/packages/react-components/src/CardGrid.tsx +++ b/packages/react-components/src/CardGrid.tsx @@ -5,7 +5,6 @@ import React from 'react'; import styled from 'styled-components'; import Collection, { CollectionProps as Props, CollectionState as State, collectionStyles } from './Collection'; - import translate from './translate'; class CardGrid extends Collection { diff --git a/packages/react-components/src/CardSummary.tsx b/packages/react-components/src/CardSummary.tsx index d5379d0c6b..c7e2c32cda 100644 --- a/packages/react-components/src/CardSummary.tsx +++ b/packages/react-components/src/CardSummary.tsx @@ -1,17 +1,17 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { UInt } from '@polkadot/types'; -import type { ThemeProps } from './types'; - import BN from 'bn.js'; import React from 'react'; import styled from 'styled-components'; + +import type { UInt } from '@polkadot/types'; +import { BlockToTime } from '@polkadot/react-query'; import { formatNumber, isUndefined } from '@polkadot/util'; -import Progress from './Progress'; +import type { ThemeProps } from './types'; import Labelled from './Labelled'; -import { BlockToTime } from '@polkadot/react-query'; +import Progress from './Progress'; interface ProgressProps { hideValue?: boolean; diff --git a/packages/react-components/src/ChainImg.tsx b/packages/react-components/src/ChainImg.tsx index c51ef408c2..5bdb18d8a8 100644 --- a/packages/react-components/src/ChainImg.tsx +++ b/packages/react-components/src/ChainImg.tsx @@ -3,6 +3,7 @@ import React, { useMemo } from 'react'; import styled from 'styled-components'; + import { chainLogos, emptyLogos, namedLogos, nodeLogos } from '@polkadot/apps-config'; import { useApi } from '@polkadot/react-hooks'; diff --git a/packages/react-components/src/ChainLock.tsx b/packages/react-components/src/ChainLock.tsx index 06ca0f43bd..f3d5f518c3 100644 --- a/packages/react-components/src/ChainLock.tsx +++ b/packages/react-components/src/ChainLock.tsx @@ -3,11 +3,12 @@ import React, { useCallback, useMemo } from 'react'; import styled from 'styled-components'; + import { useApi } from '@polkadot/react-hooks'; import chains from '@polkadot/ui-settings/defaults/chains'; -import { useTranslation } from './translate'; import Toggle from './Toggle'; +import { useTranslation } from './translate'; interface Props { className?: string; diff --git a/packages/react-components/src/Chart/Base.tsx b/packages/react-components/src/Chart/Base.tsx index f2befa6363..5804b189fc 100644 --- a/packages/react-components/src/Chart/Base.tsx +++ b/packages/react-components/src/Chart/Base.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { BaseProps } from './types'; - import React from 'react'; import styled from 'styled-components'; +import type { BaseProps } from './types'; + const Wrapper = styled.div` position: relative; display: inline-block; diff --git a/packages/react-components/src/Chart/Doughnut.tsx b/packages/react-components/src/Chart/Doughnut.tsx index 70146ded63..0e49b5bca9 100644 --- a/packages/react-components/src/Chart/Doughnut.tsx +++ b/packages/react-components/src/Chart/Doughnut.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DoughnutProps } from './types'; - import React from 'react'; import { Doughnut } from 'react-chartjs-2'; + import { bnToBn } from '@polkadot/util'; +import type { DoughnutProps } from './types'; import Base from './Base'; interface Options { diff --git a/packages/react-components/src/Chart/HorizBar.tsx b/packages/react-components/src/Chart/HorizBar.tsx index 4cd2841bfb..16a6f53380 100644 --- a/packages/react-components/src/Chart/HorizBar.tsx +++ b/packages/react-components/src/Chart/HorizBar.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { HorizBarProps, HorizBarValue } from './types'; - -import React, { useEffect, useState } from 'react'; import ChartJs from 'chart.js'; +import React, { useEffect, useState } from 'react'; import { HorizontalBar } from 'react-chartjs-2'; + import { bnToBn, isNumber } from '@polkadot/util'; +import type { HorizBarProps, HorizBarValue } from './types'; + interface State { chartData?: ChartJs.ChartData; chartOptions?: ChartJs.ChartOptions; diff --git a/packages/react-components/src/Chart/Line.tsx b/packages/react-components/src/Chart/Line.tsx index e312e93e85..b9759c8710 100644 --- a/packages/react-components/src/Chart/Line.tsx +++ b/packages/react-components/src/Chart/Line.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { LineProps } from './types'; - import BN from 'bn.js'; -import React, { useMemo } from 'react'; import ChartJs from 'chart.js'; +import React, { useMemo } from 'react'; import * as Chart from 'react-chartjs-2'; +import type { LineProps } from './types'; + interface State { chartData: ChartJs.ChartData; chartOptions: ChartJs.ChartOptions; diff --git a/packages/react-components/src/Checkbox.tsx b/packages/react-components/src/Checkbox.tsx index 184a7df312..5b3a2e540a 100644 --- a/packages/react-components/src/Checkbox.tsx +++ b/packages/react-components/src/Checkbox.tsx @@ -1,11 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from './types'; - import React, { useCallback } from 'react'; import styled from 'styled-components'; +import type { ThemeProps } from './types'; import Icon from './Icon'; interface Props { diff --git a/packages/react-components/src/Collection.tsx b/packages/react-components/src/Collection.tsx index 0978043e73..b6f439c597 100644 --- a/packages/react-components/src/Collection.tsx +++ b/packages/react-components/src/Collection.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { I18nProps } from '@polkadot/react-components/types'; - import React from 'react'; +import type { I18nProps } from '@polkadot/react-components/types'; + export interface CollectionProps extends I18nProps { banner?: React.ReactNode; buttons?: React.ReactNode; diff --git a/packages/react-components/src/Column.tsx b/packages/react-components/src/Column.tsx index 9a74997e6f..7b99d33bb2 100644 --- a/packages/react-components/src/Column.tsx +++ b/packages/react-components/src/Column.tsx @@ -5,7 +5,6 @@ import React from 'react'; import styled from 'styled-components'; import Collection, { CollectionProps as Props, CollectionState as State, collectionStyles } from './Collection'; - import translate from './translate'; class Column extends Collection { diff --git a/packages/react-components/src/ConvictionDropdown.tsx b/packages/react-components/src/ConvictionDropdown.tsx index ddfd0da2d5..b33cf1648d 100644 --- a/packages/react-components/src/ConvictionDropdown.tsx +++ b/packages/react-components/src/ConvictionDropdown.tsx @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import BN from 'bn.js'; import type { TFunction } from 'i18next'; +import BN from 'bn.js'; import React, { useRef } from 'react'; + import { ApiPromise } from '@polkadot/api'; import { useApi, useBlockTime } from '@polkadot/react-hooks'; diff --git a/packages/react-components/src/CopyButton.tsx b/packages/react-components/src/CopyButton.tsx index 385f378f75..a7dbcd9a50 100644 --- a/packages/react-components/src/CopyButton.tsx +++ b/packages/react-components/src/CopyButton.tsx @@ -2,15 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 import type { IconName } from '@fortawesome/fontawesome-svg-core'; - import React, { useCallback, useContext } from 'react'; import CopyToClipboard from 'react-copy-to-clipboard'; - -import StatusContext from './Status/Context'; -import Button from './Button'; -import { useTranslation } from './translate'; import styled from 'styled-components'; +import Button from './Button'; +import StatusContext from './Status/Context'; +import { useTranslation } from './translate'; + interface Props { children?: React.ReactNode; className?: string; diff --git a/packages/react-components/src/CryptoType.tsx b/packages/react-components/src/CryptoType.tsx index 2e9e3151c2..816da0df74 100644 --- a/packages/react-components/src/CryptoType.tsx +++ b/packages/react-components/src/CryptoType.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; - import React, { useEffect, useState } from 'react'; + +import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; import keyring from '@polkadot/ui-keyring'; interface Props { diff --git a/packages/react-components/src/DemocracyLocks.tsx b/packages/react-components/src/DemocracyLocks.tsx index c0ccd735cd..769f425116 100644 --- a/packages/react-components/src/DemocracyLocks.tsx +++ b/packages/react-components/src/DemocracyLocks.tsx @@ -1,19 +1,19 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveDemocracyLock } from '@polkadot/api-derive/types'; - -import BN from 'bn.js'; import type { TFunction } from 'i18next'; +import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; + +import type { DeriveDemocracyLock } from '@polkadot/api-derive/types'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BlockToTime, FormatBalance } from '@polkadot/react-query'; import { BN_ZERO, bnMax, formatBalance, formatNumber } from '@polkadot/util'; -import { useTranslation } from './translate'; import Icon from './Icon'; import Tooltip from './Tooltip'; +import { useTranslation } from './translate'; interface Props { className?: string; diff --git a/packages/react-components/src/Dropdown.tsx b/packages/react-components/src/Dropdown.tsx index 218fd18fb9..8d30af6d55 100644 --- a/packages/react-components/src/Dropdown.tsx +++ b/packages/react-components/src/Dropdown.tsx @@ -2,9 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import React, { useCallback, useEffect, useRef, useState } from 'react'; -import styled from 'styled-components'; import SUIButton from 'semantic-ui-react/dist/commonjs/elements/Button/Button'; import SUIDropdown, { DropdownProps } from 'semantic-ui-react/dist/commonjs/modules/Dropdown/Dropdown'; +import styled from 'styled-components'; + import { isUndefined } from '@polkadot/util'; import Labelled from './Labelled'; diff --git a/packages/react-components/src/EditButton.tsx b/packages/react-components/src/EditButton.tsx index f128e1773f..40f7d2890f 100644 --- a/packages/react-components/src/EditButton.tsx +++ b/packages/react-components/src/EditButton.tsx @@ -2,13 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 import type { IconName } from '@fortawesome/fontawesome-svg-core'; -import type { VoidFn } from './types'; - import React from 'react'; import styled from 'styled-components'; -import { colorLink } from './styles/theme'; +import type { VoidFn } from './types'; import Icon from './Icon'; +import { colorLink } from './styles/theme'; interface Props { children?: React.ReactNode; diff --git a/packages/react-components/src/ErrorBoundary.tsx b/packages/react-components/src/ErrorBoundary.tsx index d799a207f1..64f8decebd 100644 --- a/packages/react-components/src/ErrorBoundary.tsx +++ b/packages/react-components/src/ErrorBoundary.tsx @@ -1,10 +1,9 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { I18nProps } from './types'; - import React from 'react'; +import type { I18nProps } from './types'; import translate from './translate'; interface Props extends I18nProps { diff --git a/packages/react-components/src/Event.tsx b/packages/react-components/src/Event.tsx index bd6f17764f..507076bdf3 100644 --- a/packages/react-components/src/Event.tsx +++ b/packages/react-components/src/Event.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useMemo } from 'react'; + import type { DecodedEvent } from '@polkadot/api-contract/types'; import type { Bytes } from '@polkadot/types'; import type { Event } from '@polkadot/types/interfaces'; import type { Codec } from '@polkadot/types/types'; - -import React, { useMemo } from 'react'; import { Input } from '@polkadot/react-components'; import Params from '@polkadot/react-params'; import { getTypeDef } from '@polkadot/types'; diff --git a/packages/react-components/src/Expander.tsx b/packages/react-components/src/Expander.tsx index 8ed5ce40be..7779ad93bc 100644 --- a/packages/react-components/src/Expander.tsx +++ b/packages/react-components/src/Expander.tsx @@ -2,15 +2,15 @@ // SPDX-License-Identifier: Apache-2.0 import type { IconName } from '@fortawesome/fontawesome-svg-core'; -import type { Text } from '@polkadot/types'; - import React, { useMemo } from 'react'; import styled from 'styled-components'; + +import type { Text } from '@polkadot/types'; import { LabelHelp } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; -import { useTranslation } from './translate'; import Icon from './Icon'; +import { useTranslation } from './translate'; interface Meta { documentation: Text[]; diff --git a/packages/react-components/src/Extrinsic.tsx b/packages/react-components/src/Extrinsic.tsx index e08d3c656e..839199fb2f 100644 --- a/packages/react-components/src/Extrinsic.tsx +++ b/packages/react-components/src/Extrinsic.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/app-extrinsics authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useCallback, useEffect, useState } from 'react'; + import type { SubmittableExtrinsic, SubmittableExtrinsicFunction } from '@polkadot/api/types'; import type { RawParam } from '@polkadot/react-params/types'; import type { TypeDef } from '@polkadot/types/types'; - -import React, { useCallback, useEffect, useState } from 'react'; -import { getTypeDef } from '@polkadot/types/create'; import Params from '@polkadot/react-params'; import { GenericCall } from '@polkadot/types'; +import { getTypeDef } from '@polkadot/types/create'; import { isUndefined } from '@polkadot/util'; import InputExtrinsic from './InputExtrinsic'; diff --git a/packages/react-components/src/Forget.tsx b/packages/react-components/src/Forget.tsx index 8855abf482..1d1c565080 100644 --- a/packages/react-components/src/Forget.tsx +++ b/packages/react-components/src/Forget.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React from 'react'; + import { AddressRow, Button, Modal } from '@polkadot/react-components'; import { useTranslation } from './translate'; diff --git a/packages/react-components/src/HelpOverlay.tsx b/packages/react-components/src/HelpOverlay.tsx index f318b5dbbc..1a3a296c97 100644 --- a/packages/react-components/src/HelpOverlay.tsx +++ b/packages/react-components/src/HelpOverlay.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from './types'; - import React from 'react'; import ReactMd from 'react-markdown'; import styled from 'styled-components'; + import { useToggle } from '@polkadot/react-hooks'; +import type { ThemeProps } from './types'; import Icon from './Icon'; interface Props { diff --git a/packages/react-components/src/Icon.tsx b/packages/react-components/src/Icon.tsx index fe392ca7df..a281e23318 100644 --- a/packages/react-components/src/Icon.tsx +++ b/packages/react-components/src/Icon.tsx @@ -2,10 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 import type { IconName } from '@fortawesome/fontawesome-svg-core'; - -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { library } from '@fortawesome/fontawesome-svg-core'; import { fas } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import React from 'react'; import styled from 'styled-components'; diff --git a/packages/react-components/src/IdentityIcon/RoboHash/backgrounds/index.ts b/packages/react-components/src/IdentityIcon/RoboHash/backgrounds/index.ts index d17cd6216a..6075a4d097 100644 --- a/packages/react-components/src/IdentityIcon/RoboHash/backgrounds/index.ts +++ b/packages/react-components/src/IdentityIcon/RoboHash/backgrounds/index.ts @@ -3,18 +3,18 @@ // Automatically generated, do not edit -import b000 from './bg1/011-final1.png'; -import b001 from './bg1/008-final10.png'; -import b002 from './bg1/003-final2.png'; -import b003 from './bg1/002-final3.png'; -import b004 from './bg1/004-final4.png'; -import b005 from './bg1/005-final5.png'; -import b006 from './bg1/009-final6.png'; -import b007 from './bg1/007-final7.png'; -import b008 from './bg1/010-final8.png'; -import b009 from './bg1/006-final9.png'; import b010 from './bg1/000-robotBG-11.png'; import b011 from './bg1/001-robotBG-12.png'; +import b003 from './bg1/002-final3.png'; +import b002 from './bg1/003-final2.png'; +import b004 from './bg1/004-final4.png'; +import b005 from './bg1/005-final5.png'; +import b009 from './bg1/006-final9.png'; +import b007 from './bg1/007-final7.png'; +import b001 from './bg1/008-final10.png'; +import b006 from './bg1/009-final6.png'; +import b008 from './bg1/010-final8.png'; +import b000 from './bg1/011-final1.png'; import b012 from './bg1/012-robotBG-10.png'; import b013 from './bg2/000-robotBG-06.png'; import b014 from './bg2/001-robotBG-08.png'; diff --git a/packages/react-components/src/IdentityIcon/RoboHash/index.tsx b/packages/react-components/src/IdentityIcon/RoboHash/index.tsx index 4d842a1692..65f548dfcc 100644 --- a/packages/react-components/src/IdentityIcon/RoboHash/index.tsx +++ b/packages/react-components/src/IdentityIcon/RoboHash/index.tsx @@ -10,12 +10,12 @@ // The Cats/"set4" were created by David Revoy, used under CC-BY-4.0 https://www.peppercarrot.com/en/article391/cat-avatar-generator // The avatars used in "set5" were created by Pablo Stanley, for https://avataaars.com/ They are "Free for personal and commercial use. đŸ˜‡" -import type { ThemeProps } from '../../types'; - import React, { useMemo } from 'react'; import styled from 'styled-components'; + import { blake2AsU8a } from '@polkadot/util-crypto'; +import type { ThemeProps } from '../../types'; import backgrounds from './backgrounds'; import sets from './sets'; diff --git a/packages/react-components/src/IdentityIcon/RoboHash/sets/index.ts b/packages/react-components/src/IdentityIcon/RoboHash/sets/index.ts index 32bc93aa7a..39a08cbc51 100644 --- a/packages/react-components/src/IdentityIcon/RoboHash/sets/index.ts +++ b/packages/react-components/src/IdentityIcon/RoboHash/sets/index.ts @@ -3,6 +3,36 @@ // Automatically generated, do not edit +import s000004000 from './set1-blue/000-Mouth/000-blue_mouth-10.png'; +import s000004001 from './set1-blue/000-Mouth/001-blue_mouth-07.png'; +import s000004002 from './set1-blue/000-Mouth/002-blue_mouth-04.png'; +import s000004003 from './set1-blue/000-Mouth/003-blue_mouth-05.png'; +import s000004004 from './set1-blue/000-Mouth/004-blue_mouth-01.png'; +import s000004005 from './set1-blue/000-Mouth/005-blue_mouth-02.png'; +import s000004006 from './set1-blue/000-Mouth/006-blue_mouth-06.png'; +import s000004007 from './set1-blue/000-Mouth/007-blue_mouth-08.png'; +import s000004008 from './set1-blue/000-Mouth/008-blue_mouth-09.png'; +import s000004009 from './set1-blue/000-Mouth/009-blue_mouth-03.png'; +import s000003000 from './set1-blue/001-Eyes/000-blue_eyes-07.png'; +import s000003001 from './set1-blue/001-Eyes/001-blue_eyes-09.png'; +import s000003002 from './set1-blue/001-Eyes/002-blue_eyes-10.png'; +import s000003003 from './set1-blue/001-Eyes/003-blue_eyes-02.png'; +import s000003004 from './set1-blue/001-Eyes/004-blue_eyes-03.png'; +import s000003005 from './set1-blue/001-Eyes/005-blue_eyes-05.png'; +import s000003006 from './set1-blue/001-Eyes/006-blue_eyes-06.png'; +import s000003007 from './set1-blue/001-Eyes/007-blue_eyes-01.png'; +import s000003008 from './set1-blue/001-Eyes/008-blue_eyes-08.png'; +import s000003009 from './set1-blue/001-Eyes/009-blue_eyes-04.png'; +import s000002000 from './set1-blue/002-Accessory/000-blue_accessory-02.png'; +import s000002001 from './set1-blue/002-Accessory/001-blue_accessory-01.png'; +import s000002002 from './set1-blue/002-Accessory/002-blue_accessory-07.png'; +import s000002003 from './set1-blue/002-Accessory/003-blue_accessory-03.png'; +import s000002004 from './set1-blue/002-Accessory/004-blue_accessory-05.png'; +import s000002005 from './set1-blue/002-Accessory/005-blue_accessory-09.png'; +import s000002006 from './set1-blue/002-Accessory/006-blue_accessory-04.png'; +import s000002007 from './set1-blue/002-Accessory/007-blue_accessory-10.png'; +import s000002008 from './set1-blue/002-Accessory/008-blue_accessory-06.png'; +import s000002009 from './set1-blue/002-Accessory/009-blue_accessory-08.png'; import s000000000 from './set1-blue/003-01Body/000-blue_body-10.png'; import s000000001 from './set1-blue/003-01Body/001-blue_body-09.png'; import s000000002 from './set1-blue/003-01Body/002-blue_body-03.png'; @@ -23,36 +53,36 @@ import s000001006 from './set1-blue/004-02Face/006-blue_face-02.png'; import s000001007 from './set1-blue/004-02Face/007-blue_face-09.png'; import s000001008 from './set1-blue/004-02Face/008-blue_face-04.png'; import s000001009 from './set1-blue/004-02Face/009-blue_face-06.png'; -import s000002000 from './set1-blue/002-Accessory/000-blue_accessory-02.png'; -import s000002001 from './set1-blue/002-Accessory/001-blue_accessory-01.png'; -import s000002002 from './set1-blue/002-Accessory/002-blue_accessory-07.png'; -import s000002003 from './set1-blue/002-Accessory/003-blue_accessory-03.png'; -import s000002004 from './set1-blue/002-Accessory/004-blue_accessory-05.png'; -import s000002005 from './set1-blue/002-Accessory/005-blue_accessory-09.png'; -import s000002006 from './set1-blue/002-Accessory/006-blue_accessory-04.png'; -import s000002007 from './set1-blue/002-Accessory/007-blue_accessory-10.png'; -import s000002008 from './set1-blue/002-Accessory/008-blue_accessory-06.png'; -import s000002009 from './set1-blue/002-Accessory/009-blue_accessory-08.png'; -import s000003000 from './set1-blue/001-Eyes/000-blue_eyes-07.png'; -import s000003001 from './set1-blue/001-Eyes/001-blue_eyes-09.png'; -import s000003002 from './set1-blue/001-Eyes/002-blue_eyes-10.png'; -import s000003003 from './set1-blue/001-Eyes/003-blue_eyes-02.png'; -import s000003004 from './set1-blue/001-Eyes/004-blue_eyes-03.png'; -import s000003005 from './set1-blue/001-Eyes/005-blue_eyes-05.png'; -import s000003006 from './set1-blue/001-Eyes/006-blue_eyes-06.png'; -import s000003007 from './set1-blue/001-Eyes/007-blue_eyes-01.png'; -import s000003008 from './set1-blue/001-Eyes/008-blue_eyes-08.png'; -import s000003009 from './set1-blue/001-Eyes/009-blue_eyes-04.png'; -import s000004000 from './set1-blue/000-Mouth/000-blue_mouth-10.png'; -import s000004001 from './set1-blue/000-Mouth/001-blue_mouth-07.png'; -import s000004002 from './set1-blue/000-Mouth/002-blue_mouth-04.png'; -import s000004003 from './set1-blue/000-Mouth/003-blue_mouth-05.png'; -import s000004004 from './set1-blue/000-Mouth/004-blue_mouth-01.png'; -import s000004005 from './set1-blue/000-Mouth/005-blue_mouth-02.png'; -import s000004006 from './set1-blue/000-Mouth/006-blue_mouth-06.png'; -import s000004007 from './set1-blue/000-Mouth/007-blue_mouth-08.png'; -import s000004008 from './set1-blue/000-Mouth/008-blue_mouth-09.png'; -import s000004009 from './set1-blue/000-Mouth/009-blue_mouth-03.png'; +import s001004000 from './set1-brown/000-Mouth/000-brown_mouth-02.png'; +import s001004001 from './set1-brown/000-Mouth/001-brown_mouth-01.png'; +import s001004002 from './set1-brown/000-Mouth/002-brown_mouth-07.png'; +import s001004003 from './set1-brown/000-Mouth/003-brown_mouth-05.png'; +import s001004004 from './set1-brown/000-Mouth/004-brown_mouth-04.png'; +import s001004005 from './set1-brown/000-Mouth/005-brown_mouth-06.png'; +import s001004006 from './set1-brown/000-Mouth/006-brown_mouth-08.png'; +import s001004007 from './set1-brown/000-Mouth/007-brown_mouth-09.png'; +import s001004008 from './set1-brown/000-Mouth/008-brown_mouth-10.png'; +import s001004009 from './set1-brown/000-Mouth/009-brown_mouth-03.png'; +import s001003000 from './set1-brown/001-Eyes/000-brown_eyes-05.png'; +import s001003001 from './set1-brown/001-Eyes/001-brown_eyes-06.png'; +import s001003002 from './set1-brown/001-Eyes/002-brown_eyes-04.png'; +import s001003003 from './set1-brown/001-Eyes/003-brown_eyes-03.png'; +import s001003004 from './set1-brown/001-Eyes/004-brown_eyes-09.png'; +import s001003005 from './set1-brown/001-Eyes/005-brown_eyes-07.png'; +import s001003006 from './set1-brown/001-Eyes/006-brown_eyes-08.png'; +import s001003007 from './set1-brown/001-Eyes/007-brown_eyes-01.png'; +import s001003008 from './set1-brown/001-Eyes/008-brown_eyes-02.png'; +import s001003009 from './set1-brown/001-Eyes/009-brown_eyes-10.png'; +import s001002000 from './set1-brown/002-Accessory/000-brown_accessory-07.png'; +import s001002001 from './set1-brown/002-Accessory/001-brown_accessory-08.png'; +import s001002002 from './set1-brown/002-Accessory/002-brown_accessory-03.png'; +import s001002003 from './set1-brown/002-Accessory/003-brown_accessory-06.png'; +import s001002004 from './set1-brown/002-Accessory/004-brown_accessory-01.png'; +import s001002005 from './set1-brown/002-Accessory/005-brown_accessory-09.png'; +import s001002006 from './set1-brown/002-Accessory/006-brown_accessory-02.png'; +import s001002007 from './set1-brown/002-Accessory/007-brown_accessory-05.png'; +import s001002008 from './set1-brown/002-Accessory/008-brown_accessory-10.png'; +import s001002009 from './set1-brown/002-Accessory/009-brown_accessory-04.png'; import s001000000 from './set1-brown/003-01Body/000-brown_body-06.png'; import s001000001 from './set1-brown/003-01Body/001-brown_body-08.png'; import s001000002 from './set1-brown/003-01Body/002-brown_body-03.png'; @@ -73,36 +103,36 @@ import s001001006 from './set1-brown/004-02Face/006-brown_face-03.png'; import s001001007 from './set1-brown/004-02Face/007-brown_face-10.png'; import s001001008 from './set1-brown/004-02Face/008-brown_face-01.png'; import s001001009 from './set1-brown/004-02Face/009-brown_face-04.png'; -import s001002000 from './set1-brown/002-Accessory/000-brown_accessory-07.png'; -import s001002001 from './set1-brown/002-Accessory/001-brown_accessory-08.png'; -import s001002002 from './set1-brown/002-Accessory/002-brown_accessory-03.png'; -import s001002003 from './set1-brown/002-Accessory/003-brown_accessory-06.png'; -import s001002004 from './set1-brown/002-Accessory/004-brown_accessory-01.png'; -import s001002005 from './set1-brown/002-Accessory/005-brown_accessory-09.png'; -import s001002006 from './set1-brown/002-Accessory/006-brown_accessory-02.png'; -import s001002007 from './set1-brown/002-Accessory/007-brown_accessory-05.png'; -import s001002008 from './set1-brown/002-Accessory/008-brown_accessory-10.png'; -import s001002009 from './set1-brown/002-Accessory/009-brown_accessory-04.png'; -import s001003000 from './set1-brown/001-Eyes/000-brown_eyes-05.png'; -import s001003001 from './set1-brown/001-Eyes/001-brown_eyes-06.png'; -import s001003002 from './set1-brown/001-Eyes/002-brown_eyes-04.png'; -import s001003003 from './set1-brown/001-Eyes/003-brown_eyes-03.png'; -import s001003004 from './set1-brown/001-Eyes/004-brown_eyes-09.png'; -import s001003005 from './set1-brown/001-Eyes/005-brown_eyes-07.png'; -import s001003006 from './set1-brown/001-Eyes/006-brown_eyes-08.png'; -import s001003007 from './set1-brown/001-Eyes/007-brown_eyes-01.png'; -import s001003008 from './set1-brown/001-Eyes/008-brown_eyes-02.png'; -import s001003009 from './set1-brown/001-Eyes/009-brown_eyes-10.png'; -import s001004000 from './set1-brown/000-Mouth/000-brown_mouth-02.png'; -import s001004001 from './set1-brown/000-Mouth/001-brown_mouth-01.png'; -import s001004002 from './set1-brown/000-Mouth/002-brown_mouth-07.png'; -import s001004003 from './set1-brown/000-Mouth/003-brown_mouth-05.png'; -import s001004004 from './set1-brown/000-Mouth/004-brown_mouth-04.png'; -import s001004005 from './set1-brown/000-Mouth/005-brown_mouth-06.png'; -import s001004006 from './set1-brown/000-Mouth/006-brown_mouth-08.png'; -import s001004007 from './set1-brown/000-Mouth/007-brown_mouth-09.png'; -import s001004008 from './set1-brown/000-Mouth/008-brown_mouth-10.png'; -import s001004009 from './set1-brown/000-Mouth/009-brown_mouth-03.png'; +import s002004000 from './set1-green/000-Mouth/000-green_mouth-08.png'; +import s002004001 from './set1-green/000-Mouth/001-green_mouth-04.png'; +import s002004002 from './set1-green/000-Mouth/002-green_mouth-06.png'; +import s002004003 from './set1-green/000-Mouth/003-green_mouth-02.png'; +import s002004004 from './set1-green/000-Mouth/004-green_mouth-03.png'; +import s002004005 from './set1-green/000-Mouth/005-green_mouth-01.png'; +import s002004006 from './set1-green/000-Mouth/006-green_mouth-07.png'; +import s002004007 from './set1-green/000-Mouth/007-green_mouth-10.png'; +import s002004008 from './set1-green/000-Mouth/008-green_mouth-05.png'; +import s002004009 from './set1-green/000-Mouth/009-green_mouth-09.png'; +import s002003000 from './set1-green/001-Eyes/000-green_eyes-05.png'; +import s002003001 from './set1-green/001-Eyes/001-green_eyes-07.png'; +import s002003002 from './set1-green/001-Eyes/002-green_eyes-02.png'; +import s002003003 from './set1-green/001-Eyes/003-green_eyes-01.png'; +import s002003004 from './set1-green/001-Eyes/004-green_eyes-09.png'; +import s002003005 from './set1-green/001-Eyes/005-green_eyes-04.png'; +import s002003006 from './set1-green/001-Eyes/006-green_eyes-10.png'; +import s002003007 from './set1-green/001-Eyes/007-green_eyes-08.png'; +import s002003008 from './set1-green/001-Eyes/008-green_eyes-06.png'; +import s002003009 from './set1-green/001-Eyes/009-green_eyes-03.png'; +import s002002000 from './set1-green/002-Accessory/000-green_accessory-07.png'; +import s002002001 from './set1-green/002-Accessory/001-green_accessory-03.png'; +import s002002002 from './set1-green/002-Accessory/002-green_accessory-08.png'; +import s002002003 from './set1-green/002-Accessory/003-green_accessory-05.png'; +import s002002004 from './set1-green/002-Accessory/004-green_accessory-01.png'; +import s002002005 from './set1-green/002-Accessory/005-green_accessory-04.png'; +import s002002006 from './set1-green/002-Accessory/006-green_accessory-06.png'; +import s002002007 from './set1-green/002-Accessory/007-green_accessory-10.png'; +import s002002008 from './set1-green/002-Accessory/008-green_accessory-02.png'; +import s002002009 from './set1-green/002-Accessory/009-green_accessory-09.png'; import s002000000 from './set1-green/003-01Body/000-green_body-08.png'; import s002000001 from './set1-green/003-01Body/001-green_body-01.png'; import s002000002 from './set1-green/003-01Body/002-green_body-02.png'; @@ -123,36 +153,36 @@ import s002001006 from './set1-green/004-02Face/006-green_face-04.png'; import s002001007 from './set1-green/004-02Face/007-green_face-02.png'; import s002001008 from './set1-green/004-02Face/008-green_face-01.png'; import s002001009 from './set1-green/004-02Face/009-green_face-05.png'; -import s002002000 from './set1-green/002-Accessory/000-green_accessory-07.png'; -import s002002001 from './set1-green/002-Accessory/001-green_accessory-03.png'; -import s002002002 from './set1-green/002-Accessory/002-green_accessory-08.png'; -import s002002003 from './set1-green/002-Accessory/003-green_accessory-05.png'; -import s002002004 from './set1-green/002-Accessory/004-green_accessory-01.png'; -import s002002005 from './set1-green/002-Accessory/005-green_accessory-04.png'; -import s002002006 from './set1-green/002-Accessory/006-green_accessory-06.png'; -import s002002007 from './set1-green/002-Accessory/007-green_accessory-10.png'; -import s002002008 from './set1-green/002-Accessory/008-green_accessory-02.png'; -import s002002009 from './set1-green/002-Accessory/009-green_accessory-09.png'; -import s002003000 from './set1-green/001-Eyes/000-green_eyes-05.png'; -import s002003001 from './set1-green/001-Eyes/001-green_eyes-07.png'; -import s002003002 from './set1-green/001-Eyes/002-green_eyes-02.png'; -import s002003003 from './set1-green/001-Eyes/003-green_eyes-01.png'; -import s002003004 from './set1-green/001-Eyes/004-green_eyes-09.png'; -import s002003005 from './set1-green/001-Eyes/005-green_eyes-04.png'; -import s002003006 from './set1-green/001-Eyes/006-green_eyes-10.png'; -import s002003007 from './set1-green/001-Eyes/007-green_eyes-08.png'; -import s002003008 from './set1-green/001-Eyes/008-green_eyes-06.png'; -import s002003009 from './set1-green/001-Eyes/009-green_eyes-03.png'; -import s002004000 from './set1-green/000-Mouth/000-green_mouth-08.png'; -import s002004001 from './set1-green/000-Mouth/001-green_mouth-04.png'; -import s002004002 from './set1-green/000-Mouth/002-green_mouth-06.png'; -import s002004003 from './set1-green/000-Mouth/003-green_mouth-02.png'; -import s002004004 from './set1-green/000-Mouth/004-green_mouth-03.png'; -import s002004005 from './set1-green/000-Mouth/005-green_mouth-01.png'; -import s002004006 from './set1-green/000-Mouth/006-green_mouth-07.png'; -import s002004007 from './set1-green/000-Mouth/007-green_mouth-10.png'; -import s002004008 from './set1-green/000-Mouth/008-green_mouth-05.png'; -import s002004009 from './set1-green/000-Mouth/009-green_mouth-09.png'; +import s003004000 from './set1-grey/000-Mouth/000-grey_mouth-08.png'; +import s003004001 from './set1-grey/000-Mouth/001-grey_mouth-03.png'; +import s003004002 from './set1-grey/000-Mouth/002-grey_mouth-01.png'; +import s003004003 from './set1-grey/000-Mouth/003-grey_mouth-07.png'; +import s003004004 from './set1-grey/000-Mouth/004-grey_mouth-02.png'; +import s003004005 from './set1-grey/000-Mouth/005-grey_mouth-09.png'; +import s003004006 from './set1-grey/000-Mouth/006-grey_mouth-04.png'; +import s003004007 from './set1-grey/000-Mouth/007-grey_mouth-05.png'; +import s003004008 from './set1-grey/000-Mouth/008-grey_mouth-06.png'; +import s003004009 from './set1-grey/000-Mouth/009-grey_mouth-10.png'; +import s003003000 from './set1-grey/001-Eyes/000-grey_eyes-06.png'; +import s003003001 from './set1-grey/001-Eyes/001-grey_eyes-05.png'; +import s003003002 from './set1-grey/001-Eyes/002-grey_eyes-04.png'; +import s003003003 from './set1-grey/001-Eyes/003-grey_eyes-08.png'; +import s003003004 from './set1-grey/001-Eyes/004-grey_eyes-03.png'; +import s003003005 from './set1-grey/001-Eyes/005-grey_eyes-10.png'; +import s003003006 from './set1-grey/001-Eyes/006-grey_eyes-07.png'; +import s003003007 from './set1-grey/001-Eyes/007-grey_eyes-09.png'; +import s003003008 from './set1-grey/001-Eyes/008-grey_eyes-01.png'; +import s003003009 from './set1-grey/001-Eyes/009-grey_eyes-02.png'; +import s003002000 from './set1-grey/002-Accessory/000-grey_accessory-01.png'; +import s003002001 from './set1-grey/002-Accessory/001-grey_accessory-03.png'; +import s003002002 from './set1-grey/002-Accessory/002-grey_accessory-07.png'; +import s003002003 from './set1-grey/002-Accessory/003-grey_accessory-09.png'; +import s003002004 from './set1-grey/002-Accessory/004-grey_accessory-05.png'; +import s003002005 from './set1-grey/002-Accessory/005-grey_accessory-10.png'; +import s003002006 from './set1-grey/002-Accessory/006-grey_accessory-06.png'; +import s003002007 from './set1-grey/002-Accessory/007-grey_accessory-02.png'; +import s003002008 from './set1-grey/002-Accessory/008-grey_accessory-08.png'; +import s003002009 from './set1-grey/002-Accessory/009-grey_accessory-04.png'; import s003000000 from './set1-grey/003-01Body/000-grey_body-03.png'; import s003000001 from './set1-grey/003-01Body/001-grey_body-09.png'; import s003000002 from './set1-grey/003-01Body/002-grey_body-04.png'; @@ -173,36 +203,36 @@ import s003001006 from './set1-grey/004-02Face/006-grey_face-07.png'; import s003001007 from './set1-grey/004-02Face/007-grey_face-05.png'; import s003001008 from './set1-grey/004-02Face/008-grey_face-09.png'; import s003001009 from './set1-grey/004-02Face/009-grey_face-02.png'; -import s003002000 from './set1-grey/002-Accessory/000-grey_accessory-01.png'; -import s003002001 from './set1-grey/002-Accessory/001-grey_accessory-03.png'; -import s003002002 from './set1-grey/002-Accessory/002-grey_accessory-07.png'; -import s003002003 from './set1-grey/002-Accessory/003-grey_accessory-09.png'; -import s003002004 from './set1-grey/002-Accessory/004-grey_accessory-05.png'; -import s003002005 from './set1-grey/002-Accessory/005-grey_accessory-10.png'; -import s003002006 from './set1-grey/002-Accessory/006-grey_accessory-06.png'; -import s003002007 from './set1-grey/002-Accessory/007-grey_accessory-02.png'; -import s003002008 from './set1-grey/002-Accessory/008-grey_accessory-08.png'; -import s003002009 from './set1-grey/002-Accessory/009-grey_accessory-04.png'; -import s003003000 from './set1-grey/001-Eyes/000-grey_eyes-06.png'; -import s003003001 from './set1-grey/001-Eyes/001-grey_eyes-05.png'; -import s003003002 from './set1-grey/001-Eyes/002-grey_eyes-04.png'; -import s003003003 from './set1-grey/001-Eyes/003-grey_eyes-08.png'; -import s003003004 from './set1-grey/001-Eyes/004-grey_eyes-03.png'; -import s003003005 from './set1-grey/001-Eyes/005-grey_eyes-10.png'; -import s003003006 from './set1-grey/001-Eyes/006-grey_eyes-07.png'; -import s003003007 from './set1-grey/001-Eyes/007-grey_eyes-09.png'; -import s003003008 from './set1-grey/001-Eyes/008-grey_eyes-01.png'; -import s003003009 from './set1-grey/001-Eyes/009-grey_eyes-02.png'; -import s003004000 from './set1-grey/000-Mouth/000-grey_mouth-08.png'; -import s003004001 from './set1-grey/000-Mouth/001-grey_mouth-03.png'; -import s003004002 from './set1-grey/000-Mouth/002-grey_mouth-01.png'; -import s003004003 from './set1-grey/000-Mouth/003-grey_mouth-07.png'; -import s003004004 from './set1-grey/000-Mouth/004-grey_mouth-02.png'; -import s003004005 from './set1-grey/000-Mouth/005-grey_mouth-09.png'; -import s003004006 from './set1-grey/000-Mouth/006-grey_mouth-04.png'; -import s003004007 from './set1-grey/000-Mouth/007-grey_mouth-05.png'; -import s003004008 from './set1-grey/000-Mouth/008-grey_mouth-06.png'; -import s003004009 from './set1-grey/000-Mouth/009-grey_mouth-10.png'; +import s004004000 from './set1-orange/000-Mouth/000-orange_mouth-07.png'; +import s004004001 from './set1-orange/000-Mouth/001-orange_mouth-01.png'; +import s004004002 from './set1-orange/000-Mouth/002-orange_mouth-08.png'; +import s004004003 from './set1-orange/000-Mouth/003-orange_mouth-05.png'; +import s004004004 from './set1-orange/000-Mouth/004-orange_mouth-10.png'; +import s004004005 from './set1-orange/000-Mouth/005-orange_mouth-02.png'; +import s004004006 from './set1-orange/000-Mouth/006-orange_mouth-06.png'; +import s004004007 from './set1-orange/000-Mouth/007-orange_mouth-09.png'; +import s004004008 from './set1-orange/000-Mouth/008-orange_mouth-03.png'; +import s004004009 from './set1-orange/000-Mouth/009-orange_mouth-04.png'; +import s004003000 from './set1-orange/001-Eyes/000-orange_eyes-05.png'; +import s004003001 from './set1-orange/001-Eyes/001-orange_eyes-01.png'; +import s004003002 from './set1-orange/001-Eyes/002-orange_eyes-09.png'; +import s004003003 from './set1-orange/001-Eyes/003-orange_eyes-06.png'; +import s004003004 from './set1-orange/001-Eyes/004-orange_eyes-02.png'; +import s004003005 from './set1-orange/001-Eyes/005-orange_eyes-10.png'; +import s004003006 from './set1-orange/001-Eyes/006-orange_eyes-04.png'; +import s004003007 from './set1-orange/001-Eyes/007-orange_eyes-07.png'; +import s004003008 from './set1-orange/001-Eyes/008-orange_eyes-08.png'; +import s004003009 from './set1-orange/001-Eyes/009-orange_eyes-03.png'; +import s004002000 from './set1-orange/002-Accessory/000-orange_accessory-05.png'; +import s004002001 from './set1-orange/002-Accessory/001-orange_accessory-03.png'; +import s004002002 from './set1-orange/002-Accessory/002-orange_accessory-10.png'; +import s004002003 from './set1-orange/002-Accessory/003-orange_accessory-08.png'; +import s004002004 from './set1-orange/002-Accessory/004-orange_accessory-09.png'; +import s004002005 from './set1-orange/002-Accessory/005-orange_accessory-01.png'; +import s004002006 from './set1-orange/002-Accessory/006-orange_accessory-02.png'; +import s004002007 from './set1-orange/002-Accessory/007-orange_accessory-06.png'; +import s004002008 from './set1-orange/002-Accessory/008-orange_accessory-04.png'; +import s004002009 from './set1-orange/002-Accessory/009-orange_accessory-07.png'; import s004000000 from './set1-orange/003-01Body/000-orange_body-07.png'; import s004000001 from './set1-orange/003-01Body/001-orange_body-05.png'; import s004000002 from './set1-orange/003-01Body/002-orange_body-03.png'; @@ -223,36 +253,36 @@ import s004001006 from './set1-orange/004-02Face/006-orange_face-06.png'; import s004001007 from './set1-orange/004-02Face/007-orange_face-10.png'; import s004001008 from './set1-orange/004-02Face/008-orange_face-04.png'; import s004001009 from './set1-orange/004-02Face/009-orange_face-02.png'; -import s004002000 from './set1-orange/002-Accessory/000-orange_accessory-05.png'; -import s004002001 from './set1-orange/002-Accessory/001-orange_accessory-03.png'; -import s004002002 from './set1-orange/002-Accessory/002-orange_accessory-10.png'; -import s004002003 from './set1-orange/002-Accessory/003-orange_accessory-08.png'; -import s004002004 from './set1-orange/002-Accessory/004-orange_accessory-09.png'; -import s004002005 from './set1-orange/002-Accessory/005-orange_accessory-01.png'; -import s004002006 from './set1-orange/002-Accessory/006-orange_accessory-02.png'; -import s004002007 from './set1-orange/002-Accessory/007-orange_accessory-06.png'; -import s004002008 from './set1-orange/002-Accessory/008-orange_accessory-04.png'; -import s004002009 from './set1-orange/002-Accessory/009-orange_accessory-07.png'; -import s004003000 from './set1-orange/001-Eyes/000-orange_eyes-05.png'; -import s004003001 from './set1-orange/001-Eyes/001-orange_eyes-01.png'; -import s004003002 from './set1-orange/001-Eyes/002-orange_eyes-09.png'; -import s004003003 from './set1-orange/001-Eyes/003-orange_eyes-06.png'; -import s004003004 from './set1-orange/001-Eyes/004-orange_eyes-02.png'; -import s004003005 from './set1-orange/001-Eyes/005-orange_eyes-10.png'; -import s004003006 from './set1-orange/001-Eyes/006-orange_eyes-04.png'; -import s004003007 from './set1-orange/001-Eyes/007-orange_eyes-07.png'; -import s004003008 from './set1-orange/001-Eyes/008-orange_eyes-08.png'; -import s004003009 from './set1-orange/001-Eyes/009-orange_eyes-03.png'; -import s004004000 from './set1-orange/000-Mouth/000-orange_mouth-07.png'; -import s004004001 from './set1-orange/000-Mouth/001-orange_mouth-01.png'; -import s004004002 from './set1-orange/000-Mouth/002-orange_mouth-08.png'; -import s004004003 from './set1-orange/000-Mouth/003-orange_mouth-05.png'; -import s004004004 from './set1-orange/000-Mouth/004-orange_mouth-10.png'; -import s004004005 from './set1-orange/000-Mouth/005-orange_mouth-02.png'; -import s004004006 from './set1-orange/000-Mouth/006-orange_mouth-06.png'; -import s004004007 from './set1-orange/000-Mouth/007-orange_mouth-09.png'; -import s004004008 from './set1-orange/000-Mouth/008-orange_mouth-03.png'; -import s004004009 from './set1-orange/000-Mouth/009-orange_mouth-04.png'; +import s005004000 from './set1-pink/000-Mouth/000-pink_mouth-03.png'; +import s005004001 from './set1-pink/000-Mouth/001-pink_mouth-02.png'; +import s005004002 from './set1-pink/000-Mouth/002-pink_mouth-08.png'; +import s005004003 from './set1-pink/000-Mouth/003-pink_mouth-01.png'; +import s005004004 from './set1-pink/000-Mouth/004-pink_mouth-07.png'; +import s005004005 from './set1-pink/000-Mouth/005-pink_mouth-04.png'; +import s005004006 from './set1-pink/000-Mouth/006-pink_mouth-05.png'; +import s005004007 from './set1-pink/000-Mouth/007-pink_mouth-06.png'; +import s005004008 from './set1-pink/000-Mouth/008-pink_mouth-10.png'; +import s005004009 from './set1-pink/000-Mouth/009-pink_mouth-09.png'; +import s005003000 from './set1-pink/001-Eyes/000-pink_eyes-05.png'; +import s005003001 from './set1-pink/001-Eyes/001-pink_eyes-01.png'; +import s005003002 from './set1-pink/001-Eyes/002-pink_eyes-02.png'; +import s005003003 from './set1-pink/001-Eyes/003-pink_eyes-06.png'; +import s005003004 from './set1-pink/001-Eyes/004-pink_eyes-10.png'; +import s005003005 from './set1-pink/001-Eyes/005-pink_eyes-04.png'; +import s005003006 from './set1-pink/001-Eyes/006-pink_eyes-09.png'; +import s005003007 from './set1-pink/001-Eyes/007-pink_eyes-07.png'; +import s005003008 from './set1-pink/001-Eyes/008-pink_eyes-08.png'; +import s005003009 from './set1-pink/001-Eyes/009-pink_eyes-03.png'; +import s005002000 from './set1-pink/002-Accessory/000-pink_accessory-07.png'; +import s005002001 from './set1-pink/002-Accessory/001-pink_accessory-02.png'; +import s005002002 from './set1-pink/002-Accessory/002-pink_accessory-01.png'; +import s005002003 from './set1-pink/002-Accessory/003-pink_accessory-06.png'; +import s005002004 from './set1-pink/002-Accessory/004-pink_accessory-10.png'; +import s005002005 from './set1-pink/002-Accessory/005-pink_accessory-08.png'; +import s005002006 from './set1-pink/002-Accessory/006-pink_accessory-03.png'; +import s005002007 from './set1-pink/002-Accessory/007-pink_accessory-09.png'; +import s005002008 from './set1-pink/002-Accessory/008-pink_accessory-05.png'; +import s005002009 from './set1-pink/002-Accessory/009-pink_accessory-04.png'; import s005000000 from './set1-pink/003-01Body/000-pink_body-01.png'; import s005000001 from './set1-pink/003-01Body/001-pink_body-03.png'; import s005000002 from './set1-pink/003-01Body/002-pink_body-05.png'; @@ -273,36 +303,36 @@ import s005001006 from './set1-pink/004-02Face/006-pink_face-06.png'; import s005001007 from './set1-pink/004-02Face/007-pink_face-05.png'; import s005001008 from './set1-pink/004-02Face/008-pink_face-09.png'; import s005001009 from './set1-pink/004-02Face/009-pink_face-08.png'; -import s005002000 from './set1-pink/002-Accessory/000-pink_accessory-07.png'; -import s005002001 from './set1-pink/002-Accessory/001-pink_accessory-02.png'; -import s005002002 from './set1-pink/002-Accessory/002-pink_accessory-01.png'; -import s005002003 from './set1-pink/002-Accessory/003-pink_accessory-06.png'; -import s005002004 from './set1-pink/002-Accessory/004-pink_accessory-10.png'; -import s005002005 from './set1-pink/002-Accessory/005-pink_accessory-08.png'; -import s005002006 from './set1-pink/002-Accessory/006-pink_accessory-03.png'; -import s005002007 from './set1-pink/002-Accessory/007-pink_accessory-09.png'; -import s005002008 from './set1-pink/002-Accessory/008-pink_accessory-05.png'; -import s005002009 from './set1-pink/002-Accessory/009-pink_accessory-04.png'; -import s005003000 from './set1-pink/001-Eyes/000-pink_eyes-05.png'; -import s005003001 from './set1-pink/001-Eyes/001-pink_eyes-01.png'; -import s005003002 from './set1-pink/001-Eyes/002-pink_eyes-02.png'; -import s005003003 from './set1-pink/001-Eyes/003-pink_eyes-06.png'; -import s005003004 from './set1-pink/001-Eyes/004-pink_eyes-10.png'; -import s005003005 from './set1-pink/001-Eyes/005-pink_eyes-04.png'; -import s005003006 from './set1-pink/001-Eyes/006-pink_eyes-09.png'; -import s005003007 from './set1-pink/001-Eyes/007-pink_eyes-07.png'; -import s005003008 from './set1-pink/001-Eyes/008-pink_eyes-08.png'; -import s005003009 from './set1-pink/001-Eyes/009-pink_eyes-03.png'; -import s005004000 from './set1-pink/000-Mouth/000-pink_mouth-03.png'; -import s005004001 from './set1-pink/000-Mouth/001-pink_mouth-02.png'; -import s005004002 from './set1-pink/000-Mouth/002-pink_mouth-08.png'; -import s005004003 from './set1-pink/000-Mouth/003-pink_mouth-01.png'; -import s005004004 from './set1-pink/000-Mouth/004-pink_mouth-07.png'; -import s005004005 from './set1-pink/000-Mouth/005-pink_mouth-04.png'; -import s005004006 from './set1-pink/000-Mouth/006-pink_mouth-05.png'; -import s005004007 from './set1-pink/000-Mouth/007-pink_mouth-06.png'; -import s005004008 from './set1-pink/000-Mouth/008-pink_mouth-10.png'; -import s005004009 from './set1-pink/000-Mouth/009-pink_mouth-09.png'; +import s006004000 from './set1-purple/000-Mouth/000-purple_mouth-01.png'; +import s006004001 from './set1-purple/000-Mouth/001-purple_mouth-10.png'; +import s006004002 from './set1-purple/000-Mouth/002-purple_mouth-05.png'; +import s006004003 from './set1-purple/000-Mouth/003-purple_mouth-07.png'; +import s006004004 from './set1-purple/000-Mouth/004-purple_mouth-04.png'; +import s006004005 from './set1-purple/000-Mouth/005-purple_mouth-09.png'; +import s006004006 from './set1-purple/000-Mouth/006-purple_mouth-03.png'; +import s006004007 from './set1-purple/000-Mouth/007-purple_mouth-02.png'; +import s006004008 from './set1-purple/000-Mouth/008-purple_mouth-08.png'; +import s006004009 from './set1-purple/000-Mouth/009-purple_mouth-06.png'; +import s006003000 from './set1-purple/001-Eyes/000-purple_eyes-09.png'; +import s006003001 from './set1-purple/001-Eyes/001-purple_eyes-08.png'; +import s006003002 from './set1-purple/001-Eyes/002-purple_eyes-06.png'; +import s006003003 from './set1-purple/001-Eyes/003-purple_eyes-10.png'; +import s006003004 from './set1-purple/001-Eyes/004-purple_eyes-03.png'; +import s006003005 from './set1-purple/001-Eyes/005-purple_eyes-01.png'; +import s006003006 from './set1-purple/001-Eyes/006-purple_eyes-07.png'; +import s006003007 from './set1-purple/001-Eyes/007-purple_eyes-02.png'; +import s006003008 from './set1-purple/001-Eyes/008-purple_eyes-04.png'; +import s006003009 from './set1-purple/001-Eyes/009-purple_eyes-05.png'; +import s006002000 from './set1-purple/002-Accessory/000-purple_accessory-04.png'; +import s006002001 from './set1-purple/002-Accessory/001-purple_accessory-02.png'; +import s006002002 from './set1-purple/002-Accessory/002-purple_accessory-06.png'; +import s006002003 from './set1-purple/002-Accessory/003-purple_accessory-10.png'; +import s006002004 from './set1-purple/002-Accessory/004-purple_accessory-01.png'; +import s006002005 from './set1-purple/002-Accessory/005-purple_accessory-09.png'; +import s006002006 from './set1-purple/002-Accessory/006-purple_accessory-08.png'; +import s006002007 from './set1-purple/002-Accessory/007-purple_accessory-03.png'; +import s006002008 from './set1-purple/002-Accessory/008-purple_accessory-05.png'; +import s006002009 from './set1-purple/002-Accessory/009-purple_accessory-07.png'; import s006000000 from './set1-purple/003-01Body/000-purple_body-10.png'; import s006000001 from './set1-purple/003-01Body/001-purple_body-04.png'; import s006000002 from './set1-purple/003-01Body/002-purple_body-05.png'; @@ -323,36 +353,36 @@ import s006001006 from './set1-purple/004-02Face/006-purple_face-10.png'; import s006001007 from './set1-purple/004-02Face/007-purple_face-07.png'; import s006001008 from './set1-purple/004-02Face/008-purple_face-02.png'; import s006001009 from './set1-purple/004-02Face/009-purple_face-09.png'; -import s006002000 from './set1-purple/002-Accessory/000-purple_accessory-04.png'; -import s006002001 from './set1-purple/002-Accessory/001-purple_accessory-02.png'; -import s006002002 from './set1-purple/002-Accessory/002-purple_accessory-06.png'; -import s006002003 from './set1-purple/002-Accessory/003-purple_accessory-10.png'; -import s006002004 from './set1-purple/002-Accessory/004-purple_accessory-01.png'; -import s006002005 from './set1-purple/002-Accessory/005-purple_accessory-09.png'; -import s006002006 from './set1-purple/002-Accessory/006-purple_accessory-08.png'; -import s006002007 from './set1-purple/002-Accessory/007-purple_accessory-03.png'; -import s006002008 from './set1-purple/002-Accessory/008-purple_accessory-05.png'; -import s006002009 from './set1-purple/002-Accessory/009-purple_accessory-07.png'; -import s006003000 from './set1-purple/001-Eyes/000-purple_eyes-09.png'; -import s006003001 from './set1-purple/001-Eyes/001-purple_eyes-08.png'; -import s006003002 from './set1-purple/001-Eyes/002-purple_eyes-06.png'; -import s006003003 from './set1-purple/001-Eyes/003-purple_eyes-10.png'; -import s006003004 from './set1-purple/001-Eyes/004-purple_eyes-03.png'; -import s006003005 from './set1-purple/001-Eyes/005-purple_eyes-01.png'; -import s006003006 from './set1-purple/001-Eyes/006-purple_eyes-07.png'; -import s006003007 from './set1-purple/001-Eyes/007-purple_eyes-02.png'; -import s006003008 from './set1-purple/001-Eyes/008-purple_eyes-04.png'; -import s006003009 from './set1-purple/001-Eyes/009-purple_eyes-05.png'; -import s006004000 from './set1-purple/000-Mouth/000-purple_mouth-01.png'; -import s006004001 from './set1-purple/000-Mouth/001-purple_mouth-10.png'; -import s006004002 from './set1-purple/000-Mouth/002-purple_mouth-05.png'; -import s006004003 from './set1-purple/000-Mouth/003-purple_mouth-07.png'; -import s006004004 from './set1-purple/000-Mouth/004-purple_mouth-04.png'; -import s006004005 from './set1-purple/000-Mouth/005-purple_mouth-09.png'; -import s006004006 from './set1-purple/000-Mouth/006-purple_mouth-03.png'; -import s006004007 from './set1-purple/000-Mouth/007-purple_mouth-02.png'; -import s006004008 from './set1-purple/000-Mouth/008-purple_mouth-08.png'; -import s006004009 from './set1-purple/000-Mouth/009-purple_mouth-06.png'; +import s007004000 from './set1-red/000-Mouth/000-red_mouth-07.png'; +import s007004001 from './set1-red/000-Mouth/001-red_mouth-05.png'; +import s007004002 from './set1-red/000-Mouth/002-red_mouth-08.png'; +import s007004003 from './set1-red/000-Mouth/003-red_mouth-01.png'; +import s007004004 from './set1-red/000-Mouth/004-red_mouth-03.png'; +import s007004005 from './set1-red/000-Mouth/005-red_mouth-02.png'; +import s007004006 from './set1-red/000-Mouth/006-red_mouth-04.png'; +import s007004007 from './set1-red/000-Mouth/007-red_mouth-09.png'; +import s007004008 from './set1-red/000-Mouth/008-red_mouth-06.png'; +import s007004009 from './set1-red/000-Mouth/009-red_mouth-10.png'; +import s007003000 from './set1-red/001-Eyes/000-red_eyes-07.png'; +import s007003001 from './set1-red/001-Eyes/001-red_eyes-02.png'; +import s007003002 from './set1-red/001-Eyes/002-red_eyes-06.png'; +import s007003003 from './set1-red/001-Eyes/003-red_eyes-09.png'; +import s007003004 from './set1-red/001-Eyes/004-red_eyes-04.png'; +import s007003005 from './set1-red/001-Eyes/005-red_eyes-05.png'; +import s007003006 from './set1-red/001-Eyes/006-red_eyes-01.png'; +import s007003007 from './set1-red/001-Eyes/007-red_eyes-10.png'; +import s007003008 from './set1-red/001-Eyes/008-red_eyes-03.png'; +import s007003009 from './set1-red/001-Eyes/009-red_eyes-08.png'; +import s007002000 from './set1-red/002-Accessory/000-red_accessory-03.png'; +import s007002001 from './set1-red/002-Accessory/001-red_accessory-09.png'; +import s007002002 from './set1-red/002-Accessory/002-red_accessory-07.png'; +import s007002003 from './set1-red/002-Accessory/003-red_accessory-08.png'; +import s007002004 from './set1-red/002-Accessory/004-red_accessory-10.png'; +import s007002005 from './set1-red/002-Accessory/005-red_accessory-05.png'; +import s007002006 from './set1-red/002-Accessory/006-red_accessory-02.png'; +import s007002007 from './set1-red/002-Accessory/007-red_accessory-01.png'; +import s007002008 from './set1-red/002-Accessory/008-red_accessory-04.png'; +import s007002009 from './set1-red/002-Accessory/009-red_accessory-06.png'; import s007000000 from './set1-red/003-01Body/000-red_body-09.png'; import s007000001 from './set1-red/003-01Body/001-red_body-01.png'; import s007000002 from './set1-red/003-01Body/002-red_body-08.png'; @@ -373,36 +403,36 @@ import s007001006 from './set1-red/004-02Face/006-red_face-04.png'; import s007001007 from './set1-red/004-02Face/007-red_face-01.png'; import s007001008 from './set1-red/004-02Face/008-red_face-07.png'; import s007001009 from './set1-red/004-02Face/009-red_face-09.png'; -import s007002000 from './set1-red/002-Accessory/000-red_accessory-03.png'; -import s007002001 from './set1-red/002-Accessory/001-red_accessory-09.png'; -import s007002002 from './set1-red/002-Accessory/002-red_accessory-07.png'; -import s007002003 from './set1-red/002-Accessory/003-red_accessory-08.png'; -import s007002004 from './set1-red/002-Accessory/004-red_accessory-10.png'; -import s007002005 from './set1-red/002-Accessory/005-red_accessory-05.png'; -import s007002006 from './set1-red/002-Accessory/006-red_accessory-02.png'; -import s007002007 from './set1-red/002-Accessory/007-red_accessory-01.png'; -import s007002008 from './set1-red/002-Accessory/008-red_accessory-04.png'; -import s007002009 from './set1-red/002-Accessory/009-red_accessory-06.png'; -import s007003000 from './set1-red/001-Eyes/000-red_eyes-07.png'; -import s007003001 from './set1-red/001-Eyes/001-red_eyes-02.png'; -import s007003002 from './set1-red/001-Eyes/002-red_eyes-06.png'; -import s007003003 from './set1-red/001-Eyes/003-red_eyes-09.png'; -import s007003004 from './set1-red/001-Eyes/004-red_eyes-04.png'; -import s007003005 from './set1-red/001-Eyes/005-red_eyes-05.png'; -import s007003006 from './set1-red/001-Eyes/006-red_eyes-01.png'; -import s007003007 from './set1-red/001-Eyes/007-red_eyes-10.png'; -import s007003008 from './set1-red/001-Eyes/008-red_eyes-03.png'; -import s007003009 from './set1-red/001-Eyes/009-red_eyes-08.png'; -import s007004000 from './set1-red/000-Mouth/000-red_mouth-07.png'; -import s007004001 from './set1-red/000-Mouth/001-red_mouth-05.png'; -import s007004002 from './set1-red/000-Mouth/002-red_mouth-08.png'; -import s007004003 from './set1-red/000-Mouth/003-red_mouth-01.png'; -import s007004004 from './set1-red/000-Mouth/004-red_mouth-03.png'; -import s007004005 from './set1-red/000-Mouth/005-red_mouth-02.png'; -import s007004006 from './set1-red/000-Mouth/006-red_mouth-04.png'; -import s007004007 from './set1-red/000-Mouth/007-red_mouth-09.png'; -import s007004008 from './set1-red/000-Mouth/008-red_mouth-06.png'; -import s007004009 from './set1-red/000-Mouth/009-red_mouth-10.png'; +import s008004000 from './set1-white/000-Mouth/000-white_mouth-04.png'; +import s008004001 from './set1-white/000-Mouth/001-white_mouth-08.png'; +import s008004002 from './set1-white/000-Mouth/002-white_mouth-05.png'; +import s008004003 from './set1-white/000-Mouth/003-white_mouth-03.png'; +import s008004004 from './set1-white/000-Mouth/004-white_mouth-10.png'; +import s008004005 from './set1-white/000-Mouth/005-white_mouth-07.png'; +import s008004006 from './set1-white/000-Mouth/006-white_mouth-06.png'; +import s008004007 from './set1-white/000-Mouth/007-white_mouth-09.png'; +import s008004008 from './set1-white/000-Mouth/008-white_mouth-02.png'; +import s008004009 from './set1-white/000-Mouth/009-white_mouth-01.png'; +import s008003000 from './set1-white/001-Eyes/000-white_eyes-07.png'; +import s008003001 from './set1-white/001-Eyes/001-white_eyes-10.png'; +import s008003002 from './set1-white/001-Eyes/002-white_eyes-03.png'; +import s008003003 from './set1-white/001-Eyes/003-white_eyes-06.png'; +import s008003004 from './set1-white/001-Eyes/004-white_eyes-04.png'; +import s008003005 from './set1-white/001-Eyes/005-white_eyes-05.png'; +import s008003006 from './set1-white/001-Eyes/006-white_eyes-02.png'; +import s008003007 from './set1-white/001-Eyes/007-white_eyes-09.png'; +import s008003008 from './set1-white/001-Eyes/008-white_eyes-08.png'; +import s008003009 from './set1-white/001-Eyes/009-white_eyes-01.png'; +import s008002000 from './set1-white/002-Accessory/000-white_accessory-04.png'; +import s008002001 from './set1-white/002-Accessory/001-white_accessory-06.png'; +import s008002002 from './set1-white/002-Accessory/002-white_accessory-07.png'; +import s008002003 from './set1-white/002-Accessory/003-white_accessory-09.png'; +import s008002004 from './set1-white/002-Accessory/004-white_accessory-08.png'; +import s008002005 from './set1-white/002-Accessory/005-white_accessory-05.png'; +import s008002006 from './set1-white/002-Accessory/006-white_accessory-10.png'; +import s008002007 from './set1-white/002-Accessory/007-white_accessory-01.png'; +import s008002008 from './set1-white/002-Accessory/008-white_accessory-03.png'; +import s008002009 from './set1-white/002-Accessory/009-white_accessory-02.png'; import s008000000 from './set1-white/003-01Body/000-white_body-01.png'; import s008000001 from './set1-white/003-01Body/001-white_body-08.png'; import s008000002 from './set1-white/003-01Body/002-white_body-06.png'; @@ -423,36 +453,36 @@ import s008001006 from './set1-white/004-02Face/006-white_face-05.png'; import s008001007 from './set1-white/004-02Face/007-white_face-04.png'; import s008001008 from './set1-white/004-02Face/008-white_face-03.png'; import s008001009 from './set1-white/004-02Face/009-white_face-02.png'; -import s008002000 from './set1-white/002-Accessory/000-white_accessory-04.png'; -import s008002001 from './set1-white/002-Accessory/001-white_accessory-06.png'; -import s008002002 from './set1-white/002-Accessory/002-white_accessory-07.png'; -import s008002003 from './set1-white/002-Accessory/003-white_accessory-09.png'; -import s008002004 from './set1-white/002-Accessory/004-white_accessory-08.png'; -import s008002005 from './set1-white/002-Accessory/005-white_accessory-05.png'; -import s008002006 from './set1-white/002-Accessory/006-white_accessory-10.png'; -import s008002007 from './set1-white/002-Accessory/007-white_accessory-01.png'; -import s008002008 from './set1-white/002-Accessory/008-white_accessory-03.png'; -import s008002009 from './set1-white/002-Accessory/009-white_accessory-02.png'; -import s008003000 from './set1-white/001-Eyes/000-white_eyes-07.png'; -import s008003001 from './set1-white/001-Eyes/001-white_eyes-10.png'; -import s008003002 from './set1-white/001-Eyes/002-white_eyes-03.png'; -import s008003003 from './set1-white/001-Eyes/003-white_eyes-06.png'; -import s008003004 from './set1-white/001-Eyes/004-white_eyes-04.png'; -import s008003005 from './set1-white/001-Eyes/005-white_eyes-05.png'; -import s008003006 from './set1-white/001-Eyes/006-white_eyes-02.png'; -import s008003007 from './set1-white/001-Eyes/007-white_eyes-09.png'; -import s008003008 from './set1-white/001-Eyes/008-white_eyes-08.png'; -import s008003009 from './set1-white/001-Eyes/009-white_eyes-01.png'; -import s008004000 from './set1-white/000-Mouth/000-white_mouth-04.png'; -import s008004001 from './set1-white/000-Mouth/001-white_mouth-08.png'; -import s008004002 from './set1-white/000-Mouth/002-white_mouth-05.png'; -import s008004003 from './set1-white/000-Mouth/003-white_mouth-03.png'; -import s008004004 from './set1-white/000-Mouth/004-white_mouth-10.png'; -import s008004005 from './set1-white/000-Mouth/005-white_mouth-07.png'; -import s008004006 from './set1-white/000-Mouth/006-white_mouth-06.png'; -import s008004007 from './set1-white/000-Mouth/007-white_mouth-09.png'; -import s008004008 from './set1-white/000-Mouth/008-white_mouth-02.png'; -import s008004009 from './set1-white/000-Mouth/009-white_mouth-01.png'; +import s009004000 from './set1-yellow/000-Mouth/000-yellow_mouth-03.png'; +import s009004001 from './set1-yellow/000-Mouth/001-yellow_mouth-02.png'; +import s009004002 from './set1-yellow/000-Mouth/002-yellow_mouth-06.png'; +import s009004003 from './set1-yellow/000-Mouth/003-yellow_mouth-01.png'; +import s009004004 from './set1-yellow/000-Mouth/004-yellow_mouth-09.png'; +import s009004005 from './set1-yellow/000-Mouth/005-yellow_mouth-04.png'; +import s009004006 from './set1-yellow/000-Mouth/006-yellow_mouth-08.png'; +import s009004007 from './set1-yellow/000-Mouth/007-yellow_mouth-05.png'; +import s009004008 from './set1-yellow/000-Mouth/008-yellow_mouth-10.png'; +import s009004009 from './set1-yellow/000-Mouth/009-yellow_mouth-07.png'; +import s009003000 from './set1-yellow/001-Eyes/000-yellow_eyes-10.png'; +import s009003001 from './set1-yellow/001-Eyes/001-yellow_eyes-09.png'; +import s009003002 from './set1-yellow/001-Eyes/002-yellow_eyes-02.png'; +import s009003003 from './set1-yellow/001-Eyes/003-yellow_eyes-03.png'; +import s009003004 from './set1-yellow/001-Eyes/004-yellow_eyes-07.png'; +import s009003005 from './set1-yellow/001-Eyes/005-yellow_eyes-01.png'; +import s009003006 from './set1-yellow/001-Eyes/006-yellow_eyes-05.png'; +import s009003007 from './set1-yellow/001-Eyes/007-yellow_eyes-08.png'; +import s009003008 from './set1-yellow/001-Eyes/008-yellow_eyes-04.png'; +import s009003009 from './set1-yellow/001-Eyes/009-yellow_eyes-06.png'; +import s009002000 from './set1-yellow/002-Accessory/000-yellow__accessory-07.png'; +import s009002001 from './set1-yellow/002-Accessory/001-yellow__accessory-09.png'; +import s009002002 from './set1-yellow/002-Accessory/002-yellow__accessory-10.png'; +import s009002003 from './set1-yellow/002-Accessory/003-yellow__accessory-05.png'; +import s009002004 from './set1-yellow/002-Accessory/004-yellow__accessory-06.png'; +import s009002005 from './set1-yellow/002-Accessory/005-yellow__accessory-03.png'; +import s009002006 from './set1-yellow/002-Accessory/006-yellow__accessory-04.png'; +import s009002007 from './set1-yellow/002-Accessory/007-yellow__accessory-02.png'; +import s009002008 from './set1-yellow/002-Accessory/008-yellow__accessory-01.png'; +import s009002009 from './set1-yellow/002-Accessory/009-yellow__accessory-08.png'; import s009000000 from './set1-yellow/003-01Body/000-yellow_body-04.png'; import s009000001 from './set1-yellow/003-01Body/001-yellow_body-06.png'; import s009000002 from './set1-yellow/003-01Body/002-yellow_body-09.png'; @@ -473,112 +503,127 @@ import s009001006 from './set1-yellow/004-02Face/006-yellow_face-01.png'; import s009001007 from './set1-yellow/004-02Face/007-yellow_face-09.png'; import s009001008 from './set1-yellow/004-02Face/008-yellow_face-03.png'; import s009001009 from './set1-yellow/004-02Face/009-yellow_face-07.png'; -import s009002000 from './set1-yellow/002-Accessory/000-yellow__accessory-07.png'; -import s009002001 from './set1-yellow/002-Accessory/001-yellow__accessory-09.png'; -import s009002002 from './set1-yellow/002-Accessory/002-yellow__accessory-10.png'; -import s009002003 from './set1-yellow/002-Accessory/003-yellow__accessory-05.png'; -import s009002004 from './set1-yellow/002-Accessory/004-yellow__accessory-06.png'; -import s009002005 from './set1-yellow/002-Accessory/005-yellow__accessory-03.png'; -import s009002006 from './set1-yellow/002-Accessory/006-yellow__accessory-04.png'; -import s009002007 from './set1-yellow/002-Accessory/007-yellow__accessory-02.png'; -import s009002008 from './set1-yellow/002-Accessory/008-yellow__accessory-01.png'; -import s009002009 from './set1-yellow/002-Accessory/009-yellow__accessory-08.png'; -import s009003000 from './set1-yellow/001-Eyes/000-yellow_eyes-10.png'; -import s009003001 from './set1-yellow/001-Eyes/001-yellow_eyes-09.png'; -import s009003002 from './set1-yellow/001-Eyes/002-yellow_eyes-02.png'; -import s009003003 from './set1-yellow/001-Eyes/003-yellow_eyes-03.png'; -import s009003004 from './set1-yellow/001-Eyes/004-yellow_eyes-07.png'; -import s009003005 from './set1-yellow/001-Eyes/005-yellow_eyes-01.png'; -import s009003006 from './set1-yellow/001-Eyes/006-yellow_eyes-05.png'; -import s009003007 from './set1-yellow/001-Eyes/007-yellow_eyes-08.png'; -import s009003008 from './set1-yellow/001-Eyes/008-yellow_eyes-04.png'; -import s009003009 from './set1-yellow/001-Eyes/009-yellow_eyes-06.png'; -import s009004000 from './set1-yellow/000-Mouth/000-yellow_mouth-03.png'; -import s009004001 from './set1-yellow/000-Mouth/001-yellow_mouth-02.png'; -import s009004002 from './set1-yellow/000-Mouth/002-yellow_mouth-06.png'; -import s009004003 from './set1-yellow/000-Mouth/003-yellow_mouth-01.png'; -import s009004004 from './set1-yellow/000-Mouth/004-yellow_mouth-09.png'; -import s009004005 from './set1-yellow/000-Mouth/005-yellow_mouth-04.png'; -import s009004006 from './set1-yellow/000-Mouth/006-yellow_mouth-08.png'; -import s009004007 from './set1-yellow/000-Mouth/007-yellow_mouth-05.png'; -import s009004008 from './set1-yellow/000-Mouth/008-yellow_mouth-10.png'; -import s009004009 from './set1-yellow/000-Mouth/009-yellow_mouth-07.png'; -import s010000000 from './set2/004-01FaceColors/009-final1.png'; -import s010000001 from './set2/004-01FaceColors/006-final10.png'; -import s010000002 from './set2/004-01FaceColors/001-final2.png'; -import s010000003 from './set2/004-01FaceColors/000-final3.png'; -import s010000004 from './set2/004-01FaceColors/002-final4.png'; -import s010000005 from './set2/004-01FaceColors/003-final5.png'; -import s010000006 from './set2/004-01FaceColors/007-final6.png'; -import s010000007 from './set2/004-01FaceColors/005-final7.png'; -import s010000008 from './set2/004-01FaceColors/008-final8.png'; -import s010000009 from './set2/004-01FaceColors/004-final9.png'; -import s010001000 from './set2/003-02BodyColors/009-final1.png'; -import s010001001 from './set2/003-02BodyColors/006-final10.png'; -import s010001002 from './set2/003-02BodyColors/001-final2.png'; -import s010001003 from './set2/003-02BodyColors/000-final3.png'; -import s010001004 from './set2/003-02BodyColors/002-final4.png'; -import s010001005 from './set2/003-02BodyColors/003-final5.png'; -import s010001006 from './set2/003-02BodyColors/007-final6.png'; -import s010001007 from './set2/003-02BodyColors/005-final7.png'; -import s010001008 from './set2/003-02BodyColors/008-final8.png'; -import s010001009 from './set2/003-02BodyColors/004-final9.png'; -import s010002000 from './set2/006-03Faces/015-final1.png'; -import s010002001 from './set2/006-03Faces/012-final10.png'; -import s010002002 from './set2/006-03Faces/003-final11.png'; -import s010002003 from './set2/006-03Faces/001-final12.png'; -import s010002004 from './set2/006-03Faces/002-final13.png'; -import s010002005 from './set2/006-03Faces/009-final14.png'; -import s010002006 from './set2/006-03Faces/005-final15.png'; -import s010002007 from './set2/006-03Faces/000-final16.png'; -import s010002008 from './set2/006-03Faces/006-final2.png'; -import s010002009 from './set2/006-03Faces/004-final3.png'; -import s010002010 from './set2/006-03Faces/007-final4.png'; -import s010002011 from './set2/006-03Faces/008-final5.png'; -import s010002012 from './set2/006-03Faces/013-final6.png'; -import s010002013 from './set2/006-03Faces/011-final7.png'; -import s010002014 from './set2/006-03Faces/014-final8.png'; -import s010002015 from './set2/006-03Faces/010-final9.png'; -import s010003000 from './set2/000-04Body/009-final1.png'; -import s010003001 from './set2/000-04Body/006-final10.png'; -import s010003002 from './set2/000-04Body/001-final2.png'; import s010003003 from './set2/000-04Body/000-final3.png'; +import s010003002 from './set2/000-04Body/001-final2.png'; import s010003004 from './set2/000-04Body/002-final4.png'; import s010003005 from './set2/000-04Body/003-final5.png'; -import s010003006 from './set2/000-04Body/007-final6.png'; -import s010003007 from './set2/000-04Body/005-final7.png'; -import s010003008 from './set2/000-04Body/008-final8.png'; import s010003009 from './set2/000-04Body/004-final9.png'; -import s010004000 from './set2/002-Eyes/009-final1.png'; -import s010004001 from './set2/002-Eyes/006-final10.png'; -import s010004002 from './set2/002-Eyes/001-final2.png'; -import s010004003 from './set2/002-Eyes/000-final3.png'; -import s010004004 from './set2/002-Eyes/002-final4.png'; -import s010004005 from './set2/002-Eyes/003-final5.png'; -import s010004006 from './set2/002-Eyes/007-final6.png'; -import s010004007 from './set2/002-Eyes/005-final7.png'; -import s010004008 from './set2/002-Eyes/008-final8.png'; -import s010004009 from './set2/002-Eyes/004-final9.png'; -import s010005000 from './set2/001-Mouth/009-final1.png'; -import s010005001 from './set2/001-Mouth/006-final10.png'; -import s010005002 from './set2/001-Mouth/001-final2.png'; +import s010003007 from './set2/000-04Body/005-final7.png'; +import s010003001 from './set2/000-04Body/006-final10.png'; +import s010003006 from './set2/000-04Body/007-final6.png'; +import s010003008 from './set2/000-04Body/008-final8.png'; +import s010003000 from './set2/000-04Body/009-final1.png'; import s010005003 from './set2/001-Mouth/000-final3.png'; +import s010005002 from './set2/001-Mouth/001-final2.png'; import s010005004 from './set2/001-Mouth/002-final4.png'; import s010005005 from './set2/001-Mouth/003-final5.png'; -import s010005006 from './set2/001-Mouth/007-final6.png'; -import s010005007 from './set2/001-Mouth/005-final7.png'; -import s010005008 from './set2/001-Mouth/008-final8.png'; import s010005009 from './set2/001-Mouth/004-final9.png'; -import s010006000 from './set2/005-Nose/009-final1.png'; -import s010006001 from './set2/005-Nose/006-final10.png'; -import s010006002 from './set2/005-Nose/001-final2.png'; +import s010005007 from './set2/001-Mouth/005-final7.png'; +import s010005001 from './set2/001-Mouth/006-final10.png'; +import s010005006 from './set2/001-Mouth/007-final6.png'; +import s010005008 from './set2/001-Mouth/008-final8.png'; +import s010005000 from './set2/001-Mouth/009-final1.png'; +import s010004003 from './set2/002-Eyes/000-final3.png'; +import s010004002 from './set2/002-Eyes/001-final2.png'; +import s010004004 from './set2/002-Eyes/002-final4.png'; +import s010004005 from './set2/002-Eyes/003-final5.png'; +import s010004009 from './set2/002-Eyes/004-final9.png'; +import s010004007 from './set2/002-Eyes/005-final7.png'; +import s010004001 from './set2/002-Eyes/006-final10.png'; +import s010004006 from './set2/002-Eyes/007-final6.png'; +import s010004008 from './set2/002-Eyes/008-final8.png'; +import s010004000 from './set2/002-Eyes/009-final1.png'; +import s010001003 from './set2/003-02BodyColors/000-final3.png'; +import s010001002 from './set2/003-02BodyColors/001-final2.png'; +import s010001004 from './set2/003-02BodyColors/002-final4.png'; +import s010001005 from './set2/003-02BodyColors/003-final5.png'; +import s010001009 from './set2/003-02BodyColors/004-final9.png'; +import s010001007 from './set2/003-02BodyColors/005-final7.png'; +import s010001001 from './set2/003-02BodyColors/006-final10.png'; +import s010001006 from './set2/003-02BodyColors/007-final6.png'; +import s010001008 from './set2/003-02BodyColors/008-final8.png'; +import s010001000 from './set2/003-02BodyColors/009-final1.png'; +import s010000003 from './set2/004-01FaceColors/000-final3.png'; +import s010000002 from './set2/004-01FaceColors/001-final2.png'; +import s010000004 from './set2/004-01FaceColors/002-final4.png'; +import s010000005 from './set2/004-01FaceColors/003-final5.png'; +import s010000009 from './set2/004-01FaceColors/004-final9.png'; +import s010000007 from './set2/004-01FaceColors/005-final7.png'; +import s010000001 from './set2/004-01FaceColors/006-final10.png'; +import s010000006 from './set2/004-01FaceColors/007-final6.png'; +import s010000008 from './set2/004-01FaceColors/008-final8.png'; +import s010000000 from './set2/004-01FaceColors/009-final1.png'; import s010006003 from './set2/005-Nose/000-final3.png'; +import s010006002 from './set2/005-Nose/001-final2.png'; import s010006004 from './set2/005-Nose/002-final4.png'; import s010006005 from './set2/005-Nose/003-final5.png'; -import s010006006 from './set2/005-Nose/007-final6.png'; -import s010006007 from './set2/005-Nose/005-final7.png'; -import s010006008 from './set2/005-Nose/008-final8.png'; import s010006009 from './set2/005-Nose/004-final9.png'; +import s010006007 from './set2/005-Nose/005-final7.png'; +import s010006001 from './set2/005-Nose/006-final10.png'; +import s010006006 from './set2/005-Nose/007-final6.png'; +import s010006008 from './set2/005-Nose/008-final8.png'; +import s010006000 from './set2/005-Nose/009-final1.png'; +import s010002007 from './set2/006-03Faces/000-final16.png'; +import s010002003 from './set2/006-03Faces/001-final12.png'; +import s010002004 from './set2/006-03Faces/002-final13.png'; +import s010002002 from './set2/006-03Faces/003-final11.png'; +import s010002009 from './set2/006-03Faces/004-final3.png'; +import s010002006 from './set2/006-03Faces/005-final15.png'; +import s010002008 from './set2/006-03Faces/006-final2.png'; +import s010002010 from './set2/006-03Faces/007-final4.png'; +import s010002011 from './set2/006-03Faces/008-final5.png'; +import s010002005 from './set2/006-03Faces/009-final14.png'; +import s010002015 from './set2/006-03Faces/010-final9.png'; +import s010002013 from './set2/006-03Faces/011-final7.png'; +import s010002001 from './set2/006-03Faces/012-final10.png'; +import s010002012 from './set2/006-03Faces/013-final6.png'; +import s010002014 from './set2/006-03Faces/014-final8.png'; +import s010002000 from './set2/006-03Faces/015-final1.png'; +import s011006000 from './set3/000-07Mouth/000-Robot-Design9.png'; +import s011006001 from './set3/000-07Mouth/001-Robot-Design7.png'; +import s011006002 from './set3/000-07Mouth/002-Robot-Design1.png'; +import s011006003 from './set3/000-07Mouth/003-Robot-Design5.png'; +import s011006004 from './set3/000-07Mouth/004-Robot-Design2.png'; +import s011006005 from './set3/000-07Mouth/005-Robot-Design6.png'; +import s011006006 from './set3/000-07Mouth/006-Robot-Design3.png'; +import s011006007 from './set3/000-07Mouth/007-Robot-Design8.png'; +import s011006008 from './set3/000-07Mouth/008-Robot-Design4.png'; +import s011001000 from './set3/001-02Wave/000-wave1.png'; +import s011004000 from './set3/002-05Eyebrows/000-Robot-Design9.png'; +import s011004001 from './set3/002-05Eyebrows/001-Robot-Design7.png'; +import s011004002 from './set3/002-05Eyebrows/002-Robot-Design1.png'; +import s011004003 from './set3/002-05Eyebrows/003-Robot-Design5.png'; +import s011004004 from './set3/002-05Eyebrows/004-Robot-Design2.png'; +import s011004005 from './set3/002-05Eyebrows/005-Robot-Design11.png'; +import s011004006 from './set3/002-05Eyebrows/006-Robot-Design6.png'; +import s011004007 from './set3/002-05Eyebrows/007-Robot-Design3.png'; +import s011004008 from './set3/002-05Eyebrows/008-Robot-Design12.png'; +import s011004009 from './set3/002-05Eyebrows/009-Robot-Design8.png'; +import s011004010 from './set3/002-05Eyebrows/010-Robot-Design10.png'; +import s011004011 from './set3/002-05Eyebrows/011-Robot-Design4.png'; +import s011003000 from './set3/003-04Eyes/000-Robot-Design9.png'; +import s011003001 from './set3/003-04Eyes/001-Robot-Design7.png'; +import s011003002 from './set3/003-04Eyes/002-Robot-Design1.png'; +import s011003003 from './set3/003-04Eyes/003-Robot-Design5.png'; +import s011003004 from './set3/003-04Eyes/004-Robot-Design2.png'; +import s011003005 from './set3/003-04Eyes/005-Robot-Design11.png'; +import s011003006 from './set3/003-04Eyes/006-Robot-Design6.png'; +import s011003007 from './set3/003-04Eyes/007-Robot-Design3.png'; +import s011003008 from './set3/003-04Eyes/008-Robot-Design12.png'; +import s011003009 from './set3/003-04Eyes/009-Robot-Design8.png'; +import s011003010 from './set3/003-04Eyes/010-Robot-Design10.png'; +import s011003011 from './set3/003-04Eyes/011-Robot-Design4.png'; +import s011005000 from './set3/004-06Nose/000-Robot-Design9.png'; +import s011005001 from './set3/004-06Nose/001-Robot-Design7.png'; +import s011005002 from './set3/004-06Nose/002-Robot-Design1.png'; +import s011005003 from './set3/004-06Nose/003-Robot-Design5.png'; +import s011005004 from './set3/004-06Nose/004-Robot-Design2.png'; +import s011005005 from './set3/004-06Nose/005-Robot-Design11.png'; +import s011005006 from './set3/004-06Nose/006-Robot-Design6.png'; +import s011005007 from './set3/004-06Nose/007-Robot-Design3.png'; +import s011005008 from './set3/004-06Nose/008-Robot-Design8.png'; +import s011005009 from './set3/004-06Nose/009-Robot-Design10.png'; +import s011005010 from './set3/004-06Nose/010-Robot-Design4.png'; import s011000000 from './set3/005-01BaseFace/000-Robot-Design71.png'; import s011000001 from './set3/005-01BaseFace/001-Robot-Design9.png'; import s011000002 from './set3/005-01BaseFace/002-Robot-Design43.png'; @@ -669,7 +714,6 @@ import s011000086 from './set3/005-01BaseFace/086-Robot-Design39.png'; import s011000087 from './set3/005-01BaseFace/087-Robot-Design4.png'; import s011000088 from './set3/005-01BaseFace/088-Robot-Design79.png'; import s011000089 from './set3/005-01BaseFace/089-Robot-Design44.png'; -import s011001000 from './set3/001-02Wave/000-wave1.png'; import s011002000 from './set3/006-03Antenna/000-Robot-Design9.png'; import s011002001 from './set3/006-03Antenna/001-Robot-Design7.png'; import s011002002 from './set3/006-03Antenna/002-Robot-Design1.png'; @@ -680,57 +724,8 @@ import s011002006 from './set3/006-03Antenna/006-Robot-Design3.png'; import s011002007 from './set3/006-03Antenna/007-Robot-Design8.png'; import s011002008 from './set3/006-03Antenna/008-Robot-Design10.png'; import s011002009 from './set3/006-03Antenna/009-Robot-Design4.png'; -import s011003000 from './set3/003-04Eyes/000-Robot-Design9.png'; -import s011003001 from './set3/003-04Eyes/001-Robot-Design7.png'; -import s011003002 from './set3/003-04Eyes/002-Robot-Design1.png'; -import s011003003 from './set3/003-04Eyes/003-Robot-Design5.png'; -import s011003004 from './set3/003-04Eyes/004-Robot-Design2.png'; -import s011003005 from './set3/003-04Eyes/005-Robot-Design11.png'; -import s011003006 from './set3/003-04Eyes/006-Robot-Design6.png'; -import s011003007 from './set3/003-04Eyes/007-Robot-Design3.png'; -import s011003008 from './set3/003-04Eyes/008-Robot-Design12.png'; -import s011003009 from './set3/003-04Eyes/009-Robot-Design8.png'; -import s011003010 from './set3/003-04Eyes/010-Robot-Design10.png'; -import s011003011 from './set3/003-04Eyes/011-Robot-Design4.png'; -import s011004000 from './set3/002-05Eyebrows/000-Robot-Design9.png'; -import s011004001 from './set3/002-05Eyebrows/001-Robot-Design7.png'; -import s011004002 from './set3/002-05Eyebrows/002-Robot-Design1.png'; -import s011004003 from './set3/002-05Eyebrows/003-Robot-Design5.png'; -import s011004004 from './set3/002-05Eyebrows/004-Robot-Design2.png'; -import s011004005 from './set3/002-05Eyebrows/005-Robot-Design11.png'; -import s011004006 from './set3/002-05Eyebrows/006-Robot-Design6.png'; -import s011004007 from './set3/002-05Eyebrows/007-Robot-Design3.png'; -import s011004008 from './set3/002-05Eyebrows/008-Robot-Design12.png'; -import s011004009 from './set3/002-05Eyebrows/009-Robot-Design8.png'; -import s011004010 from './set3/002-05Eyebrows/010-Robot-Design10.png'; -import s011004011 from './set3/002-05Eyebrows/011-Robot-Design4.png'; -import s011005000 from './set3/004-06Nose/000-Robot-Design9.png'; -import s011005001 from './set3/004-06Nose/001-Robot-Design7.png'; -import s011005002 from './set3/004-06Nose/002-Robot-Design1.png'; -import s011005003 from './set3/004-06Nose/003-Robot-Design5.png'; -import s011005004 from './set3/004-06Nose/004-Robot-Design2.png'; -import s011005005 from './set3/004-06Nose/005-Robot-Design11.png'; -import s011005006 from './set3/004-06Nose/006-Robot-Design6.png'; -import s011005007 from './set3/004-06Nose/007-Robot-Design3.png'; -import s011005008 from './set3/004-06Nose/008-Robot-Design8.png'; -import s011005009 from './set3/004-06Nose/009-Robot-Design10.png'; -import s011005010 from './set3/004-06Nose/010-Robot-Design4.png'; -import s011006000 from './set3/000-07Mouth/000-Robot-Design9.png'; -import s011006001 from './set3/000-07Mouth/001-Robot-Design7.png'; -import s011006002 from './set3/000-07Mouth/002-Robot-Design1.png'; -import s011006003 from './set3/000-07Mouth/003-Robot-Design5.png'; -import s011006004 from './set3/000-07Mouth/004-Robot-Design2.png'; -import s011006005 from './set3/000-07Mouth/005-Robot-Design6.png'; -import s011006006 from './set3/000-07Mouth/006-Robot-Design3.png'; -import s011006007 from './set3/000-07Mouth/007-Robot-Design8.png'; -import s011006008 from './set3/000-07Mouth/008-Robot-Design4.png'; import s012000000 from './set4/000-00body/000-body0.png'; import s012000001 from './set4/000-00body/001-body1.png'; -import s012000002 from './set4/000-00body/010-body10.png'; -import s012000003 from './set4/000-00body/011-body11.png'; -import s012000004 from './set4/000-00body/012-body12.png'; -import s012000005 from './set4/000-00body/013-body13.png'; -import s012000006 from './set4/000-00body/014-body14.png'; import s012000007 from './set4/000-00body/002-body2.png'; import s012000008 from './set4/000-00body/003-body3.png'; import s012000009 from './set4/000-00body/004-body4.png'; @@ -739,6 +734,11 @@ import s012000011 from './set4/000-00body/006-body6.png'; import s012000012 from './set4/000-00body/007-body7.png'; import s012000013 from './set4/000-00body/008-body8.png'; import s012000014 from './set4/000-00body/009-body9.png'; +import s012000002 from './set4/000-00body/010-body10.png'; +import s012000003 from './set4/000-00body/011-body11.png'; +import s012000004 from './set4/000-00body/012-body12.png'; +import s012000005 from './set4/000-00body/013-body13.png'; +import s012000006 from './set4/000-00body/014-body14.png'; import s012001000 from './set4/001-01fur/000-fur0.png'; import s012001001 from './set4/001-01fur/001-fur1.png'; import s012001002 from './set4/001-01fur/002-fur2.png'; @@ -751,11 +751,6 @@ import s012001008 from './set4/001-01fur/008-fur8.png'; import s012001009 from './set4/001-01fur/009-fur9.png'; import s012002000 from './set4/002-02eyes/000-eyes0.png'; import s012002001 from './set4/002-02eyes/001-eyes1.png'; -import s012002002 from './set4/002-02eyes/010-eyes10.png'; -import s012002003 from './set4/002-02eyes/011-eyes11.png'; -import s012002004 from './set4/002-02eyes/012-eyes12.png'; -import s012002005 from './set4/002-02eyes/013-eyes13.png'; -import s012002006 from './set4/002-02eyes/014-eyes14.png'; import s012002007 from './set4/002-02eyes/002-eyes2.png'; import s012002008 from './set4/002-02eyes/003-eyes3.png'; import s012002009 from './set4/002-02eyes/004-eyes4.png'; @@ -764,6 +759,11 @@ import s012002011 from './set4/002-02eyes/006-eyes6.png'; import s012002012 from './set4/002-02eyes/007-eyes7.png'; import s012002013 from './set4/002-02eyes/008-eyes8.png'; import s012002014 from './set4/002-02eyes/009-eyes9.png'; +import s012002002 from './set4/002-02eyes/010-eyes10.png'; +import s012002003 from './set4/002-02eyes/011-eyes11.png'; +import s012002004 from './set4/002-02eyes/012-eyes12.png'; +import s012002005 from './set4/002-02eyes/013-eyes13.png'; +import s012002006 from './set4/002-02eyes/014-eyes14.png'; import s012003000 from './set4/003-03mouth/000-mouth0.png'; import s012003001 from './set4/003-03mouth/001-mouth1.png'; import s012003002 from './set4/003-03mouth/002-mouth2.png'; @@ -776,12 +776,6 @@ import s012003008 from './set4/003-03mouth/008-mouth8.png'; import s012003009 from './set4/003-03mouth/009-mouth9.png'; import s012004000 from './set4/004-04accessories/000-accessory0.png'; import s012004001 from './set4/004-04accessories/001-accessory1.png'; -import s012004002 from './set4/004-04accessories/010-accessory10.png'; -import s012004003 from './set4/004-04accessories/011-accessory11.png'; -import s012004004 from './set4/004-04accessories/012-accessory12.png'; -import s012004005 from './set4/004-04accessories/013-accessory13.png'; -import s012004006 from './set4/004-04accessories/014-accessory14.png'; -import s012004007 from './set4/004-04accessories/015-accessory15.png'; import s012004008 from './set4/004-04accessories/002-accessory2.png'; import s012004009 from './set4/004-04accessories/003-accessory3.png'; import s012004010 from './set4/004-04accessories/004-accessory4.png'; @@ -790,25 +784,12 @@ import s012004012 from './set4/004-04accessories/006-accessory6.png'; import s012004013 from './set4/004-04accessories/007-accessory7.png'; import s012004014 from './set4/004-04accessories/008-accessory8.png'; import s012004015 from './set4/004-04accessories/009-accessory9.png'; -import s013000000 from './set5/007-Accessories/Blank.png'; -import s013000001 from './set5/007-Accessories/Kurt-Black.png'; -import s013000002 from './set5/007-Accessories/Kurt-Brown.png'; -import s013000003 from './set5/007-Accessories/Kurt-White.png'; -import s013000004 from './set5/007-Accessories/Kurt.png'; -import s013000005 from './set5/007-Accessories/Prescription01-Black.png'; -import s013000006 from './set5/007-Accessories/Prescription01-Brown.png'; -import s013000007 from './set5/007-Accessories/Prescription01-White.png'; -import s013000008 from './set5/007-Accessories/Prescription01.png'; -import s013000009 from './set5/007-Accessories/Prescription02-Black.png'; -import s013000010 from './set5/007-Accessories/Prescription02-Brown.png'; -import s013000011 from './set5/007-Accessories/Prescription02-White.png'; -import s013000012 from './set5/007-Accessories/Prescription02.png'; -import s013000013 from './set5/007-Accessories/Round-Black.png'; -import s013000014 from './set5/007-Accessories/Round-Brown.png'; -import s013000015 from './set5/007-Accessories/Round-White.png'; -import s013000016 from './set5/007-Accessories/Round.png'; -import s013000017 from './set5/007-Accessories/Sunglasses.png'; -import s013000018 from './set5/007-Accessories/Wayfarers.png'; +import s012004002 from './set4/004-04accessories/010-accessory10.png'; +import s012004003 from './set4/004-04accessories/011-accessory11.png'; +import s012004004 from './set4/004-04accessories/012-accessory12.png'; +import s012004005 from './set4/004-04accessories/013-accessory13.png'; +import s012004006 from './set4/004-04accessories/014-accessory14.png'; +import s012004007 from './set4/004-04accessories/015-accessory15.png'; import s013001000 from './set5/000-Body/Black.png'; import s013001001 from './set5/000-Body/Brown.png'; import s013001002 from './set5/000-Body/DarkBrown.png'; @@ -816,6 +797,42 @@ import s013001003 from './set5/000-Body/Light.png'; import s013001004 from './set5/000-Body/Pale.png'; import s013001005 from './set5/000-Body/Tanned.png'; import s013001006 from './set5/000-Body/Yellow.png'; +import s013003000 from './set5/001-Eye/Close.png'; +import s013003001 from './set5/001-Eye/Cry.png'; +import s013003002 from './set5/001-Eye/Default.png'; +import s013003003 from './set5/001-Eye/Dizzy.png'; +import s013003004 from './set5/001-Eye/EyeRoll.png'; +import s013003005 from './set5/001-Eye/Happy.png'; +import s013003006 from './set5/001-Eye/Hearts.png'; +import s013003007 from './set5/001-Eye/Side.png'; +import s013003008 from './set5/001-Eye/Squint.png'; +import s013003009 from './set5/001-Eye/Surprised.png'; +import s013003010 from './set5/001-Eye/Wink.png'; +import s013003011 from './set5/001-Eye/WinkWacky.png'; +import s013004000 from './set5/002-Eyebrow/Angry.png'; +import s013004001 from './set5/002-Eyebrow/AngryNatural.png'; +import s013004002 from './set5/002-Eyebrow/Default.png'; +import s013004003 from './set5/002-Eyebrow/DefaultNatural.png'; +import s013004004 from './set5/002-Eyebrow/FlatNatural.png'; +import s013004005 from './set5/002-Eyebrow/RaisedExcited.png'; +import s013004006 from './set5/002-Eyebrow/RaisedExcitedNatural.png'; +import s013004007 from './set5/002-Eyebrow/SadConcerned.png'; +import s013004008 from './set5/002-Eyebrow/SadConcernedNatural.png'; +import s013004009 from './set5/002-Eyebrow/UnibrowNatural.png'; +import s013004010 from './set5/002-Eyebrow/UpDown.png'; +import s013004011 from './set5/002-Eyebrow/UpDownNatural.png'; +import s013006000 from './set5/003-Mouth/Concerned.png'; +import s013006001 from './set5/003-Mouth/Default.png'; +import s013006002 from './set5/003-Mouth/Disbelief.png'; +import s013006003 from './set5/003-Mouth/Eating.png'; +import s013006004 from './set5/003-Mouth/Grimace.png'; +import s013006005 from './set5/003-Mouth/Sad.png'; +import s013006006 from './set5/003-Mouth/ScreamOpen.png'; +import s013006007 from './set5/003-Mouth/Serious.png'; +import s013006008 from './set5/003-Mouth/Smile.png'; +import s013006009 from './set5/003-Mouth/Tongue.png'; +import s013006010 from './set5/003-Mouth/Twinkle.png'; +import s013006011 from './set5/003-Mouth/Vomit.png'; import s013002000 from './set5/004-Cloth/BlazerShirt.png'; import s013002001 from './set5/004-Cloth/BlazerSweater.png'; import s013002002 from './set5/004-Cloth/CollarSweater-Black.png'; @@ -1059,30 +1076,6 @@ import s013002239 from './set5/004-Cloth/ShirtScoopNeck-Red.png'; import s013002240 from './set5/004-Cloth/ShirtScoopNeck-White.png'; import s013002241 from './set5/004-Cloth/ShirtScoopNeck.png'; import s013002242 from './set5/004-Cloth/ShirtVNeck.png'; -import s013003000 from './set5/001-Eye/Close.png'; -import s013003001 from './set5/001-Eye/Cry.png'; -import s013003002 from './set5/001-Eye/Default.png'; -import s013003003 from './set5/001-Eye/Dizzy.png'; -import s013003004 from './set5/001-Eye/EyeRoll.png'; -import s013003005 from './set5/001-Eye/Happy.png'; -import s013003006 from './set5/001-Eye/Hearts.png'; -import s013003007 from './set5/001-Eye/Side.png'; -import s013003008 from './set5/001-Eye/Squint.png'; -import s013003009 from './set5/001-Eye/Surprised.png'; -import s013003010 from './set5/001-Eye/Wink.png'; -import s013003011 from './set5/001-Eye/WinkWacky.png'; -import s013004000 from './set5/002-Eyebrow/Angry.png'; -import s013004001 from './set5/002-Eyebrow/AngryNatural.png'; -import s013004002 from './set5/002-Eyebrow/Default.png'; -import s013004003 from './set5/002-Eyebrow/DefaultNatural.png'; -import s013004004 from './set5/002-Eyebrow/FlatNatural.png'; -import s013004005 from './set5/002-Eyebrow/RaisedExcited.png'; -import s013004006 from './set5/002-Eyebrow/RaisedExcitedNatural.png'; -import s013004007 from './set5/002-Eyebrow/SadConcerned.png'; -import s013004008 from './set5/002-Eyebrow/SadConcernedNatural.png'; -import s013004009 from './set5/002-Eyebrow/UnibrowNatural.png'; -import s013004010 from './set5/002-Eyebrow/UpDown.png'; -import s013004011 from './set5/002-Eyebrow/UpDownNatural.png'; import s013005000 from './set5/005-FacialHair/BeardLight-Auburn.png'; import s013005001 from './set5/005-FacialHair/BeardLight-Black.png'; import s013005002 from './set5/005-FacialHair/BeardLight-Blonde.png'; @@ -1139,18 +1132,6 @@ import s013005052 from './set5/005-FacialHair/MoustacheMagnum.png'; import s013005053 from './set5/005-FacialHair/RedDot.png'; import s013005054 from './set5/005-FacialHair/Wrinkle.png'; import s013005055 from './set5/005-FacialHair/WrinkleTop.png'; -import s013006000 from './set5/003-Mouth/Concerned.png'; -import s013006001 from './set5/003-Mouth/Default.png'; -import s013006002 from './set5/003-Mouth/Disbelief.png'; -import s013006003 from './set5/003-Mouth/Eating.png'; -import s013006004 from './set5/003-Mouth/Grimace.png'; -import s013006005 from './set5/003-Mouth/Sad.png'; -import s013006006 from './set5/003-Mouth/ScreamOpen.png'; -import s013006007 from './set5/003-Mouth/Serious.png'; -import s013006008 from './set5/003-Mouth/Smile.png'; -import s013006009 from './set5/003-Mouth/Tongue.png'; -import s013006010 from './set5/003-Mouth/Twinkle.png'; -import s013006011 from './set5/003-Mouth/Vomit.png'; import s013007000 from './set5/006-Top/Blank.png'; import s013007001 from './set5/006-Top/Eyepatch.png'; import s013007002 from './set5/006-Top/Hat.png'; @@ -1516,6 +1497,25 @@ import s013007361 from './set5/006-Top/WinterHat4-PastelYellow.png'; import s013007362 from './set5/006-Top/WinterHat4-Pink.png'; import s013007363 from './set5/006-Top/WinterHat4-White.png'; import s013007364 from './set5/006-Top/WinterHat4.png'; +import s013000000 from './set5/007-Accessories/Blank.png'; +import s013000001 from './set5/007-Accessories/Kurt-Black.png'; +import s013000002 from './set5/007-Accessories/Kurt-Brown.png'; +import s013000003 from './set5/007-Accessories/Kurt-White.png'; +import s013000004 from './set5/007-Accessories/Kurt.png'; +import s013000005 from './set5/007-Accessories/Prescription01-Black.png'; +import s013000006 from './set5/007-Accessories/Prescription01-Brown.png'; +import s013000007 from './set5/007-Accessories/Prescription01-White.png'; +import s013000008 from './set5/007-Accessories/Prescription01.png'; +import s013000009 from './set5/007-Accessories/Prescription02-Black.png'; +import s013000010 from './set5/007-Accessories/Prescription02-Brown.png'; +import s013000011 from './set5/007-Accessories/Prescription02-White.png'; +import s013000012 from './set5/007-Accessories/Prescription02.png'; +import s013000013 from './set5/007-Accessories/Round-Black.png'; +import s013000014 from './set5/007-Accessories/Round-Brown.png'; +import s013000015 from './set5/007-Accessories/Round-White.png'; +import s013000016 from './set5/007-Accessories/Round.png'; +import s013000017 from './set5/007-Accessories/Sunglasses.png'; +import s013000018 from './set5/007-Accessories/Wayfarers.png'; const sets: any[][][] = [ [ diff --git a/packages/react-components/src/IdentityIcon/index.tsx b/packages/react-components/src/IdentityIcon/index.tsx index 1ca4df107f..4fbd9733a3 100644 --- a/packages/react-components/src/IdentityIcon/index.tsx +++ b/packages/react-components/src/IdentityIcon/index.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { IdentityProps } from '@polkadot/react-identicon/types'; - import React, { useCallback, useContext } from 'react'; import styled from 'styled-components'; + +import type { IdentityProps } from '@polkadot/react-identicon/types'; import { getSystemIcon } from '@polkadot/apps-config'; import { useApi } from '@polkadot/react-hooks'; import BaseIdentityIcon from '@polkadot/react-identicon'; diff --git a/packages/react-components/src/Input.tsx b/packages/react-components/src/Input.tsx index fbab31dac8..b5f0b3583f 100644 --- a/packages/react-components/src/Input.tsx +++ b/packages/react-components/src/Input.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { VoidFn } from './types'; - import React, { useCallback, useState } from 'react'; import SUIInput from 'semantic-ui-react/dist/commonjs/elements/Input/Input'; + import { isFunction, isUndefined } from '@polkadot/util'; +import type { VoidFn } from './types'; import Labelled from './Labelled'; type Input$Type = 'number' | 'password' | 'text'; diff --git a/packages/react-components/src/InputAddress/KeyPair.tsx b/packages/react-components/src/InputAddress/KeyPair.tsx index 0c01e1acd6..affc521a74 100644 --- a/packages/react-components/src/InputAddress/KeyPair.tsx +++ b/packages/react-components/src/InputAddress/KeyPair.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from '@polkadot/react-components/types'; - import React from 'react'; import styled from 'styled-components'; +import type { ThemeProps } from '@polkadot/react-components/types'; + import AccountName from '../AccountName'; import IdentityIcon from '../IdentityIcon'; diff --git a/packages/react-components/src/InputAddress/createHeader.tsx b/packages/react-components/src/InputAddress/createHeader.tsx index 87ca76543a..589fbaaf7d 100644 --- a/packages/react-components/src/InputAddress/createHeader.tsx +++ b/packages/react-components/src/InputAddress/createHeader.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { KeyringSectionOption } from '@polkadot/ui-keyring/options/types'; - import React from 'react'; +import type { KeyringSectionOption } from '@polkadot/ui-keyring/options/types'; + import Dropdown from '../Dropdown'; export default function createHeader (option: KeyringSectionOption): React.ReactNode { diff --git a/packages/react-components/src/InputAddress/createItem.tsx b/packages/react-components/src/InputAddress/createItem.tsx index b117937750..5849c09802 100644 --- a/packages/react-components/src/InputAddress/createItem.tsx +++ b/packages/react-components/src/InputAddress/createItem.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { KeyringSectionOption } from '@polkadot/ui-keyring/options/types'; -import type { Option } from './types'; - import React from 'react'; +import type { KeyringSectionOption } from '@polkadot/ui-keyring/options/types'; + +import type { Option } from './types'; import KeyPair from './KeyPair'; export default function createItem (option: KeyringSectionOption, isUppercase = true): Option { diff --git a/packages/react-components/src/InputAddress/index.tsx b/packages/react-components/src/InputAddress/index.tsx index 6682ce0236..f8785e2ef6 100644 --- a/packages/react-components/src/InputAddress/index.tsx +++ b/packages/react-components/src/InputAddress/index.tsx @@ -1,20 +1,20 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { KeyringOptions, KeyringSectionOption, KeyringSectionOptions, KeyringOption$Type } from '@polkadot/ui-keyring/options/types'; -import type { Option } from './types'; - import React from 'react'; import store from 'store'; import styled from 'styled-components'; + +import type { KeyringOption$Type, KeyringOptions, KeyringSectionOption, KeyringSectionOptions } from '@polkadot/ui-keyring/options/types'; import { withMulti, withObservable } from '@polkadot/react-api/hoc'; import keyring from '@polkadot/ui-keyring'; import createKeyringItem from '@polkadot/ui-keyring/options/item'; import { isNull, isUndefined } from '@polkadot/util'; +import type { Option } from './types'; +import Dropdown from '../Dropdown'; import { getAddressName } from '../util'; import addressToAddress from '../util/toAddress'; -import Dropdown from '../Dropdown'; import createHeader from './createHeader'; import createItem from './createItem'; diff --git a/packages/react-components/src/InputAddress/types.ts b/packages/react-components/src/InputAddress/types.ts index a8d109c110..53a0ca3378 100644 --- a/packages/react-components/src/InputAddress/types.ts +++ b/packages/react-components/src/InputAddress/types.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { KeyringSectionOption, KeyringOption$Type } from '@polkadot/ui-keyring/options/types'; - import React from 'react'; +import type { KeyringOption$Type, KeyringSectionOption } from '@polkadot/ui-keyring/options/types'; + export interface Option extends KeyringSectionOption { className?: string; text: React.ReactNode; diff --git a/packages/react-components/src/InputAddressMulti/SelectedDrag.tsx b/packages/react-components/src/InputAddressMulti/SelectedDrag.tsx index 11e4078485..76f00a2bdc 100644 --- a/packages/react-components/src/InputAddressMulti/SelectedDrag.tsx +++ b/packages/react-components/src/InputAddressMulti/SelectedDrag.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import React from 'react'; -import ReactDOM from 'react-dom'; import { Draggable, DraggableProvided, DraggableStateSnapshot } from 'react-beautiful-dnd'; +import ReactDOM from 'react-dom'; import { PORTAL_ID } from '../../../apps/src/Apps'; import AddressToggle from '../AddressToggle'; diff --git a/packages/react-components/src/InputAddressMulti/index.tsx b/packages/react-components/src/InputAddressMulti/index.tsx index 7632379697..4e7be3f5b4 100644 --- a/packages/react-components/src/InputAddressMulti/index.tsx +++ b/packages/react-components/src/InputAddressMulti/index.tsx @@ -3,11 +3,12 @@ import React, { useCallback, useEffect, useState } from 'react'; import styled from 'styled-components'; + import { useDebounce, useLoadingDelay } from '@polkadot/react-hooks'; -import { useTranslation } from '../translate'; import Input from '../Input'; import Spinner from '../Spinner'; +import { useTranslation } from '../translate'; import Available from './Available'; import Selected from './Selected'; diff --git a/packages/react-components/src/InputAddressSimple.tsx b/packages/react-components/src/InputAddressSimple.tsx index d032071ef4..c657af071f 100644 --- a/packages/react-components/src/InputAddressSimple.tsx +++ b/packages/react-components/src/InputAddressSimple.tsx @@ -4,9 +4,9 @@ import React, { useCallback, useState } from 'react'; import styled from 'styled-components'; -import addressToAddress from './util/toAddress'; import IdentityIcon from './IdentityIcon'; import Input from './Input'; +import addressToAddress from './util/toAddress'; interface Props { autoFocus?: boolean; diff --git a/packages/react-components/src/InputBalance.tsx b/packages/react-components/src/InputBalance.tsx index 8a3c0d9b9e..d3834828f9 100644 --- a/packages/react-components/src/InputBalance.tsx +++ b/packages/react-components/src/InputBalance.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { BitLength } from './types'; - import BN from 'bn.js'; import React, { useMemo } from 'react'; import styled from 'styled-components'; + import { BitLengthOption } from '@polkadot/react-components/constants'; import { BN_TEN, formatBalance, isBn } from '@polkadot/util'; +import type { BitLength } from './types'; import InputNumber from './InputNumber'; interface Props { diff --git a/packages/react-components/src/InputConsts/SelectKey.tsx b/packages/react-components/src/InputConsts/SelectKey.tsx index 0a348c018f..d83f5c37a9 100644 --- a/packages/react-components/src/InputConsts/SelectKey.tsx +++ b/packages/react-components/src/InputConsts/SelectKey.tsx @@ -1,11 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DropdownOptions } from '../util/types'; -import type { ConstValueBase } from './types'; - import React from 'react'; +import type { DropdownOptions } from '../util/types'; +import type { ConstValueBase } from './types'; import Dropdown from '../Dropdown'; interface Props { diff --git a/packages/react-components/src/InputConsts/SelectSection.tsx b/packages/react-components/src/InputConsts/SelectSection.tsx index c545318349..a036ec24f4 100644 --- a/packages/react-components/src/InputConsts/SelectSection.tsx +++ b/packages/react-components/src/InputConsts/SelectSection.tsx @@ -1,11 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DropdownOptions } from '../util/types'; -import type { ConstValueBase, StorageEntryPromise } from './types'; - import React from 'react'; +import type { DropdownOptions } from '../util/types'; +import type { ConstValueBase, StorageEntryPromise } from './types'; import Dropdown from '../Dropdown'; interface Props { diff --git a/packages/react-components/src/InputConsts/index.tsx b/packages/react-components/src/InputConsts/index.tsx index 1eb7c62c42..5e483668c2 100644 --- a/packages/react-components/src/InputConsts/index.tsx +++ b/packages/react-components/src/InputConsts/index.tsx @@ -1,19 +1,19 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ConstantCodec } from '@polkadot/metadata/decorate/types'; -import type { DropdownOptions } from '../util/types'; -import type { ConstValue, ConstValueBase } from './types'; - import React, { useCallback, useState } from 'react'; + +import type { ConstantCodec } from '@polkadot/metadata/decorate/types'; import { ApiPromise } from '@polkadot/api'; import { useApi } from '@polkadot/react-hooks'; +import type { DropdownOptions } from '../util/types'; +import type { ConstValue, ConstValueBase } from './types'; import LinkedWrapper from '../InputExtrinsic/LinkedWrapper'; -import SelectKey from './SelectKey'; -import SelectSection from './SelectSection'; import keyOptions from './options/key'; import sectionOptions from './options/section'; +import SelectKey from './SelectKey'; +import SelectSection from './SelectSection'; interface Props { className?: string; diff --git a/packages/react-components/src/InputConsts/options/key.tsx b/packages/react-components/src/InputConsts/options/key.tsx index bc9662420e..909822d5b8 100644 --- a/packages/react-components/src/InputConsts/options/key.tsx +++ b/packages/react-components/src/InputConsts/options/key.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ConstantCodec } from '@polkadot/metadata/decorate/types'; -import type { DropdownOptions, DropdownOption } from '../../util/types'; - import React from 'react'; + +import type { ConstantCodec } from '@polkadot/metadata/decorate/types'; import { ApiPromise } from '@polkadot/api'; +import type { DropdownOption, DropdownOptions } from '../../util/types'; + export default function createOptions (api: ApiPromise, sectionName: string): DropdownOptions { const section = api.consts[sectionName]; diff --git a/packages/react-components/src/InputConsts/options/section.ts b/packages/react-components/src/InputConsts/options/section.ts index 3d52ff1ac0..ae863e39f1 100644 --- a/packages/react-components/src/InputConsts/options/section.ts +++ b/packages/react-components/src/InputConsts/options/section.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DropdownOptions } from '../../util/types'; - import { ApiPromise } from '@polkadot/api'; +import type { DropdownOptions } from '../../util/types'; + export default function createOptions (api: ApiPromise): DropdownOptions { return Object .keys(api.consts) diff --git a/packages/react-components/src/InputExtrinsic/SelectMethod.tsx b/packages/react-components/src/InputExtrinsic/SelectMethod.tsx index 396b911832..e61884e9bf 100644 --- a/packages/react-components/src/InputExtrinsic/SelectMethod.tsx +++ b/packages/react-components/src/InputExtrinsic/SelectMethod.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SubmittableExtrinsicFunction } from '@polkadot/api/types'; -import type { DropdownOptions } from '../util/types'; - import React, { useCallback } from 'react'; + +import type { SubmittableExtrinsicFunction } from '@polkadot/api/types'; import { ApiPromise } from '@polkadot/api'; +import type { DropdownOptions } from '../util/types'; import Dropdown from '../Dropdown'; interface Props { diff --git a/packages/react-components/src/InputExtrinsic/SelectSection.tsx b/packages/react-components/src/InputExtrinsic/SelectSection.tsx index 9338c75210..b7a37377a7 100644 --- a/packages/react-components/src/InputExtrinsic/SelectSection.tsx +++ b/packages/react-components/src/InputExtrinsic/SelectSection.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SubmittableExtrinsicFunction } from '@polkadot/api/types'; -import type { DropdownOptions } from '../util/types'; - import React from 'react'; +import type { SubmittableExtrinsicFunction } from '@polkadot/api/types'; + +import type { DropdownOptions } from '../util/types'; import Dropdown from '../Dropdown'; interface Props { diff --git a/packages/react-components/src/InputExtrinsic/index.tsx b/packages/react-components/src/InputExtrinsic/index.tsx index 6a69f9fb35..911f1a0a39 100644 --- a/packages/react-components/src/InputExtrinsic/index.tsx +++ b/packages/react-components/src/InputExtrinsic/index.tsx @@ -1,17 +1,17 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SubmittableExtrinsicFunction } from '@polkadot/api/types'; -import type { DropdownOptions } from '../util/types'; - import React, { useCallback, useState } from 'react'; + +import type { SubmittableExtrinsicFunction } from '@polkadot/api/types'; import { useApi } from '@polkadot/react-hooks'; +import type { DropdownOptions } from '../util/types'; import LinkedWrapper from './LinkedWrapper'; -import SelectMethod from './SelectMethod'; -import SelectSection from './SelectSection'; import methodOptions from './options/method'; import sectionOptions from './options/section'; +import SelectMethod from './SelectMethod'; +import SelectSection from './SelectSection'; interface Props { className?: string; diff --git a/packages/react-components/src/InputExtrinsic/options/method.tsx b/packages/react-components/src/InputExtrinsic/options/method.tsx index 2e3bf95fea..b0cc5888f9 100644 --- a/packages/react-components/src/InputExtrinsic/options/method.tsx +++ b/packages/react-components/src/InputExtrinsic/options/method.tsx @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DropdownOption, DropdownOptions } from '../../util/types'; - import React from 'react'; + import { ApiPromise } from '@polkadot/api'; +import type { DropdownOption, DropdownOptions } from '../../util/types'; + export default function createOptions (api: ApiPromise, sectionName: string): DropdownOptions { const section = api.tx[sectionName]; diff --git a/packages/react-components/src/InputExtrinsic/options/section.ts b/packages/react-components/src/InputExtrinsic/options/section.ts index e2a0b2f997..ba910b5a6a 100644 --- a/packages/react-components/src/InputExtrinsic/options/section.ts +++ b/packages/react-components/src/InputExtrinsic/options/section.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DropdownOptions } from '../../util/types'; - import { ApiPromise } from '@polkadot/api'; +import type { DropdownOptions } from '../../util/types'; + export default function createOptions (api: ApiPromise): DropdownOptions { return Object .keys(api.tx) diff --git a/packages/react-components/src/InputFile.tsx b/packages/react-components/src/InputFile.tsx index aae51759e1..866dbce118 100644 --- a/packages/react-components/src/InputFile.tsx +++ b/packages/react-components/src/InputFile.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from './types'; - -import React, { useCallback, useState, createRef } from 'react'; +import React, { createRef, useCallback, useState } from 'react'; import Dropzone, { DropzoneRef } from 'react-dropzone'; import styled from 'styled-components'; -import { formatNumber, isHex, u8aToString, hexToU8a } from '@polkadot/util'; +import { formatNumber, hexToU8a, isHex, u8aToString } from '@polkadot/util'; + +import type { ThemeProps } from './types'; import Labelled from './Labelled'; import { useTranslation } from './translate'; diff --git a/packages/react-components/src/InputNumber.tsx b/packages/react-components/src/InputNumber.tsx index df6cd7d95f..27c598fd42 100644 --- a/packages/react-components/src/InputNumber.tsx +++ b/packages/react-components/src/InputNumber.tsx @@ -1,15 +1,15 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SiDef } from '@polkadot/util/types'; -import type { BitLength } from './types'; - import BN from 'bn.js'; import React, { useCallback, useEffect, useState } from 'react'; import styled from 'styled-components'; -import { registry } from '@polkadot/react-api'; -import { BN_ZERO, BN_TEN, formatBalance, isBn } from '@polkadot/util'; +import type { SiDef } from '@polkadot/util/types'; +import { registry } from '@polkadot/react-api'; +import { BN_TEN, BN_ZERO, formatBalance, isBn } from '@polkadot/util'; + +import type { BitLength } from './types'; import { BitLengthOption } from './constants'; import Dropdown from './Dropdown'; import Input, { KEYS_PRE } from './Input'; diff --git a/packages/react-components/src/InputRpc/SelectMethod.tsx b/packages/react-components/src/InputRpc/SelectMethod.tsx index f7ce67c09b..e22abb7558 100644 --- a/packages/react-components/src/InputRpc/SelectMethod.tsx +++ b/packages/react-components/src/InputRpc/SelectMethod.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionRpcExt } from '@polkadot/types/types'; -import type { DropdownOption } from '../util/types'; - import React, { useCallback } from 'react'; +import type { DefinitionRpcExt } from '@polkadot/types/types'; + +import type { DropdownOption } from '../util/types'; import Dropdown from '../Dropdown'; import rpcs from './rpcs'; diff --git a/packages/react-components/src/InputRpc/SelectSection.tsx b/packages/react-components/src/InputRpc/SelectSection.tsx index bd42e6c322..4563037da5 100644 --- a/packages/react-components/src/InputRpc/SelectSection.tsx +++ b/packages/react-components/src/InputRpc/SelectSection.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionRpcExt } from '@polkadot/types/types'; -import type { DropdownOptions } from '../util/types'; - import React from 'react'; +import type { DefinitionRpcExt } from '@polkadot/types/types'; + +import type { DropdownOptions } from '../util/types'; import Dropdown from '../Dropdown'; interface Props { diff --git a/packages/react-components/src/InputRpc/index.tsx b/packages/react-components/src/InputRpc/index.tsx index b65497716d..1d6f377da7 100644 --- a/packages/react-components/src/InputRpc/index.tsx +++ b/packages/react-components/src/InputRpc/index.tsx @@ -3,18 +3,18 @@ // TODO: We have a lot shared between this and InputExtrinsic & InputStorage -import type { DefinitionRpcExt } from '@polkadot/types/types'; -import type { DropdownOptions } from '../util/types'; - import React, { useCallback, useEffect, useState } from 'react'; + +import type { DefinitionRpcExt } from '@polkadot/types/types'; import { useApi } from '@polkadot/react-hooks'; +import type { DropdownOptions } from '../util/types'; import LinkedWrapper from '../InputExtrinsic/LinkedWrapper'; -import SelectMethod from './SelectMethod'; -import SelectSection from './SelectSection'; import methodOptions from './options/method'; import sectionOptions from './options/section'; import rpcs from './rpcs'; +import SelectMethod from './SelectMethod'; +import SelectSection from './SelectSection'; interface Props { className?: string; diff --git a/packages/react-components/src/InputRpc/options/method.tsx b/packages/react-components/src/InputRpc/options/method.tsx index 504e478b9c..d8b2c47169 100644 --- a/packages/react-components/src/InputRpc/options/method.tsx +++ b/packages/react-components/src/InputRpc/options/method.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DefinitionRpcExt } from '@polkadot/types/types'; -import type { DropdownOption, DropdownOptions } from '../../util/types'; - import React from 'react'; + +import type { DefinitionRpcExt } from '@polkadot/types/types'; import { ApiPromise } from '@polkadot/api'; +import type { DropdownOption, DropdownOptions } from '../../util/types'; import rpcs from '../rpcs'; export default function createOptions (api: ApiPromise, sectionName: string): DropdownOptions { diff --git a/packages/react-components/src/InputRpc/options/section.ts b/packages/react-components/src/InputRpc/options/section.ts index b77e53be09..69b4b42164 100644 --- a/packages/react-components/src/InputRpc/options/section.ts +++ b/packages/react-components/src/InputRpc/options/section.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DropdownOptions } from '../../util/types'; - import { ApiPromise } from '@polkadot/api'; +import type { DropdownOptions } from '../../util/types'; + export default function createOptions (api: ApiPromise): DropdownOptions { return Object .keys(api.rpc) diff --git a/packages/react-components/src/InputRpc/rpcs.ts b/packages/react-components/src/InputRpc/rpcs.ts index 70eecf8d19..489d957b5d 100644 --- a/packages/react-components/src/InputRpc/rpcs.ts +++ b/packages/react-components/src/InputRpc/rpcs.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import type { DefinitionRpc, DefinitionRpcExt } from '@polkadot/types/types'; - import { typesRpc } from '@polkadot/apps-config'; import jsonrpc from '@polkadot/types/interfaces/jsonrpc'; diff --git a/packages/react-components/src/InputStorage/SelectKey.tsx b/packages/react-components/src/InputStorage/SelectKey.tsx index fa66796217..0a5dc7e092 100644 --- a/packages/react-components/src/InputStorage/SelectKey.tsx +++ b/packages/react-components/src/InputStorage/SelectKey.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { QueryableStorageEntry } from '@polkadot/api/types'; -import type { DropdownOptions } from '../util/types'; - import React from 'react'; + +import type { QueryableStorageEntry } from '@polkadot/api/types'; import { ApiPromise } from '@polkadot/api'; import { useApi } from '@polkadot/react-hooks'; +import type { DropdownOptions } from '../util/types'; import Dropdown from '../Dropdown'; interface Props { diff --git a/packages/react-components/src/InputStorage/SelectSection.tsx b/packages/react-components/src/InputStorage/SelectSection.tsx index 9e17ca11bd..f8700bee4b 100644 --- a/packages/react-components/src/InputStorage/SelectSection.tsx +++ b/packages/react-components/src/InputStorage/SelectSection.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { QueryableStorageEntry } from '@polkadot/api/types'; -import type { DropdownOptions } from '../util/types'; - import React from 'react'; +import type { QueryableStorageEntry } from '@polkadot/api/types'; + +import type { DropdownOptions } from '../util/types'; import Dropdown from '../Dropdown'; interface Props { diff --git a/packages/react-components/src/InputStorage/index.tsx b/packages/react-components/src/InputStorage/index.tsx index c6349cd50f..273d1c4167 100644 --- a/packages/react-components/src/InputStorage/index.tsx +++ b/packages/react-components/src/InputStorage/index.tsx @@ -3,17 +3,17 @@ // TODO: We have a lot shared between this and InputExtrinsic -import type { QueryableStorageEntry } from '@polkadot/api/types'; -import type { DropdownOptions } from '../util/types'; - import React, { useCallback, useState } from 'react'; + +import type { QueryableStorageEntry } from '@polkadot/api/types'; import { useApi } from '@polkadot/react-hooks'; +import type { DropdownOptions } from '../util/types'; import LinkedWrapper from '../InputExtrinsic/LinkedWrapper'; -import SelectKey from './SelectKey'; -import SelectSection from './SelectSection'; import keyOptions from './options/key'; import sectionOptions from './options/section'; +import SelectKey from './SelectKey'; +import SelectSection from './SelectSection'; interface Props { className?: string; diff --git a/packages/react-components/src/InputStorage/options/key.tsx b/packages/react-components/src/InputStorage/options/key.tsx index f644e0779b..7c39e09052 100644 --- a/packages/react-components/src/InputStorage/options/key.tsx +++ b/packages/react-components/src/InputStorage/options/key.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { StorageEntry } from '@polkadot/types/primitive/types'; -import type { DropdownOptions, DropdownOption } from '../../util/types'; - import React from 'react'; + +import type { StorageEntry } from '@polkadot/types/primitive/types'; import { ApiPromise } from '@polkadot/api'; import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey'; +import type { DropdownOption, DropdownOptions } from '../../util/types'; + export default function createOptions (api: ApiPromise, sectionName: string): DropdownOptions { const section = api.query[sectionName]; diff --git a/packages/react-components/src/InputStorage/options/section.ts b/packages/react-components/src/InputStorage/options/section.ts index 338f43dfa5..b89c2726a1 100644 --- a/packages/react-components/src/InputStorage/options/section.ts +++ b/packages/react-components/src/InputStorage/options/section.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DropdownOptions } from '../../util/types'; - import { ApiPromise } from '@polkadot/api'; +import type { DropdownOptions } from '../../util/types'; + export default function createOptions (api: ApiPromise): DropdownOptions { return Object .keys(api.query) diff --git a/packages/react-components/src/InputWasm.tsx b/packages/react-components/src/InputWasm.tsx index 5aae467531..d2462f9835 100644 --- a/packages/react-components/src/InputWasm.tsx +++ b/packages/react-components/src/InputWasm.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React, { useCallback } from 'react'; + import { compactAddLength, isWasm } from '@polkadot/util'; import InputFile, { InputFileProps } from './InputFile'; diff --git a/packages/react-components/src/Inset.tsx b/packages/react-components/src/Inset.tsx index 91e0ccf401..1c38d53e81 100644 --- a/packages/react-components/src/Inset.tsx +++ b/packages/react-components/src/Inset.tsx @@ -4,6 +4,7 @@ import React, { useCallback } from 'react'; import { useHistory } from 'react-router-dom'; import styled from 'styled-components'; + import { useToggle } from '@polkadot/react-hooks'; import Icon from './Icon'; diff --git a/packages/react-components/src/LinkExternal.tsx b/packages/react-components/src/LinkExternal.tsx index 42c99ac191..09a550d5a4 100644 --- a/packages/react-components/src/LinkExternal.tsx +++ b/packages/react-components/src/LinkExternal.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { LinkTypes } from '@polkadot/apps-config/links/types'; - import BN from 'bn.js'; import React, { useMemo } from 'react'; import styled from 'styled-components'; + +import type { LinkTypes } from '@polkadot/apps-config/links/types'; import { externalLinks } from '@polkadot/apps-config'; import { useApi } from '@polkadot/react-hooks'; diff --git a/packages/react-components/src/LockedVote.tsx b/packages/react-components/src/LockedVote.tsx index 075a3cfb0a..6f431bbb27 100644 --- a/packages/react-components/src/LockedVote.tsx +++ b/packages/react-components/src/LockedVote.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; - import React from 'react'; + +import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; import { LockedVote } from '@polkadot/react-query'; export interface Props { diff --git a/packages/react-components/src/Menu.tsx b/packages/react-components/src/Menu.tsx index 08d1634c32..bb24d20c2d 100644 --- a/packages/react-components/src/Menu.tsx +++ b/packages/react-components/src/Menu.tsx @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import SUIDivider from 'semantic-ui-react/dist/commonjs/elements/Divider/Divider'; import SUIMenu from 'semantic-ui-react/dist/commonjs/collections/Menu/Menu'; +import SUIDivider from 'semantic-ui-react/dist/commonjs/elements/Divider/Divider'; type MenuDef = typeof SUIMenu & { Divider: typeof SUIDivider; diff --git a/packages/react-components/src/Modal/Actions.tsx b/packages/react-components/src/Modal/Actions.tsx index d033af6786..11565bc033 100644 --- a/packages/react-components/src/Modal/Actions.tsx +++ b/packages/react-components/src/Modal/Actions.tsx @@ -1,11 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ActionsProps } from './types'; - import React from 'react'; import SUIModal from 'semantic-ui-react/dist/commonjs/modules/Modal/Modal'; +import type { ActionsProps } from './types'; import Button from '../Button'; import ButtonCancel from '../ButtonCancel'; diff --git a/packages/react-components/src/Modal/Column.tsx b/packages/react-components/src/Modal/Column.tsx index 092a63f81b..f92ad769d4 100644 --- a/packages/react-components/src/Modal/Column.tsx +++ b/packages/react-components/src/Modal/Column.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ColumnProps } from './types'; - import React from 'react'; import styled from 'styled-components'; +import type { ColumnProps } from './types'; + function Column ({ children, className = '' }: ColumnProps): React.ReactElement { return (
{children}
diff --git a/packages/react-components/src/Modal/Columns.tsx b/packages/react-components/src/Modal/Columns.tsx index abd9b53377..f3fa4656f9 100644 --- a/packages/react-components/src/Modal/Columns.tsx +++ b/packages/react-components/src/Modal/Columns.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ColumnProps } from './types'; - import React from 'react'; import styled from 'styled-components'; +import type { ColumnProps } from './types'; + function Columns ({ children, className = '' }: ColumnProps): React.ReactElement { return (
{children}
diff --git a/packages/react-components/src/Modal/index.tsx b/packages/react-components/src/Modal/index.tsx index fd95311257..bf8b3284b6 100644 --- a/packages/react-components/src/Modal/index.tsx +++ b/packages/react-components/src/Modal/index.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeDef } from '@polkadot/react-components/types'; -import type { ActionsProps, ColumnProps, ModalProps } from './types'; - import React, { useContext } from 'react'; -import { ThemeContext } from 'styled-components'; import SUIModal from 'semantic-ui-react/dist/commonjs/modules/Modal/Modal'; +import { ThemeContext } from 'styled-components'; +import type { ThemeDef } from '@polkadot/react-components/types'; + +import type { ActionsProps, ColumnProps, ModalProps } from './types'; import Actions from './Actions'; import Column from './Column'; import Columns from './Columns'; diff --git a/packages/react-components/src/Nonce.tsx b/packages/react-components/src/Nonce.tsx index 8902758b11..a6d1cfbfc4 100644 --- a/packages/react-components/src/Nonce.tsx +++ b/packages/react-components/src/Nonce.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; - import React from 'react'; + +import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; import { Nonce } from '@polkadot/react-query'; export interface Props { diff --git a/packages/react-components/src/Params/Call.tsx b/packages/react-components/src/Params/Call.tsx index 5d19f3fa03..9ed96444cc 100644 --- a/packages/react-components/src/Params/Call.tsx +++ b/packages/react-components/src/Params/Call.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-extrinsics authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React from 'react'; + import type { SubmittableExtrinsicFunction } from '@polkadot/api/types'; import type { Props } from '@polkadot/react-params/types'; - -import React from 'react'; import { useApi } from '@polkadot/react-hooks'; import Extrinsic from './Extrinsic'; diff --git a/packages/react-components/src/Params/Extrinsic.tsx b/packages/react-components/src/Params/Extrinsic.tsx index e6d0ba208f..752e86dbd5 100644 --- a/packages/react-components/src/Params/Extrinsic.tsx +++ b/packages/react-components/src/Params/Extrinsic.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-extrinsics authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useCallback } from 'react'; + import type { SubmittableExtrinsic, SubmittableExtrinsicFunction } from '@polkadot/api/types'; import type { RawParamOnChange, RawParamOnEnter, RawParamOnEscape } from '@polkadot/react-params/types'; -import React, { useCallback } from 'react'; - import BaseExtrinsic from '../Extrinsic'; interface Props { diff --git a/packages/react-components/src/Params/OpaqueCall.tsx b/packages/react-components/src/Params/OpaqueCall.tsx index 6b40441bb0..90abc89407 100644 --- a/packages/react-components/src/Params/OpaqueCall.tsx +++ b/packages/react-components/src/Params/OpaqueCall.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-extrinsics authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useCallback } from 'react'; + import type { SubmittableExtrinsic } from '@polkadot/api/types'; import type { Props, RawParam } from '@polkadot/react-params/types'; - -import React, { useCallback } from 'react'; import { useApi } from '@polkadot/react-hooks'; import ExtrinsicDisplay from './Extrinsic'; diff --git a/packages/react-components/src/Params/Proposal.tsx b/packages/react-components/src/Params/Proposal.tsx index d869a85821..d0e9385a8e 100644 --- a/packages/react-components/src/Params/Proposal.tsx +++ b/packages/react-components/src/Params/Proposal.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-extrinsics authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Props, RawParam } from '@polkadot/react-params/types'; - import React, { useCallback } from 'react'; + +import type { Props, RawParam } from '@polkadot/react-params/types'; import { registry } from '@polkadot/react-api'; import { useApi } from '@polkadot/react-hooks'; diff --git a/packages/react-components/src/PasswordStrength.tsx b/packages/react-components/src/PasswordStrength.tsx index 63d5714efe..edbee3f359 100644 --- a/packages/react-components/src/PasswordStrength.tsx +++ b/packages/react-components/src/PasswordStrength.tsx @@ -1,12 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from './types'; - +import strengthTester from 'owasp-password-strength-test'; import React from 'react'; import styled from 'styled-components'; -import strengthTester from 'owasp-password-strength-test'; +import type { ThemeProps } from './types'; import { useTranslation } from './translate'; const MAX_STRENGTH = 7; // equal to number of password tests in owasp strength tester diff --git a/packages/react-components/src/Progress.tsx b/packages/react-components/src/Progress.tsx index ce4943441d..d24195c7e9 100644 --- a/packages/react-components/src/Progress.tsx +++ b/packages/react-components/src/Progress.tsx @@ -1,14 +1,15 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { UInt } from '@polkadot/types'; -import type { ThemeProps } from './types'; - import BN from 'bn.js'; import React from 'react'; import styled from 'styled-components'; + +import type { UInt } from '@polkadot/types'; import { bnToBn } from '@polkadot/util'; +import type { ThemeProps } from './types'; + interface Props { className?: string; isDisabled?: boolean; diff --git a/packages/react-components/src/ProposedAction.tsx b/packages/react-components/src/ProposedAction.tsx index afdf6d0a52..35ef465953 100644 --- a/packages/react-components/src/ProposedAction.tsx +++ b/packages/react-components/src/ProposedAction.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Proposal } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; import React from 'react'; import styled from 'styled-components'; + +import type { Proposal } from '@polkadot/types/interfaces'; import { formatNumber, isString } from '@polkadot/util'; import Call from './Call'; diff --git a/packages/react-components/src/Row.tsx b/packages/react-components/src/Row.tsx index d1da6b7548..a2a6821a59 100644 --- a/packages/react-components/src/Row.tsx +++ b/packages/react-components/src/Row.tsx @@ -3,6 +3,7 @@ import React from 'react'; import styled from 'styled-components'; + import { useToggle } from '@polkadot/react-hooks'; import EditButton from './EditButton'; diff --git a/packages/react-components/src/Sidebar.tsx b/packages/react-components/src/Sidebar.tsx index 689d43bbf0..152706eb6e 100644 --- a/packages/react-components/src/Sidebar.tsx +++ b/packages/react-components/src/Sidebar.tsx @@ -1,11 +1,10 @@ // Copyright 2017-2020 @polkadot/app-accounts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from './types'; - import React from 'react'; import styled from 'styled-components'; +import type { ThemeProps } from './types'; import Button from './Button'; interface Props { diff --git a/packages/react-components/src/Spinner.tsx b/packages/react-components/src/Spinner.tsx index 35c480afd7..387f959973 100644 --- a/packages/react-components/src/Spinner.tsx +++ b/packages/react-components/src/Spinner.tsx @@ -4,8 +4,8 @@ import React from 'react'; import styled from 'styled-components'; -import { useTranslation } from './translate'; import spinnerSrc from './Spinner.png'; +import { useTranslation } from './translate'; interface Props { className?: string; diff --git a/packages/react-components/src/StakingBonded.tsx b/packages/react-components/src/StakingBonded.tsx index 17b9acef87..152c8de647 100644 --- a/packages/react-components/src/StakingBonded.tsx +++ b/packages/react-components/src/StakingBonded.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveStakingAccount } from '@polkadot/api-derive/types'; - import React from 'react'; + +import type { DeriveStakingAccount } from '@polkadot/api-derive/types'; import { FormatBalance } from '@polkadot/react-query'; interface Props { diff --git a/packages/react-components/src/StakingRedeemable.tsx b/packages/react-components/src/StakingRedeemable.tsx index cfef8db747..adf2a1e245 100644 --- a/packages/react-components/src/StakingRedeemable.tsx +++ b/packages/react-components/src/StakingRedeemable.tsx @@ -1,16 +1,16 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React from 'react'; + import type { DeriveStakingAccount } from '@polkadot/api-derive/types'; import type { Option } from '@polkadot/types'; import type { SlashingSpans } from '@polkadot/types/interfaces'; - -import React from 'react'; import { useAccounts, useApi, useCall } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; -import TxButton from './TxButton'; import { useTranslation } from './translate'; +import TxButton from './TxButton'; interface Props { className?: string; diff --git a/packages/react-components/src/StakingUnbonding.tsx b/packages/react-components/src/StakingUnbonding.tsx index 7c365a150e..c716ae5c16 100644 --- a/packages/react-components/src/StakingUnbonding.tsx +++ b/packages/react-components/src/StakingUnbonding.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveSessionProgress, DeriveStakingAccount, DeriveUnlocking } from '@polkadot/api-derive/types'; - import BN from 'bn.js'; import React, { useMemo } from 'react'; import styled from 'styled-components'; + +import type { DeriveSessionProgress, DeriveStakingAccount, DeriveUnlocking } from '@polkadot/api-derive/types'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BlockToTime, FormatBalance } from '@polkadot/react-query'; import { BN_ONE, BN_ZERO, formatBalance, formatNumber } from '@polkadot/util'; diff --git a/packages/react-components/src/Status/Context.ts b/packages/react-components/src/Status/Context.ts index f5da1accf0..e484eb1961 100644 --- a/packages/react-components/src/Status/Context.ts +++ b/packages/react-components/src/Status/Context.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { QueueProps, QueueStatus, QueueTx } from './types'; - import React from 'react'; +import type { QueueProps, QueueStatus, QueueTx } from './types'; + const defaultState: Partial = { stqueue: [] as QueueStatus[], txqueue: [] as QueueTx[] diff --git a/packages/react-components/src/Status/Queue.tsx b/packages/react-components/src/Status/Queue.tsx index 82666b0b09..43f3f2eebf 100644 --- a/packages/react-components/src/Status/Queue.tsx +++ b/packages/react-components/src/Status/Queue.tsx @@ -1,20 +1,20 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useCallback, useRef, useState } from 'react'; + import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; import type { Bytes } from '@polkadot/types'; import type { DispatchError } from '@polkadot/types/interfaces'; import type { ITuple, SignerPayloadJSON } from '@polkadot/types/types'; -import type { ActionStatus, ActionStatusPartial, PartialQueueTxExtrinsic, PartialQueueTxRpc, QueueStatus, QueueTx, QueueTxExtrinsic, QueueTxRpc, QueueTxStatus, SignerCallback } from './types'; - -import React, { useCallback, useRef, useState } from 'react'; import { SubmittableResult } from '@polkadot/api'; import { registry } from '@polkadot/react-api'; import jsonrpc from '@polkadot/types/interfaces/jsonrpc'; +import type { ActionStatus, ActionStatusPartial, PartialQueueTxExtrinsic, PartialQueueTxRpc, QueueStatus, QueueTx, QueueTxExtrinsic, QueueTxRpc, QueueTxStatus, SignerCallback } from './types'; import { getContractAbi } from '../util'; -import { QueueProvider } from './Context'; import { STATUS_COMPLETE } from './constants'; +import { QueueProvider } from './Context'; export interface Props { children: React.ReactNode; diff --git a/packages/react-components/src/Status/index.tsx b/packages/react-components/src/Status/index.tsx index a31e73d9d7..4a543097ce 100644 --- a/packages/react-components/src/Status/index.tsx +++ b/packages/react-components/src/Status/index.tsx @@ -1,19 +1,18 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { QueueStatus, QueueTx, QueueTxStatus } from './types'; - +import type { IconName } from '@fortawesome/fontawesome-svg-core'; import React, { useCallback, useContext, useEffect, useState } from 'react'; import styled from 'styled-components'; -import type { IconName } from '@fortawesome/fontawesome-svg-core'; +import type { QueueStatus, QueueTx, QueueTxStatus } from './types'; import AddressMini from '../AddressMini'; import Button from '../Button'; import Icon from '../Icon'; import Spinner from '../Spinner'; import { useTranslation } from '../translate'; -import StatusContext from './Context'; import { STATUS_COMPLETE } from './constants'; +import StatusContext from './Context'; export { StatusContext }; diff --git a/packages/react-components/src/Table/Body.tsx b/packages/react-components/src/Table/Body.tsx index 0212100a8d..5e15ab74d5 100644 --- a/packages/react-components/src/Table/Body.tsx +++ b/packages/react-components/src/Table/Body.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from '../types'; - import React from 'react'; import styled from 'styled-components'; + import { isString } from '@polkadot/util'; +import type { ThemeProps } from '../types'; import Spinner from '../Spinner'; interface Props { diff --git a/packages/react-components/src/Table/Foot.tsx b/packages/react-components/src/Table/Foot.tsx index 0aee8fcb34..2902014632 100644 --- a/packages/react-components/src/Table/Foot.tsx +++ b/packages/react-components/src/Table/Foot.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from '../types'; - import React from 'react'; import styled from 'styled-components'; +import type { ThemeProps } from '../types'; + interface Props { className?: string; footer?: React.ReactNode; diff --git a/packages/react-components/src/Table/Head.tsx b/packages/react-components/src/Table/Head.tsx index 3c2bfae7bf..06bd1166f3 100644 --- a/packages/react-components/src/Table/Head.tsx +++ b/packages/react-components/src/Table/Head.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from '../types'; - import React from 'react'; import styled from 'styled-components'; +import type { ThemeProps } from '../types'; + type HeaderDef = [React.ReactNode?, string?, number?, (() => void)?]; interface Props { diff --git a/packages/react-components/src/Tabs/Tab.tsx b/packages/react-components/src/Tabs/Tab.tsx index eb77e07543..5df0784bb4 100644 --- a/packages/react-components/src/Tabs/Tab.tsx +++ b/packages/react-components/src/Tabs/Tab.tsx @@ -1,13 +1,12 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from '../types'; -import type { TabItem } from './types'; - import React from 'react'; import { NavLink } from 'react-router-dom'; import styled from 'styled-components'; +import type { ThemeProps } from '../types'; +import type { TabItem } from './types'; import Badge from '../Badge'; import Icon from '../Icon'; diff --git a/packages/react-components/src/Tabs/index.tsx b/packages/react-components/src/Tabs/index.tsx index 0e05c8ca31..982c15fbdf 100644 --- a/packages/react-components/src/Tabs/index.tsx +++ b/packages/react-components/src/Tabs/index.tsx @@ -1,13 +1,12 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from '../types'; -import type { TabItem } from './types'; - import React, { useEffect } from 'react'; import { useLocation } from 'react-router-dom'; import styled from 'styled-components'; +import type { ThemeProps } from '../types'; +import type { TabItem } from './types'; import Tab from './Tab'; interface Props { diff --git a/packages/react-components/src/Tags.tsx b/packages/react-components/src/Tags.tsx index 38a46993b6..70d973a42f 100644 --- a/packages/react-components/src/Tags.tsx +++ b/packages/react-components/src/Tags.tsx @@ -1,15 +1,13 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { VoidFn } from './types'; - import React, { useCallback, useMemo } from 'react'; import styled from 'styled-components'; +import type { VoidFn } from './types'; import EditButton from './EditButton'; import InputTags from './InputTags'; import Tag from './Tag'; - import { useTranslation } from './translate'; interface Props { diff --git a/packages/react-components/src/TextArea.tsx b/packages/react-components/src/TextArea.tsx index 049175a80a..3918d0a5e7 100644 --- a/packages/react-components/src/TextArea.tsx +++ b/packages/react-components/src/TextArea.tsx @@ -1,11 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from './types'; - import React, { useCallback } from 'react'; import styled from 'styled-components'; +import type { ThemeProps } from './types'; import Labelled from './Labelled'; interface Props { diff --git a/packages/react-components/src/Toggle.tsx b/packages/react-components/src/Toggle.tsx index 3dc3edc372..bbc437a3bc 100644 --- a/packages/react-components/src/Toggle.tsx +++ b/packages/react-components/src/Toggle.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from './types'; - import React, { useCallback } from 'react'; import styled from 'styled-components'; +import type { ThemeProps } from './types'; + interface Props { className?: string; isDisabled?: boolean; diff --git a/packages/react-components/src/ToggleGroup.tsx b/packages/react-components/src/ToggleGroup.tsx index df4abfd315..1476f36d60 100644 --- a/packages/react-components/src/ToggleGroup.tsx +++ b/packages/react-components/src/ToggleGroup.tsx @@ -3,6 +3,7 @@ import React, { useCallback } from 'react'; import styled from 'styled-components'; + import { Button } from '@polkadot/react-components'; interface Props { diff --git a/packages/react-components/src/TreasuryProposal.tsx b/packages/react-components/src/TreasuryProposal.tsx index 2946b80988..2bd33c1bc4 100644 --- a/packages/react-components/src/TreasuryProposal.tsx +++ b/packages/react-components/src/TreasuryProposal.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useEffect, useState } from 'react'; + import type { Option } from '@polkadot/types'; import type { TreasuryProposal as TreasuryProposalType } from '@polkadot/types/interfaces'; - -import React, { useEffect, useState } from 'react'; import { InputAddress, Labelled, Static } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; diff --git a/packages/react-components/src/TxButton.tsx b/packages/react-components/src/TxButton.tsx index eb4eddef88..109a8723ac 100644 --- a/packages/react-components/src/TxButton.tsx +++ b/packages/react-components/src/TxButton.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SubmittableExtrinsic } from '@polkadot/api/types'; -import type { TxButtonProps as Props } from './types'; - import React, { useCallback, useContext, useEffect, useState } from 'react'; + +import type { SubmittableExtrinsic } from '@polkadot/api/types'; import { SubmittableResult } from '@polkadot/api'; import { useApi, useIsMountedRef } from '@polkadot/react-hooks'; import { assert, isFunction } from '@polkadot/util'; +import type { TxButtonProps as Props } from './types'; import Button from './Button'; import { StatusContext } from './Status'; import { useTranslation } from './translate'; diff --git a/packages/react-components/src/TxModal.tsx b/packages/react-components/src/TxModal.tsx index eab28b5218..bbfc91435d 100644 --- a/packages/react-components/src/TxModal.tsx +++ b/packages/react-components/src/TxModal.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { I18nProps } from '@polkadot/react-components/types'; - import React from 'react'; + +import type { I18nProps } from '@polkadot/react-components/types'; import { InputAddress, Modal, TxButton, TxComponent } from '@polkadot/react-components'; export interface TxModalProps extends I18nProps { diff --git a/packages/react-components/src/TxModalNew.tsx b/packages/react-components/src/TxModalNew.tsx index 8739de43b2..57c2d8656b 100644 --- a/packages/react-components/src/TxModalNew.tsx +++ b/packages/react-components/src/TxModalNew.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/app-contracts authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { TxModalProps as Props } from './types'; +import React, { useEffect, useState } from 'react'; -import React, { useState, useEffect } from 'react'; import { Button, InputAddress, Modal } from '@polkadot/react-components'; // import { useTx } from '@polkadot/react-hooks'; import { isUndefined } from '@polkadot/util'; +import type { TxModalProps as Props } from './types'; import translate from './translate'; function TxModal

({ diff --git a/packages/react-components/src/VoteValue.tsx b/packages/react-components/src/VoteValue.tsx index 8222a29cdb..a0223be26e 100644 --- a/packages/react-components/src/VoteValue.tsx +++ b/packages/react-components/src/VoteValue.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; - import BN from 'bn.js'; import React, { useCallback, useEffect, useState } from 'react'; + +import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; import { useApi, useCall } from '@polkadot/react-hooks'; import { BalanceVoting } from '@polkadot/react-query'; import { BN_ZERO } from '@polkadot/util'; diff --git a/packages/react-components/src/i18n/index.ts b/packages/react-components/src/i18n/index.ts index 79082cf76e..0dbc4d1af0 100644 --- a/packages/react-components/src/i18n/index.ts +++ b/packages/react-components/src/i18n/index.ts @@ -4,6 +4,7 @@ import i18next from 'i18next'; import LanguageDetector from 'i18next-browser-languagedetector'; import { initReactI18next } from 'react-i18next'; + import uiSettings, { LANGUAGE_DEFAULT } from '@polkadot/ui-settings'; import Backend from './Backend'; diff --git a/packages/react-components/src/styles/index.ts b/packages/react-components/src/styles/index.ts index 9b7828ca21..624697abfc 100644 --- a/packages/react-components/src/styles/index.ts +++ b/packages/react-components/src/styles/index.ts @@ -1,10 +1,9 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from '../types'; - import { createGlobalStyle } from 'styled-components'; +import type { ThemeProps } from '../types'; import cssComponents from './components'; import cssForm from './form'; import cssMedia from './media'; diff --git a/packages/react-components/src/types.ts b/packages/react-components/src/types.ts index 2cf3e6958e..88892d17a4 100644 --- a/packages/react-components/src/types.ts +++ b/packages/react-components/src/types.ts @@ -1,13 +1,15 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { WithTranslation } from 'react-i18next'; import type { IconName } from '@fortawesome/fontawesome-svg-core'; -import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; +import type { WithTranslation } from 'react-i18next'; + import type { Abi } from '@polkadot/api-contract'; +import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; import type { ActionStatus } from '@polkadot/react-components/Status/types'; import type { TxState } from '@polkadot/react-hooks/types'; import type { AccountId, Index } from '@polkadot/types/interfaces'; + import type { ButtonProps } from './Button/types'; import type { InputAddressProps } from './InputAddress/types'; import type { TxCallback, TxFailedCallback } from './Status/types'; diff --git a/packages/react-components/src/util/checkVisibility.tsx b/packages/react-components/src/util/checkVisibility.tsx index 372e9a8f7c..9563ef0cd9 100644 --- a/packages/react-components/src/util/checkVisibility.tsx +++ b/packages/react-components/src/util/checkVisibility.tsx @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import type { DeriveAccountInfo } from '@polkadot/api-derive/types'; - import { ApiPromise } from '@polkadot/api'; import keyring from '@polkadot/ui-keyring'; diff --git a/packages/react-components/src/util/getAddressMeta.ts b/packages/react-components/src/util/getAddressMeta.ts index 80eccc7bf1..27f7321f1b 100644 --- a/packages/react-components/src/util/getAddressMeta.ts +++ b/packages/react-components/src/util/getAddressMeta.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import type { KeyringItemType, KeyringJson$Meta } from '@polkadot/ui-keyring/types'; - import keyring from '@polkadot/ui-keyring'; export default function getAddressMeta (address: string, type: KeyringItemType | null = null): KeyringJson$Meta { diff --git a/packages/react-components/src/util/getContractAbi.ts b/packages/react-components/src/util/getContractAbi.ts index 9ceff10e82..9dab03dfb2 100644 --- a/packages/react-components/src/util/getContractAbi.ts +++ b/packages/react-components/src/util/getContractAbi.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import type { AnyJson } from '@polkadot/types/types'; - import { Abi } from '@polkadot/api-contract'; import { api } from '@polkadot/react-api'; diff --git a/packages/react-components/src/util/toAddress.ts b/packages/react-components/src/util/toAddress.ts index 1a708ebdd6..a0ac0ced51 100644 --- a/packages/react-components/src/util/toAddress.ts +++ b/packages/react-components/src/util/toAddress.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import keyring from '@polkadot/ui-keyring'; -import { hexToU8a, isHex, assert } from '@polkadot/util'; +import { assert, hexToU8a, isHex } from '@polkadot/util'; import { ethereumEncode } from '@polkadot/util-crypto'; export default function toAddress (value?: string | Uint8Array | null, allowIndices = false): string | undefined { diff --git a/packages/react-hooks/src/types.ts b/packages/react-hooks/src/types.ts index 2ea334294f..5c97601761 100644 --- a/packages/react-hooks/src/types.ts +++ b/packages/react-hooks/src/types.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; import type { DeriveAccountFlags, DeriveAccountRegistration } from '@polkadot/api-derive/types'; +import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; import type { ConstructTxFn, StringOrNull, VoidFn } from '@polkadot/react-components/types'; import type { AccountId, Balance, BlockNumber, Call, Exposure, Hash, RewardDestination, SessionIndex, StakingLedger, ValidatorPrefs } from '@polkadot/types/interfaces'; import type { IExtrinsic } from '@polkadot/types/types'; diff --git a/packages/react-hooks/src/useAccountId.ts b/packages/react-hooks/src/useAccountId.ts index b3708cb9c4..ec3b9c8dd6 100644 --- a/packages/react-hooks/src/useAccountId.ts +++ b/packages/react-hooks/src/useAccountId.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { StringOrNull } from '@polkadot/react-components/types'; - import { useCallback, useState } from 'react'; +import type { StringOrNull } from '@polkadot/react-components/types'; + export function useAccountId (initialValue: StringOrNull = null, onChangeAccountId?: (_: StringOrNull) => void): [StringOrNull, (_: StringOrNull) => void] { const [accountId, setAccountId] = useState(initialValue); diff --git a/packages/react-hooks/src/useAccountInfo.ts b/packages/react-hooks/src/useAccountInfo.ts index ef77718963..3d5b56b407 100644 --- a/packages/react-hooks/src/useAccountInfo.ts +++ b/packages/react-hooks/src/useAccountInfo.ts @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 +import { useCallback, useEffect, useState } from 'react'; + import type { DeriveAccountFlags, DeriveAccountInfo } from '@polkadot/api-derive/types'; import type { StringOrNull } from '@polkadot/react-components/types'; import type { KeyringJson$Meta } from '@polkadot/ui-keyring/types'; -import type { AddressFlags, AddressIdentity, UseAccountInfo } from './types'; - -import { useCallback, useEffect, useState } from 'react'; import keyring from '@polkadot/ui-keyring'; +import type { AddressFlags, AddressIdentity, UseAccountInfo } from './types'; import { useAccounts } from './useAccounts'; import { useAddresses } from './useAddresses'; import { useApi } from './useApi'; diff --git a/packages/react-hooks/src/useAccounts.ts b/packages/react-hooks/src/useAccounts.ts index eea08cabe8..9a7adf10ae 100644 --- a/packages/react-hooks/src/useAccounts.ts +++ b/packages/react-hooks/src/useAccounts.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { useEffect, useState } from 'react'; + import keyring from '@polkadot/ui-keyring'; import { useIsMountedRef } from './useIsMountedRef'; diff --git a/packages/react-hooks/src/useAddresses.ts b/packages/react-hooks/src/useAddresses.ts index 07a7139d59..8d4e343b0c 100644 --- a/packages/react-hooks/src/useAddresses.ts +++ b/packages/react-hooks/src/useAddresses.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { useEffect, useState } from 'react'; + import keyring from '@polkadot/ui-keyring'; import { useIsMountedRef } from './useIsMountedRef'; diff --git a/packages/react-hooks/src/useApi.ts b/packages/react-hooks/src/useApi.ts index f42afb9cca..a6d8cbae88 100644 --- a/packages/react-hooks/src/useApi.ts +++ b/packages/react-hooks/src/useApi.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ApiProps } from '@polkadot/react-api/types'; - import { useContext } from 'react'; + +import type { ApiProps } from '@polkadot/react-api/types'; import { ApiContext } from '@polkadot/react-api'; export function useApi (): ApiProps { diff --git a/packages/react-hooks/src/useAvailableSlashes.ts b/packages/react-hooks/src/useAvailableSlashes.ts index 24434183fb..7e539f2c38 100644 --- a/packages/react-hooks/src/useAvailableSlashes.ts +++ b/packages/react-hooks/src/useAvailableSlashes.ts @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/app-council authors & contributors // SPDX-License-Identifier: Apache-2.0 +import BN from 'bn.js'; +import { useEffect, useState } from 'react'; + import type { DeriveSessionIndexes } from '@polkadot/api-derive/types'; import type { Option, Vec } from '@polkadot/types'; import type { EraIndex, UnappliedSlash } from '@polkadot/types/interfaces'; - -import BN from 'bn.js'; -import { useEffect, useState } from 'react'; import { useApi, useCall, useIsMountedRef } from '@polkadot/react-hooks'; type Unsub = () => void; diff --git a/packages/react-hooks/src/useBlockTime.ts b/packages/react-hooks/src/useBlockTime.ts index e0f88ddc9d..c19577e890 100644 --- a/packages/react-hooks/src/useBlockTime.ts +++ b/packages/react-hooks/src/useBlockTime.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Time } from '@polkadot/util/types'; - import BN from 'bn.js'; import { useMemo } from 'react'; + +import type { Time } from '@polkadot/util/types'; import { useApi } from '@polkadot/react-hooks'; import { BN_ONE, extractTime } from '@polkadot/util'; diff --git a/packages/react-hooks/src/useBlocksPerDays.ts b/packages/react-hooks/src/useBlocksPerDays.ts index 566c8e8009..886af0366a 100644 --- a/packages/react-hooks/src/useBlocksPerDays.ts +++ b/packages/react-hooks/src/useBlocksPerDays.ts @@ -3,6 +3,7 @@ import BN from 'bn.js'; import { useMemo } from 'react'; + import { useApi } from '@polkadot/react-hooks'; const DEFAULT_TIME = new BN(6000); diff --git a/packages/react-hooks/src/useCacheKey.ts b/packages/react-hooks/src/useCacheKey.ts index 6c790dd561..4b76ff224f 100644 --- a/packages/react-hooks/src/useCacheKey.ts +++ b/packages/react-hooks/src/useCacheKey.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import { useCallback, useMemo } from 'react'; - import store from 'store'; + import { useApi } from './useApi'; // create a chain-specific key for the local cache diff --git a/packages/react-hooks/src/useCall.ts b/packages/react-hooks/src/useCall.ts index 9e9e098a29..585d382b85 100644 --- a/packages/react-hooks/src/useCall.ts +++ b/packages/react-hooks/src/useCall.ts @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Codec } from '@polkadot/types/types'; -// eslint-disable-next-line @typescript-eslint/no-unused-vars -import type { CallOptions, CallParam, CallParams } from './types'; - import { useEffect, useRef, useState } from 'react'; + +import type { Codec } from '@polkadot/types/types'; import { isNull, isUndefined } from '@polkadot/util'; -import { useIsMountedRef, MountedRef } from './useIsMountedRef'; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +import type { CallOptions, CallParam, CallParams } from './types'; +import { MountedRef, useIsMountedRef } from './useIsMountedRef'; type VoidFn = () => void; diff --git a/packages/react-hooks/src/useContracts.ts b/packages/react-hooks/src/useContracts.ts index 99a3a7c2ce..f7279d8886 100644 --- a/packages/react-hooks/src/useContracts.ts +++ b/packages/react-hooks/src/useContracts.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { useEffect, useState } from 'react'; + import keyring from '@polkadot/ui-keyring'; import { useIsMountedRef } from './useIsMountedRef'; diff --git a/packages/react-hooks/src/useDebounce.ts b/packages/react-hooks/src/useDebounce.ts index 635078b4d2..c2056b18cf 100644 --- a/packages/react-hooks/src/useDebounce.ts +++ b/packages/react-hooks/src/useDebounce.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { useState, useEffect } from 'react'; +import { useEffect, useState } from 'react'; import { useIsMountedRef } from './useIsMountedRef'; diff --git a/packages/react-hooks/src/useFormField.ts b/packages/react-hooks/src/useFormField.ts index 397c311e81..0df93bb3c0 100644 --- a/packages/react-hooks/src/useFormField.ts +++ b/packages/react-hooks/src/useFormField.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { useMemo, useState } from 'react'; + import { isUndefined } from '@polkadot/util'; export type FormField = [ diff --git a/packages/react-hooks/src/useIncrement.ts b/packages/react-hooks/src/useIncrement.ts index 07b319a01d..81da7282bc 100644 --- a/packages/react-hooks/src/useIncrement.ts +++ b/packages/react-hooks/src/useIncrement.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { useCallback, useState } from 'react'; + import { useIsMountedRef } from './useIsMountedRef'; export function useIncrement (defaultValue = 1): [number, () => void, (value: number) => void] { diff --git a/packages/react-hooks/src/useInflation.ts b/packages/react-hooks/src/useInflation.ts index ee508ba034..4ca9d21ffc 100644 --- a/packages/react-hooks/src/useInflation.ts +++ b/packages/react-hooks/src/useInflation.ts @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ApiPromise } from '@polkadot/api'; -import type { Inflation } from './types'; - import BN from 'bn.js'; import { useEffect, useState } from 'react'; + +import type { ApiPromise } from '@polkadot/api'; import { getInflationParams } from '@polkadot/apps-config'; +import type { Inflation } from './types'; import { useApi } from './useApi'; import { useCall } from './useCall'; diff --git a/packages/react-hooks/src/useLoadingDelay.ts b/packages/react-hooks/src/useLoadingDelay.ts index ca21e8e087..5953d28963 100644 --- a/packages/react-hooks/src/useLoadingDelay.ts +++ b/packages/react-hooks/src/useLoadingDelay.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { useEffect, useState } from 'react'; + import { useIsMountedRef } from './useIsMountedRef'; export function useLoadingDelay (delay = 100): boolean { diff --git a/packages/react-hooks/src/useMembers.ts b/packages/react-hooks/src/useMembers.ts index 138888b6f5..4248583622 100644 --- a/packages/react-hooks/src/useMembers.ts +++ b/packages/react-hooks/src/useMembers.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AccountId } from '@polkadot/types/interfaces'; - import { useMemo } from 'react'; + +import type { AccountId } from '@polkadot/types/interfaces'; import { useAccounts, useApi, useCall } from '@polkadot/react-hooks'; interface Result { diff --git a/packages/react-hooks/src/useModal.ts b/packages/react-hooks/src/useModal.ts index d6d91cb3ef..64244b52db 100644 --- a/packages/react-hooks/src/useModal.ts +++ b/packages/react-hooks/src/useModal.ts @@ -1,10 +1,9 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ModalState } from './types'; - import { useCallback } from 'react'; +import type { ModalState } from './types'; import { useToggle } from './useToggle'; export function useModal (defaultIsOpen?: boolean, onOpen?: () => void, onClose?: () => void): ModalState { diff --git a/packages/react-hooks/src/useNonEmptyString.ts b/packages/react-hooks/src/useNonEmptyString.ts index d8a1609d9b..959f7f0491 100644 --- a/packages/react-hooks/src/useNonEmptyString.ts +++ b/packages/react-hooks/src/useNonEmptyString.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { useFormField, FormField } from './useFormField'; +import { FormField, useFormField } from './useFormField'; export function useNonEmptyString (initialValue = ''): FormField { return useFormField( diff --git a/packages/react-hooks/src/useNonZeroBn.ts b/packages/react-hooks/src/useNonZeroBn.ts index a792096fb2..40f8b25597 100644 --- a/packages/react-hooks/src/useNonZeroBn.ts +++ b/packages/react-hooks/src/useNonZeroBn.ts @@ -2,9 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import BN from 'bn.js'; -import { useFormField, FormField } from './useFormField'; + import { BN_ZERO } from '@polkadot/util'; +import { FormField, useFormField } from './useFormField'; + export function useNonZeroBn (initialValue: BN = BN_ZERO): FormField { return useFormField( initialValue, diff --git a/packages/react-hooks/src/useOwnEraRewards.ts b/packages/react-hooks/src/useOwnEraRewards.ts index 367e081944..1094e6ff27 100644 --- a/packages/react-hooks/src/useOwnEraRewards.ts +++ b/packages/react-hooks/src/useOwnEraRewards.ts @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 +import { useEffect, useState } from 'react'; + import type { DeriveEraPoints, DeriveEraRewards, DeriveStakerReward } from '@polkadot/api-derive/types'; import type { EraIndex } from '@polkadot/types/interfaces'; -import type { StakerState } from './types'; - -import { useEffect, useState } from 'react'; import { registry } from '@polkadot/react-api'; import { BN_ZERO } from '@polkadot/util'; +import type { StakerState } from './types'; import { useApi } from './useApi'; import { useCall } from './useCall'; import { useIsMountedRef } from './useIsMountedRef'; diff --git a/packages/react-hooks/src/useOwnStashInfos.ts b/packages/react-hooks/src/useOwnStashInfos.ts index c3cfbd6c44..7f3b8775be 100644 --- a/packages/react-hooks/src/useOwnStashInfos.ts +++ b/packages/react-hooks/src/useOwnStashInfos.ts @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 +import { useEffect, useMemo, useState } from 'react'; + import type { DeriveStakingAccount } from '@polkadot/api-derive/types'; import type { AccountId, ValidatorPrefs } from '@polkadot/types/interfaces'; import type { Codec, ITuple } from '@polkadot/types/types'; -import type { StakerState } from './types'; - -import { useEffect, useMemo, useState } from 'react'; import { u8aConcat, u8aToHex } from '@polkadot/util'; +import type { StakerState } from './types'; import { useAccounts } from './useAccounts'; import { useApi } from './useApi'; import { useIsMountedRef } from './useIsMountedRef'; diff --git a/packages/react-hooks/src/useOwnStashes.ts b/packages/react-hooks/src/useOwnStashes.ts index 6d92d3b5eb..9b110b78f8 100644 --- a/packages/react-hooks/src/useOwnStashes.ts +++ b/packages/react-hooks/src/useOwnStashes.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 +import { useMemo } from 'react'; + import type { Option } from '@polkadot/types'; import type { AccountId, StakingLedger } from '@polkadot/types/interfaces'; -import { useMemo } from 'react'; - import { useAccounts } from './useAccounts'; import { useApi } from './useApi'; import { useCall } from './useCall'; diff --git a/packages/react-hooks/src/usePassword.ts b/packages/react-hooks/src/usePassword.ts index e1d74cbf9c..ab525db13f 100644 --- a/packages/react-hooks/src/usePassword.ts +++ b/packages/react-hooks/src/usePassword.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { useEffect, useState } from 'react'; + import keyring from '@polkadot/ui-keyring'; interface PasswordProps { diff --git a/packages/react-hooks/src/useRegistrars.ts b/packages/react-hooks/src/useRegistrars.ts index b2d96e13e9..eb8ec39a36 100644 --- a/packages/react-hooks/src/useRegistrars.ts +++ b/packages/react-hooks/src/useRegistrars.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 +import { useMemo } from 'react'; + import type { Option } from '@polkadot/types'; import type { RegistrarInfo } from '@polkadot/types/interfaces'; -import { useMemo } from 'react'; - import { useAccounts } from './useAccounts'; import { useApi } from './useApi'; import { useCall } from './useCall'; diff --git a/packages/react-hooks/src/useSudo.ts b/packages/react-hooks/src/useSudo.ts index e23bab90ae..42d511ea86 100644 --- a/packages/react-hooks/src/useSudo.ts +++ b/packages/react-hooks/src/useSudo.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AccountId } from '@polkadot/types/interfaces'; -import type { UseSudo } from './types'; - import { useEffect, useState } from 'react'; +import type { AccountId } from '@polkadot/types/interfaces'; + +import type { UseSudo } from './types'; import { useAccounts } from './useAccounts'; import { useApi } from './useApi'; import { useCall } from './useCall'; diff --git a/packages/react-hooks/src/useVotingStatus.ts b/packages/react-hooks/src/useVotingStatus.ts index 4962026aba..9303122ef0 100644 --- a/packages/react-hooks/src/useVotingStatus.ts +++ b/packages/react-hooks/src/useVotingStatus.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { BlockNumber, Votes } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; import { useMemo } from 'react'; + +import type { BlockNumber, Votes } from '@polkadot/types/interfaces'; import { ApiPromise } from '@polkadot/api'; import { isFunction } from '@polkadot/util'; diff --git a/packages/react-hooks/src/useWeight.ts b/packages/react-hooks/src/useWeight.ts index f97c82ec63..5472de3760 100644 --- a/packages/react-hooks/src/useWeight.ts +++ b/packages/react-hooks/src/useWeight.ts @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-hooks authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Call } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; import { useEffect, useState } from 'react'; + +import type { Call } from '@polkadot/types/interfaces'; import { BN_ZERO } from '@polkadot/util'; import { useApi } from './useApi'; diff --git a/packages/react-params/src/Holder.tsx b/packages/react-params/src/Holder.tsx index ccdc9df92a..290aea16ff 100644 --- a/packages/react-params/src/Holder.tsx +++ b/packages/react-params/src/Holder.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from '@polkadot/react-components/types'; - import React from 'react'; import styled from 'styled-components'; +import type { ThemeProps } from '@polkadot/react-components/types'; + interface Props { children?: React.ReactNode; className?: string; diff --git a/packages/react-params/src/Param/Account.tsx b/packages/react-params/src/Param/Account.tsx index 49041087eb..7272518aa8 100644 --- a/packages/react-params/src/Param/Account.tsx +++ b/packages/react-params/src/Param/Account.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Props } from '../types'; - import React, { useCallback, useState } from 'react'; + import { InputAddress } from '@polkadot/react-components'; import keyring from '@polkadot/ui-keyring'; +import type { Props } from '../types'; import Bare from './Bare'; function Account ({ className = '', defaultValue: { value }, isDisabled, isError, isInOption, label, onChange, withLabel }: Props): React.ReactElement { diff --git a/packages/react-params/src/Param/Amount.tsx b/packages/react-params/src/Param/Amount.tsx index 703b7515d7..40001a3c20 100644 --- a/packages/react-params/src/Param/Amount.tsx +++ b/packages/react-params/src/Param/Amount.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Props } from '../types'; - import BN from 'bn.js'; import React, { useCallback, useMemo } from 'react'; + import { Input, InputNumber } from '@polkadot/react-components'; import { ClassOf } from '@polkadot/types/create'; import { bnToBn, formatNumber, isUndefined } from '@polkadot/util'; +import type { Props } from '../types'; import Bare from './Bare'; function Amount ({ className = '', defaultValue: { value }, isDisabled, isError, label, onChange, onEnter, registry, type, withLabel }: Props): React.ReactElement { diff --git a/packages/react-params/src/Param/Balance.tsx b/packages/react-params/src/Param/Balance.tsx index 6c1011f78c..db23d11383 100644 --- a/packages/react-params/src/Param/Balance.tsx +++ b/packages/react-params/src/Param/Balance.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Props } from '../types'; - import BN from 'bn.js'; import React, { useCallback, useState } from 'react'; + import { InputBalance } from '@polkadot/react-components'; +import type { Props } from '../types'; import Bare from './Bare'; function Balance ({ className = '', defaultValue: { value }, isDisabled, isError, label, onChange, onEnter, onEscape, withLabel }: Props): React.ReactElement { diff --git a/packages/react-params/src/Param/Base.tsx b/packages/react-params/src/Param/Base.tsx index ce3469a63b..6acd01e1f2 100644 --- a/packages/react-params/src/Param/Base.tsx +++ b/packages/react-params/src/Param/Base.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Size } from '../types'; - import React from 'react'; + import { Labelled } from '@polkadot/react-components'; +import type { Size } from '../types'; import Bare from './Bare'; interface Props { diff --git a/packages/react-params/src/Param/BaseBytes.tsx b/packages/react-params/src/Param/BaseBytes.tsx index 7ce06c383d..0bf71749dc 100644 --- a/packages/react-params/src/Param/BaseBytes.tsx +++ b/packages/react-params/src/Param/BaseBytes.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { TypeDef } from '@polkadot/types/types'; -import type { RawParam, RawParamOnChange, RawParamOnEnter, RawParamOnEscape, Size } from '../types'; - import React, { useCallback, useState } from 'react'; + +import type { TypeDef } from '@polkadot/types/types'; import { CopyButton, Input } from '@polkadot/react-components'; import { compactAddLength, hexToU8a, isAscii, isHex, isU8a, stringToU8a, u8aToHex, u8aToString } from '@polkadot/util'; import { decodeAddress } from '@polkadot/util-crypto'; +import type { RawParam, RawParamOnChange, RawParamOnEnter, RawParamOnEscape, Size } from '../types'; import { useTranslation } from '../translate'; import Bare from './Bare'; diff --git a/packages/react-params/src/Param/Bool.tsx b/packages/react-params/src/Param/Bool.tsx index eb863e598e..543c7b098a 100644 --- a/packages/react-params/src/Param/Bool.tsx +++ b/packages/react-params/src/Param/Bool.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Props } from '../types'; - import React, { useCallback, useMemo, useState } from 'react'; + import { Dropdown } from '@polkadot/react-components'; +import type { Props } from '../types'; import { useTranslation } from '../translate'; import Bare from './Bare'; diff --git a/packages/react-params/src/Param/Bytes.tsx b/packages/react-params/src/Param/Bytes.tsx index e6f2309c6d..0644af2ff8 100644 --- a/packages/react-params/src/Param/Bytes.tsx +++ b/packages/react-params/src/Param/Bytes.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Props } from '../types'; - import React, { useCallback, useState } from 'react'; import styled from 'styled-components'; + import { Toggle } from '@polkadot/react-components'; import { compactAddLength } from '@polkadot/util'; +import type { Props } from '../types'; import { useTranslation } from '../translate'; import BaseBytes from './BaseBytes'; import File from './File'; diff --git a/packages/react-params/src/Param/Call.tsx b/packages/react-params/src/Param/Call.tsx index e5b9a87981..5cd021ab18 100644 --- a/packages/react-params/src/Param/Call.tsx +++ b/packages/react-params/src/Param/Call.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Extrinsic } from '@polkadot/types/interfaces'; -import type { Props } from '../types'; - import React from 'react'; + +import type { Extrinsic } from '@polkadot/types/interfaces'; import { Call, Static } from '@polkadot/react-components'; +import type { Props } from '../types'; import Bare from './Bare'; import Unknown from './Unknown'; diff --git a/packages/react-params/src/Param/Code.tsx b/packages/react-params/src/Param/Code.tsx index c2dd816c71..08ab6d7d6f 100644 --- a/packages/react-params/src/Param/Code.tsx +++ b/packages/react-params/src/Param/Code.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Props } from '../types'; - import React, { useCallback, useState } from 'react'; + import { isWasm } from '@polkadot/util'; +import type { Props } from '../types'; import Bytes from './Bytes'; import BytesFile from './File'; diff --git a/packages/react-params/src/Param/DispatchError.tsx b/packages/react-params/src/Param/DispatchError.tsx index 8e7091076b..2975dde42a 100644 --- a/packages/react-params/src/Param/DispatchError.tsx +++ b/packages/react-params/src/Param/DispatchError.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DispatchError } from '@polkadot/types/interfaces'; -import type { Props } from '../types'; - import React, { useEffect, useState } from 'react'; + +import type { DispatchError } from '@polkadot/types/interfaces'; import { Input } from '@polkadot/react-components'; +import type { Props } from '../types'; import { useTranslation } from '../translate'; import Static from './Static'; import Unknown from './Unknown'; diff --git a/packages/react-params/src/Param/Enum.tsx b/packages/react-params/src/Param/Enum.tsx index 08dc6dbf5f..ca772b139b 100644 --- a/packages/react-params/src/Param/Enum.tsx +++ b/packages/react-params/src/Param/Enum.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { TypeDef } from '@polkadot/types/types'; -import type { ParamDef, Props, RawParam } from '../types'; - import React, { useCallback, useEffect, useState } from 'react'; + +import type { TypeDef } from '@polkadot/types/types'; import { Dropdown } from '@polkadot/react-components'; import { Enum, getTypeDef } from '@polkadot/types'; +import type { ParamDef, Props, RawParam } from '../types'; import Params from '../'; import Bare from './Bare'; import Static from './Static'; diff --git a/packages/react-params/src/Param/File.tsx b/packages/react-params/src/Param/File.tsx index 94877a1c73..62363dad34 100644 --- a/packages/react-params/src/Param/File.tsx +++ b/packages/react-params/src/Param/File.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React from 'react'; + import { InputFile } from '@polkadot/react-components'; import Bare from './Bare'; diff --git a/packages/react-params/src/Param/Hash160.tsx b/packages/react-params/src/Param/Hash160.tsx index fdd1ea048b..1174209797 100644 --- a/packages/react-params/src/Param/Hash160.tsx +++ b/packages/react-params/src/Param/Hash160.tsx @@ -1,10 +1,9 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Props } from '../types'; - import React from 'react'; +import type { Props } from '../types'; import BaseBytes from './BaseBytes'; function Hash160 ({ className = '', defaultValue, isDisabled, isError, label, name, onChange, onEnter, onEscape, type, withLabel }: Props): React.ReactElement { diff --git a/packages/react-params/src/Param/Hash256.tsx b/packages/react-params/src/Param/Hash256.tsx index 5ebc370e21..74b3868ba4 100644 --- a/packages/react-params/src/Param/Hash256.tsx +++ b/packages/react-params/src/Param/Hash256.tsx @@ -1,10 +1,9 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Props } from '../types'; - import React from 'react'; +import type { Props } from '../types'; import BaseBytes from './BaseBytes'; function Hash256 ({ className = '', defaultValue, isDisabled, isError, label, name, onChange, onEnter, onEscape, type, withLabel }: Props): React.ReactElement { diff --git a/packages/react-params/src/Param/Hash512.tsx b/packages/react-params/src/Param/Hash512.tsx index 781678705d..3cc6c49d04 100644 --- a/packages/react-params/src/Param/Hash512.tsx +++ b/packages/react-params/src/Param/Hash512.tsx @@ -1,10 +1,9 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Props } from '../types'; - import React from 'react'; +import type { Props } from '../types'; import BaseBytes from './BaseBytes'; function Hash512 ({ className = '', defaultValue, isDisabled, isError, label, name, onChange, onEnter, onEscape, type, withLabel }: Props): React.ReactElement { diff --git a/packages/react-params/src/Param/KeyValue.tsx b/packages/react-params/src/Param/KeyValue.tsx index 01e4b74749..b790adb42c 100644 --- a/packages/react-params/src/Param/KeyValue.tsx +++ b/packages/react-params/src/Param/KeyValue.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Props } from '../types'; - import React, { useCallback, useEffect, useState } from 'react'; + import { Input } from '@polkadot/react-components'; import { compactAddLength, hexToU8a, u8aConcat } from '@polkadot/util'; +import type { Props } from '../types'; import Bare from './Bare'; interface StateParam { diff --git a/packages/react-params/src/Param/KeyValueArray.tsx b/packages/react-params/src/Param/KeyValueArray.tsx index 9eab3cf03a..fbdc68aa87 100644 --- a/packages/react-params/src/Param/KeyValueArray.tsx +++ b/packages/react-params/src/Param/KeyValueArray.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useCallback, useState } from 'react'; + import type { Vec } from '@polkadot/types'; import type { KeyValue as Pair } from '@polkadot/types/interfaces'; -import type { Props, RawParam } from '../types'; - -import React, { useCallback, useState } from 'react'; import { assert, isHex, u8aToHex, u8aToString } from '@polkadot/util'; +import type { Props, RawParam } from '../types'; import { useTranslation } from '../translate'; import Base from './Base'; import Bytes from './Bytes'; diff --git a/packages/react-params/src/Param/Moment.tsx b/packages/react-params/src/Param/Moment.tsx index 766c836d59..f8f50a5fe5 100644 --- a/packages/react-params/src/Param/Moment.tsx +++ b/packages/react-params/src/Param/Moment.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Props, RawParamOnChangeValue } from '../types'; - import React, { useCallback } from 'react'; + import { Static } from '@polkadot/react-components'; +import type { Props, RawParamOnChangeValue } from '../types'; import Amount from './Amount'; function Moment ({ className = '', defaultValue, isDisabled, isError, label, onChange, onEnter, onEscape, registry, type, withLabel }: Props): React.ReactElement { diff --git a/packages/react-params/src/Param/Null.tsx b/packages/react-params/src/Param/Null.tsx index c9d868307e..10c7f669ca 100644 --- a/packages/react-params/src/Param/Null.tsx +++ b/packages/react-params/src/Param/Null.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Props } from '../types'; - import React, { useEffect } from 'react'; +import type { Props } from '../types'; + function Null ({ onChange }: Props): React.ReactElement | null { useEffect((): void => { onChange && onChange({ diff --git a/packages/react-params/src/Param/OpaqueCall.tsx b/packages/react-params/src/Param/OpaqueCall.tsx index dc1f242211..715d9ea502 100644 --- a/packages/react-params/src/Param/OpaqueCall.tsx +++ b/packages/react-params/src/Param/OpaqueCall.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Props } from '../types'; -import type { Bytes } from '@polkadot/types'; - import React from 'react'; +import type { Bytes } from '@polkadot/types'; + +import type { Props } from '../types'; import CallDisplay from './Call'; import Unknown from './Unknown'; diff --git a/packages/react-params/src/Param/Option.tsx b/packages/react-params/src/Param/Option.tsx index e4b84fb057..0656b1ceea 100644 --- a/packages/react-params/src/Param/Option.tsx +++ b/packages/react-params/src/Param/Option.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { TypeDef } from '@polkadot/types/types'; -import type { Props } from '../types'; - import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; + +import type { TypeDef } from '@polkadot/types/types'; import { Toggle } from '@polkadot/react-components'; +import type { Props } from '../types'; import { useTranslation } from '../translate'; import Param from './index'; diff --git a/packages/react-params/src/Param/Raw.tsx b/packages/react-params/src/Param/Raw.tsx index 48e889f428..51c560946a 100644 --- a/packages/react-params/src/Param/Raw.tsx +++ b/packages/react-params/src/Param/Raw.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Codec } from '@polkadot/types/types'; -import type { Props } from '../types'; - import React, { useCallback, useState } from 'react'; + +import type { Codec } from '@polkadot/types/types'; import { Input } from '@polkadot/react-components'; +import type { Props } from '../types'; import Bare from './Bare'; function Raw ({ className = '', defaultValue: { value }, isDisabled, isError, label, onChange, onEnter, onEscape, withLabel }: Props): React.ReactElement { diff --git a/packages/react-params/src/Param/Static.tsx b/packages/react-params/src/Param/Static.tsx index 667ea7a299..f030357079 100644 --- a/packages/react-params/src/Param/Static.tsx +++ b/packages/react-params/src/Param/Static.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Codec } from '@polkadot/types/types'; -import type { RawParam } from '../types'; - import React from 'react'; import styled from 'styled-components'; + +import type { Codec } from '@polkadot/types/types'; import { Static } from '@polkadot/react-components'; +import type { RawParam } from '../types'; import { useTranslation } from '../translate'; import Bare from './Bare'; diff --git a/packages/react-params/src/Param/Struct.tsx b/packages/react-params/src/Param/Struct.tsx index 69fe802d0e..34627f398f 100644 --- a/packages/react-params/src/Param/Struct.tsx +++ b/packages/react-params/src/Param/Struct.tsx @@ -1,10 +1,9 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Props, RawParam } from '../types'; - import React, { useCallback } from 'react'; +import type { Props, RawParam } from '../types'; import Params from '../'; import Base from './Base'; import Static from './Static'; diff --git a/packages/react-params/src/Param/Text.tsx b/packages/react-params/src/Param/Text.tsx index e31577d228..e79c9eb60d 100644 --- a/packages/react-params/src/Param/Text.tsx +++ b/packages/react-params/src/Param/Text.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Props } from '../types'; - import React, { useCallback, useState } from 'react'; + import { Input } from '@polkadot/react-components'; +import type { Props } from '../types'; import Bare from './Bare'; function Text ({ className = '', defaultValue: { value }, isDisabled, isError, label, onChange, onEnter, onEscape, withLabel }: Props): React.ReactElement { diff --git a/packages/react-params/src/Param/Tuple.tsx b/packages/react-params/src/Param/Tuple.tsx index ccc869a08f..56244b56a0 100644 --- a/packages/react-params/src/Param/Tuple.tsx +++ b/packages/react-params/src/Param/Tuple.tsx @@ -1,10 +1,9 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Props, RawParam } from '../types'; - import React, { useCallback } from 'react'; +import type { Props, RawParam } from '../types'; import Params from '../'; import Base from './Base'; import Static from './Static'; diff --git a/packages/react-params/src/Param/Unknown.tsx b/packages/react-params/src/Param/Unknown.tsx index ae0e6c9b6d..061605903b 100644 --- a/packages/react-params/src/Param/Unknown.tsx +++ b/packages/react-params/src/Param/Unknown.tsx @@ -1,10 +1,9 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Props } from '../types'; - import React from 'react'; +import type { Props } from '../types'; import BaseBytes from './BaseBytes'; import Static from './Static'; diff --git a/packages/react-params/src/Param/Vector.tsx b/packages/react-params/src/Param/Vector.tsx index cfec9e100e..25b120e3a1 100644 --- a/packages/react-params/src/Param/Vector.tsx +++ b/packages/react-params/src/Param/Vector.tsx @@ -1,15 +1,15 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ParamDef, Props, RawParam } from '../types'; - import React, { useCallback, useEffect, useState } from 'react'; + import { Button } from '@polkadot/react-components'; import { isUndefined } from '@polkadot/util'; -import { useTranslation } from '../translate'; -import getInitValue from '../initValue'; +import type { ParamDef, Props, RawParam } from '../types'; import Params from '../'; +import getInitValue from '../initValue'; +import { useTranslation } from '../translate'; import Base from './Base'; import useParamDefs from './useParamDefs'; diff --git a/packages/react-params/src/Param/VectorFixed.tsx b/packages/react-params/src/Param/VectorFixed.tsx index 71199da2af..2b28c1e165 100644 --- a/packages/react-params/src/Param/VectorFixed.tsx +++ b/packages/react-params/src/Param/VectorFixed.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ParamDef, Props, RawParam } from '../types'; - import React, { useEffect, useState } from 'react'; + import { isUndefined } from '@polkadot/util'; -import getInitValue from '../initValue'; +import type { ParamDef, Props, RawParam } from '../types'; import Params from '../'; +import getInitValue from '../initValue'; import Base from './Base'; import useParamDefs from './useParamDefs'; diff --git a/packages/react-params/src/Param/Vote.tsx b/packages/react-params/src/Param/Vote.tsx index 7b9b1764aa..63c92e0a96 100644 --- a/packages/react-params/src/Param/Vote.tsx +++ b/packages/react-params/src/Param/Vote.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Props } from '../types'; - import BN from 'bn.js'; import React, { useRef } from 'react'; + import { Dropdown } from '@polkadot/react-components'; import { GenericVote } from '@polkadot/types'; +import type { Props } from '../types'; import { useTranslation } from '../translate'; import Bare from './Bare'; diff --git a/packages/react-params/src/Param/VoteThreshold.tsx b/packages/react-params/src/Param/VoteThreshold.tsx index 6745ef679e..68995a0f10 100644 --- a/packages/react-params/src/Param/VoteThreshold.tsx +++ b/packages/react-params/src/Param/VoteThreshold.tsx @@ -1,13 +1,13 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Props } from '../types'; - import React, { useCallback } from 'react'; + import { Dropdown } from '@polkadot/react-components'; import { ClassOf } from '@polkadot/types/create'; import { bnToBn } from '@polkadot/util'; +import type { Props } from '../types'; import Bare from './Bare'; type TextMap = Record; diff --git a/packages/react-params/src/Param/findComponent.ts b/packages/react-params/src/Param/findComponent.ts index 06f7facee1..4741c854fd 100644 --- a/packages/react-params/src/Param/findComponent.ts +++ b/packages/react-params/src/Param/findComponent.ts @@ -2,12 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { Registry, TypeDef } from '@polkadot/types/types'; -import type { Props, ComponentMap } from '../types'; - import { getTypeDef } from '@polkadot/types'; import { TypeDefInfo } from '@polkadot/types/types'; import { isBn } from '@polkadot/util'; +import type { ComponentMap, Props } from '../types'; import Account from './Account'; import Amount from './Amount'; import Balance from './Balance'; @@ -17,8 +16,8 @@ import Call from './Call'; import Code from './Code'; import DispatchError from './DispatchError'; import Enum from './Enum'; -import Hash256 from './Hash256'; import Hash160 from './Hash160'; +import Hash256 from './Hash256'; import Hash512 from './Hash512'; import KeyValue from './KeyValue'; import KeyValueArray from './KeyValueArray'; diff --git a/packages/react-params/src/Param/index.tsx b/packages/react-params/src/Param/index.tsx index 8b49791c27..f3fbd5410f 100644 --- a/packages/react-params/src/Param/index.tsx +++ b/packages/react-params/src/Param/index.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Props, Props as CProps } from '../types'; - import React, { useMemo, useRef } from 'react'; + import { encodeTypeDef } from '@polkadot/types/create'; import { isUndefined } from '@polkadot/util'; +import type { Props as CProps, Props } from '../types'; import findComponent from './findComponent'; import Static from './Static'; diff --git a/packages/react-params/src/Param/useParamDefs.ts b/packages/react-params/src/Param/useParamDefs.ts index c21f05177c..44a3a86b24 100644 --- a/packages/react-params/src/Param/useParamDefs.ts +++ b/packages/react-params/src/Param/useParamDefs.ts @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Registry, TypeDef } from '@polkadot/types/types'; -import type { ParamDef } from '../types'; - import { useEffect, useState } from 'react'; + +import type { Registry, TypeDef } from '@polkadot/types/types'; import { getTypeDef } from '@polkadot/types/create'; +import type { ParamDef } from '../types'; + function expandDef (registry: Registry, td: TypeDef): TypeDef { try { return getTypeDef( diff --git a/packages/react-params/src/ParamComp.tsx b/packages/react-params/src/ParamComp.tsx index 73aafee2d9..9350a956e5 100644 --- a/packages/react-params/src/ParamComp.tsx +++ b/packages/react-params/src/ParamComp.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Registry, TypeDef } from '@polkadot/types/types'; -import type { ComponentMap, RawParam, RawParams, RawParamOnChangeValue } from './types'; - import React, { useCallback } from 'react'; +import type { Registry, TypeDef } from '@polkadot/types/types'; + +import type { ComponentMap, RawParam, RawParamOnChangeValue, RawParams } from './types'; import Param from './Param'; interface Props { diff --git a/packages/react-params/src/index.tsx b/packages/react-params/src/index.tsx index a825bca5d0..63a5345e34 100644 --- a/packages/react-params/src/index.tsx +++ b/packages/react-params/src/index.tsx @@ -1,14 +1,14 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Registry } from '@polkadot/types/types'; -import type { I18nProps } from '@polkadot/react-components/types'; -import type { ComponentMap, ParamDef, RawParam, RawParams, RawParamOnChangeValue } from './types'; - import React from 'react'; + +import type { I18nProps } from '@polkadot/react-components/types'; +import type { Registry } from '@polkadot/types/types'; import { registry as defaultRegistry } from '@polkadot/react-api'; import { ErrorBoundary } from '@polkadot/react-components'; +import type { ComponentMap, ParamDef, RawParam, RawParamOnChangeValue, RawParams } from './types'; import Holder from './Holder'; import ParamComp from './ParamComp'; import translate from './translate'; diff --git a/packages/react-params/src/initValue.ts b/packages/react-params/src/initValue.ts index 384becb7ec..613ae38838 100644 --- a/packages/react-params/src/initValue.ts +++ b/packages/react-params/src/initValue.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import type { Registry, TypeDef } from '@polkadot/types/types'; - import { getTypeDef } from '@polkadot/types'; import { TypeDefInfo } from '@polkadot/types/types'; import { BN_ZERO, isBn } from '@polkadot/util'; diff --git a/packages/react-params/src/valueToText.tsx b/packages/react-params/src/valueToText.tsx index df81da788f..5e39c70a47 100644 --- a/packages/react-params/src/valueToText.tsx +++ b/packages/react-params/src/valueToText.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React from 'react'; + import type { Keys, ValidatorId } from '@polkadot/types/interfaces'; import type { Codec } from '@polkadot/types/types'; - -import React from 'react'; import { Option, Raw } from '@polkadot/types'; import { isFunction, isNull, isUndefined, u8aToHex } from '@polkadot/util'; diff --git a/packages/react-params/src/values.ts b/packages/react-params/src/values.ts index a35e3009dd..f5a164b968 100644 --- a/packages/react-params/src/values.ts +++ b/packages/react-params/src/values.ts @@ -2,10 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 import type { Registry, TypeDef } from '@polkadot/types/types'; -import type { RawParam } from './types'; - import { isUndefined } from '@polkadot/util'; +import type { RawParam } from './types'; import getInitValue from './initValue'; export function createValue (registry: Registry, param: { type: TypeDef }): RawParam { diff --git a/packages/react-query/src/Available.tsx b/packages/react-query/src/Available.tsx index 562cfe156f..65c79aaab1 100644 --- a/packages/react-query/src/Available.tsx +++ b/packages/react-query/src/Available.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React from 'react'; + import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; - -import React from 'react'; import { useApi, useCall } from '@polkadot/react-hooks'; import FormatBalance from './FormatBalance'; diff --git a/packages/react-query/src/Balance.tsx b/packages/react-query/src/Balance.tsx index 9512a2ebe4..5cc4aca593 100644 --- a/packages/react-query/src/Balance.tsx +++ b/packages/react-query/src/Balance.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React from 'react'; + import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; - -import React from 'react'; import { useApi, useCall } from '@polkadot/react-hooks'; import FormatBalance from './FormatBalance'; diff --git a/packages/react-query/src/BalanceFree.tsx b/packages/react-query/src/BalanceFree.tsx index 0213b7de5f..cd5b7af904 100644 --- a/packages/react-query/src/BalanceFree.tsx +++ b/packages/react-query/src/BalanceFree.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React from 'react'; + import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; - -import React from 'react'; import { useApi, useCall } from '@polkadot/react-hooks'; import FormatBalance from './FormatBalance'; diff --git a/packages/react-query/src/BalanceVoting.tsx b/packages/react-query/src/BalanceVoting.tsx index b162d33dd2..47fa00711a 100644 --- a/packages/react-query/src/BalanceVoting.tsx +++ b/packages/react-query/src/BalanceVoting.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React from 'react'; + import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; - -import React from 'react'; import { useApi, useCall } from '@polkadot/react-hooks'; import FormatBalance from './FormatBalance'; diff --git a/packages/react-query/src/BestFinalized.tsx b/packages/react-query/src/BestFinalized.tsx index b8458968d6..09c4342aab 100644 --- a/packages/react-query/src/BestFinalized.tsx +++ b/packages/react-query/src/BestFinalized.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { BlockNumber } from '@polkadot/types/interfaces'; - import React from 'react'; + +import type { BlockNumber } from '@polkadot/types/interfaces'; import { useApi, useCall } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/react-query/src/BestNumber.tsx b/packages/react-query/src/BestNumber.tsx index bedb535d6c..3e9e3bb80c 100644 --- a/packages/react-query/src/BestNumber.tsx +++ b/packages/react-query/src/BestNumber.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { BlockNumber } from '@polkadot/types/interfaces'; - import React from 'react'; + +import type { BlockNumber } from '@polkadot/types/interfaces'; import { useApi, useCall } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/react-query/src/BlockAuthors.tsx b/packages/react-query/src/BlockAuthors.tsx index fb4fe2aa04..f35f2a6004 100644 --- a/packages/react-query/src/BlockAuthors.tsx +++ b/packages/react-query/src/BlockAuthors.tsx @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { EraRewardPoints } from '@polkadot/types/interfaces'; - import React, { useEffect, useState } from 'react'; + +import type { EraRewardPoints } from '@polkadot/types/interfaces'; import { HeaderExtended } from '@polkadot/api-derive'; import { useApi, useCall } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/react-query/src/BlockToTime.tsx b/packages/react-query/src/BlockToTime.tsx index 97f7126b2a..3c6de29a42 100644 --- a/packages/react-query/src/BlockToTime.tsx +++ b/packages/react-query/src/BlockToTime.tsx @@ -4,6 +4,7 @@ import BN from 'bn.js'; import React from 'react'; import styled from 'styled-components'; + import { useBlockTime } from '@polkadot/react-hooks'; interface Props { diff --git a/packages/react-query/src/Bonded.tsx b/packages/react-query/src/Bonded.tsx index 49ce96731e..7cca5e99af 100644 --- a/packages/react-query/src/Bonded.tsx +++ b/packages/react-query/src/Bonded.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React from 'react'; + import type { Option } from '@polkadot/types'; import type { AccountId, AccountIndex, Address, StakingLedger } from '@polkadot/types/interfaces'; - -import React from 'react'; import { useApi, useCall } from '@polkadot/react-hooks'; import FormatBalance from './FormatBalance'; diff --git a/packages/react-query/src/Chain.tsx b/packages/react-query/src/Chain.tsx index 37b89a8002..0aff83fb42 100644 --- a/packages/react-query/src/Chain.tsx +++ b/packages/react-query/src/Chain.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React from 'react'; + import { useApi } from '@polkadot/react-hooks'; import { useTranslation } from './translate'; diff --git a/packages/react-query/src/Elapsed.tsx b/packages/react-query/src/Elapsed.tsx index 56b73ba4e5..18496f4515 100644 --- a/packages/react-query/src/Elapsed.tsx +++ b/packages/react-query/src/Elapsed.tsx @@ -3,6 +3,7 @@ import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; + import { bnToBn } from '@polkadot/util'; type Ticker = (now: number) => void; diff --git a/packages/react-query/src/Events.tsx b/packages/react-query/src/Events.tsx index 60a57b59f2..97ee96fe6f 100644 --- a/packages/react-query/src/Events.tsx +++ b/packages/react-query/src/Events.tsx @@ -1,13 +1,14 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { IndexedEvent, KeyedEvent } from './types'; - import React, { useEffect, useState } from 'react'; + import { useApi } from '@polkadot/react-hooks'; import { stringToU8a } from '@polkadot/util'; import { xxhashAsHex } from '@polkadot/util-crypto'; +import type { IndexedEvent, KeyedEvent } from './types'; + type Events = KeyedEvent[]; interface Props { diff --git a/packages/react-query/src/FormatBalance.tsx b/packages/react-query/src/FormatBalance.tsx index a029ba58f3..b59233174b 100644 --- a/packages/react-query/src/FormatBalance.tsx +++ b/packages/react-query/src/FormatBalance.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ThemeProps } from '@polkadot/react-components/types'; -import type { Compact } from '@polkadot/types'; - import BN from 'bn.js'; import React from 'react'; import styled from 'styled-components'; + +import type { ThemeProps } from '@polkadot/react-components/types'; +import type { Compact } from '@polkadot/types'; import { formatBalance } from '@polkadot/util'; import { useTranslation } from './translate'; diff --git a/packages/react-query/src/LockedVote.tsx b/packages/react-query/src/LockedVote.tsx index 2a0d9d7377..66f054a329 100644 --- a/packages/react-query/src/LockedVote.tsx +++ b/packages/react-query/src/LockedVote.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React from 'react'; + import type { DeriveCouncilVote } from '@polkadot/api-derive/types'; import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; - -import React from 'react'; import { useApi, useCall } from '@polkadot/react-hooks'; import FormatBalance from './FormatBalance'; diff --git a/packages/react-query/src/NodeName.tsx b/packages/react-query/src/NodeName.tsx index 7e7e8095f4..d05bfcbcd7 100644 --- a/packages/react-query/src/NodeName.tsx +++ b/packages/react-query/src/NodeName.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React from 'react'; + import { useApi } from '@polkadot/react-hooks'; interface Props { diff --git a/packages/react-query/src/NodeVersion.tsx b/packages/react-query/src/NodeVersion.tsx index d42d398d03..81639cce74 100644 --- a/packages/react-query/src/NodeVersion.tsx +++ b/packages/react-query/src/NodeVersion.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React from 'react'; + import { useApi } from '@polkadot/react-hooks'; interface Props { diff --git a/packages/react-query/src/Nonce.tsx b/packages/react-query/src/Nonce.tsx index f35159e741..addd9376b2 100644 --- a/packages/react-query/src/Nonce.tsx +++ b/packages/react-query/src/Nonce.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; - import BN from 'bn.js'; import React from 'react'; + +import type { DeriveBalancesAll } from '@polkadot/api-derive/types'; import { useApi, useCall } from '@polkadot/react-hooks'; import { formatNumber } from '@polkadot/util'; diff --git a/packages/react-query/src/TimeNow.tsx b/packages/react-query/src/TimeNow.tsx index b571b1075b..9212b2f893 100644 --- a/packages/react-query/src/TimeNow.tsx +++ b/packages/react-query/src/TimeNow.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-query authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Moment } from '@polkadot/types/interfaces'; - import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; + +import type { Moment } from '@polkadot/types/interfaces'; import { useApi, useCall } from '@polkadot/react-hooks'; import Elapsed from './Elapsed'; diff --git a/packages/react-query/src/TotalIssuance.tsx b/packages/react-query/src/TotalIssuance.tsx index 873a4393b9..aa4e999dc1 100644 --- a/packages/react-query/src/TotalIssuance.tsx +++ b/packages/react-query/src/TotalIssuance.tsx @@ -2,7 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 import React from 'react'; + import { useApi, useCall } from '@polkadot/react-hooks'; + import FormatBalance from './FormatBalance'; interface Props { diff --git a/packages/react-signer/src/Address.tsx b/packages/react-signer/src/Address.tsx index 95a041eca5..bf0cb224e0 100644 --- a/packages/react-signer/src/Address.tsx +++ b/packages/react-signer/src/Address.tsx @@ -1,21 +1,21 @@ // Copyright 2017-2020 @polkadot/react-signer authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useCallback, useEffect, useMemo, useState } from 'react'; + import type { SubmittableExtrinsic } from '@polkadot/api/types'; import type { QueueTx } from '@polkadot/react-components/Status/types'; import type { Option, Vec } from '@polkadot/types'; import type { AccountId, BalanceOf, Call, Multisig, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces'; import type { ITuple } from '@polkadot/types/types'; -import type { AddressFlags, AddressProxy } from './types'; - -import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { ApiPromise } from '@polkadot/api'; import { InputAddress, Modal, Toggle } from '@polkadot/react-components'; import { useAccounts, useApi, useIsMountedRef } from '@polkadot/react-hooks'; import { isFunction } from '@polkadot/util'; -import { useTranslation } from './translate'; +import type { AddressFlags, AddressProxy } from './types'; import Password from './Password'; +import { useTranslation } from './translate'; import { extractExternal } from './util'; interface Props { diff --git a/packages/react-signer/src/Password.tsx b/packages/react-signer/src/Password.tsx index f9b15ea5de..18b7eeb650 100644 --- a/packages/react-signer/src/Password.tsx +++ b/packages/react-signer/src/Password.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-signer authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { KeyringPair } from '@polkadot/keyring/types'; - import React, { useEffect, useMemo, useState } from 'react'; import styled from 'styled-components'; + +import type { KeyringPair } from '@polkadot/keyring/types'; import { Modal, Password, Toggle } from '@polkadot/react-components'; import keyring from '@polkadot/ui-keyring'; diff --git a/packages/react-signer/src/PaymentInfo.tsx b/packages/react-signer/src/PaymentInfo.tsx index 3627fd11c6..ec3121133c 100644 --- a/packages/react-signer/src/PaymentInfo.tsx +++ b/packages/react-signer/src/PaymentInfo.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/react-signer authors & contributors // SPDX-License-Identifier: Apache-2.0 +import BN from 'bn.js'; +import React, { useEffect, useState } from 'react'; +import { Trans } from 'react-i18next'; + import type { SubmittableExtrinsic } from '@polkadot/api/promise/types'; import type { RuntimeDispatchInfo } from '@polkadot/types/interfaces'; - -import BN from 'bn.js'; -import React, { useState, useEffect } from 'react'; -import { Trans } from 'react-i18next'; import { Expander } from '@polkadot/react-components'; import { useApi, useIsMountedRef } from '@polkadot/react-hooks'; import { formatBalance, isFunction } from '@polkadot/util'; diff --git a/packages/react-signer/src/Qr.tsx b/packages/react-signer/src/Qr.tsx index 3d89a56a75..039168305b 100644 --- a/packages/react-signer/src/Qr.tsx +++ b/packages/react-signer/src/Qr.tsx @@ -3,6 +3,7 @@ import React, { useCallback, useState } from 'react'; import styled from 'styled-components'; + import { Columar, QrDisplayPayload, QrScanSignature, Spinner } from '@polkadot/react-components'; import { isHex } from '@polkadot/util'; diff --git a/packages/react-signer/src/SignFields.tsx b/packages/react-signer/src/SignFields.tsx index b4845f2b06..3ed5da72fc 100644 --- a/packages/react-signer/src/SignFields.tsx +++ b/packages/react-signer/src/SignFields.tsx @@ -1,10 +1,10 @@ // Copyright 2017-2020 @polkadot/react-signer authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SignerOptions } from '@polkadot/api/submittable/types'; - import BN from 'bn.js'; import React, { useCallback, useEffect, useState } from 'react'; + +import type { SignerOptions } from '@polkadot/api/submittable/types'; import { InputNumber, Modal, Output } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; import { BN_ZERO } from '@polkadot/util'; diff --git a/packages/react-signer/src/Tip.tsx b/packages/react-signer/src/Tip.tsx index 38d2a17f64..8dbd0b67c5 100644 --- a/packages/react-signer/src/Tip.tsx +++ b/packages/react-signer/src/Tip.tsx @@ -3,6 +3,7 @@ import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; + import { InputBalance, Modal, Toggle } from '@polkadot/react-components'; import { BN_ZERO } from '@polkadot/util'; diff --git a/packages/react-signer/src/Transaction.tsx b/packages/react-signer/src/Transaction.tsx index f62afc3c77..48961dc627 100644 --- a/packages/react-signer/src/Transaction.tsx +++ b/packages/react-signer/src/Transaction.tsx @@ -1,15 +1,15 @@ // Copyright 2017-2020 @polkadot/react-signer authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { QueueTx } from '@polkadot/react-components/Status/types'; - import BN from 'bn.js'; import React from 'react'; import styled from 'styled-components'; + +import type { QueueTx } from '@polkadot/react-components/Status/types'; import { Call, Expander, Modal } from '@polkadot/react-components'; -import { useTranslation } from './translate'; import PaymentInfo from './PaymentInfo'; +import { useTranslation } from './translate'; interface Props { className?: string; diff --git a/packages/react-signer/src/TxSigned.tsx b/packages/react-signer/src/TxSigned.tsx index 2ac39b024f..79252c3e33 100644 --- a/packages/react-signer/src/TxSigned.tsx +++ b/packages/react-signer/src/TxSigned.tsx @@ -1,31 +1,31 @@ // Copyright 2017-2020 @polkadot/react-signer authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { SubmittableExtrinsic } from '@polkadot/api/types'; +import React, { useCallback, useContext, useEffect, useState } from 'react'; +import styled from 'styled-components'; + import type { SignerOptions } from '@polkadot/api/submittable/types'; +import type { SubmittableExtrinsic } from '@polkadot/api/types'; import type { KeyringPair } from '@polkadot/keyring/types'; import type { QueueTx, QueueTxMessageSetStatus } from '@polkadot/react-components/Status/types'; import type { Option } from '@polkadot/types'; import type { Multisig, Timepoint } from '@polkadot/types/interfaces'; -import type { AddressProxy, QrState } from './types'; - -import React, { useCallback, useContext, useEffect, useState } from 'react'; -import styled from 'styled-components'; import { ApiPromise } from '@polkadot/api'; import { web3FromSource } from '@polkadot/extension-dapp'; import { registry } from '@polkadot/react-api'; import { Button, ErrorBoundary, Modal, Output, StatusContext, Toggle } from '@polkadot/react-components'; import { useApi, useToggle } from '@polkadot/react-hooks'; import keyring from '@polkadot/ui-keyring'; -import { BN_ZERO, assert } from '@polkadot/util'; +import { assert, BN_ZERO } from '@polkadot/util'; -import { AccountSigner, LedgerSigner, QrSigner } from './signers'; -import { useTranslation } from './translate'; +import type { AddressProxy, QrState } from './types'; import Address from './Address'; import Qr from './Qr'; +import { AccountSigner, LedgerSigner, QrSigner } from './signers'; import SignFields from './SignFields'; import Tip from './Tip'; import Transaction from './Transaction'; +import { useTranslation } from './translate'; import { cacheUnlock, extractExternal, handleTxResults } from './util'; interface Props { diff --git a/packages/react-signer/src/TxUnsigned.tsx b/packages/react-signer/src/TxUnsigned.tsx index c71ef442f2..4cb6100a10 100644 --- a/packages/react-signer/src/TxUnsigned.tsx +++ b/packages/react-signer/src/TxUnsigned.tsx @@ -1,15 +1,15 @@ // Copyright 2017-2020 @polkadot/react-signer authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useCallback, useContext } from 'react'; + import type { SubmittableExtrinsic } from '@polkadot/api/types'; import type { QueueTx, QueueTxMessageSetStatus } from '@polkadot/react-components/Status/types'; - -import React, { useCallback, useContext } from 'react'; import { Button, ErrorBoundary, Modal, StatusContext } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; -import { useTranslation } from './translate'; import Transaction from './Transaction'; +import { useTranslation } from './translate'; import { handleTxResults } from './util'; interface Props { diff --git a/packages/react-signer/src/index.tsx b/packages/react-signer/src/index.tsx index cf2e4b8b19..597d61880d 100644 --- a/packages/react-signer/src/index.tsx +++ b/packages/react-signer/src/index.tsx @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/react-signer authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useContext, useEffect, useMemo } from 'react'; +import styled from 'styled-components'; + import type { QueueTx, QueueTxMessageSetStatus, QueueTxResult } from '@polkadot/react-components/Status/types'; import type { BareProps as Props } from '@polkadot/react-components/types'; import type { DefinitionRpcExt } from '@polkadot/types/types'; - -import React, { useContext, useEffect, useMemo } from 'react'; -import styled from 'styled-components'; import { ApiPromise } from '@polkadot/api'; import { Modal, StatusContext } from '@polkadot/react-components'; import { useApi } from '@polkadot/react-hooks'; diff --git a/packages/react-signer/src/signers/AccountSigner.ts b/packages/react-signer/src/signers/AccountSigner.ts index 3beecd5d24..9f5ae6b3aa 100644 --- a/packages/react-signer/src/signers/AccountSigner.ts +++ b/packages/react-signer/src/signers/AccountSigner.ts @@ -4,7 +4,6 @@ import type { Signer, SignerResult } from '@polkadot/api/types'; import type { KeyringPair } from '@polkadot/keyring/types'; import type { SignerPayloadJSON } from '@polkadot/types/types'; - import { registry } from '@polkadot/react-api'; import { lockAccount } from '../util'; diff --git a/packages/react-signer/src/signers/ApiSigner.ts b/packages/react-signer/src/signers/ApiSigner.ts index 46b034b01f..97097d463d 100644 --- a/packages/react-signer/src/signers/ApiSigner.ts +++ b/packages/react-signer/src/signers/ApiSigner.ts @@ -1,12 +1,11 @@ // Copyright 2017-2020 @polkadot/react-signer authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Signer, SignerResult } from '@polkadot/api/types'; import type { SubmittableResult } from '@polkadot/api'; -import type { QueueTxPayloadAdd, QueueTxMessageSetStatus, QueueTxStatus } from '@polkadot/react-components/Status/types'; +import type { Signer, SignerResult } from '@polkadot/api/types'; +import type { QueueTxMessageSetStatus, QueueTxPayloadAdd, QueueTxStatus } from '@polkadot/react-components/Status/types'; import type { Hash } from '@polkadot/types/interfaces'; import type { SignerPayloadJSON } from '@polkadot/types/types'; - import { registry } from '@polkadot/react-api'; import { ClassOf } from '@polkadot/types/create'; diff --git a/packages/react-signer/src/signers/LedgerSigner.ts b/packages/react-signer/src/signers/LedgerSigner.ts index ad791eba08..cffb8840e0 100644 --- a/packages/react-signer/src/signers/LedgerSigner.ts +++ b/packages/react-signer/src/signers/LedgerSigner.ts @@ -3,7 +3,6 @@ import type { Signer, SignerResult } from '@polkadot/api/types'; import type { SignerPayloadJSON } from '@polkadot/types/types'; - import { getLedger, registry } from '@polkadot/react-api'; let id = 0; diff --git a/packages/react-signer/src/signers/QrSigner.ts b/packages/react-signer/src/signers/QrSigner.ts index b3cff3ed10..3bdb2c3e00 100644 --- a/packages/react-signer/src/signers/QrSigner.ts +++ b/packages/react-signer/src/signers/QrSigner.ts @@ -3,11 +3,11 @@ import type { Signer, SignerResult } from '@polkadot/api/types'; import type { SignerPayloadJSON } from '@polkadot/types/types'; -import type { QrState } from '../types'; - import { registry } from '@polkadot/react-api'; import { blake2AsU8a } from '@polkadot/util-crypto'; +import type { QrState } from '../types'; + export default class QrSigner implements Signer { readonly #setState: (state: QrState) => void; diff --git a/packages/react-signer/src/util.ts b/packages/react-signer/src/util.ts index a6a5bdf0e3..48087c8005 100644 --- a/packages/react-signer/src/util.ts +++ b/packages/react-signer/src/util.ts @@ -3,11 +3,11 @@ import type { KeyringPair } from '@polkadot/keyring/types'; import type { QueueTx, QueueTxMessageSetStatus, QueueTxStatus } from '@polkadot/react-components/Status/types'; -import type { AddressFlags } from './types'; - import { SubmittableResult } from '@polkadot/api'; import keyring from '@polkadot/ui-keyring'; +import type { AddressFlags } from './types'; + const NOOP = () => undefined; export const UNLOCK_MINS = 15; diff --git a/patches/eslint-plugin-simple-import-sort+6.0.1.patch b/patches/eslint-plugin-simple-import-sort+6.0.1.patch new file mode 100644 index 0000000000..9d86f36268 --- /dev/null +++ b/patches/eslint-plugin-simple-import-sort+6.0.1.patch @@ -0,0 +1,22 @@ +diff --git a/node_modules/eslint-plugin-simple-import-sort/shared.js b/node_modules/eslint-plugin-simple-import-sort/shared.js +index 8012b59..4ed6327 100644 +--- a/node_modules/eslint-plugin-simple-import-sort/shared.js ++++ b/node_modules/eslint-plugin-simple-import-sort/shared.js +@@ -713,13 +713,13 @@ function sortImportExportItems(items) { + ? -1 + : itemB.isSideEffectImport + ? 1 +- : // Compare the `from` part. +- compare(itemA.source.source, itemB.source.source) || ++ : // Put type imports/exports before regular ones. ++ compare(itemA.source.kind, itemB.source.kind) || ++ // Compare the `from` part. ++ // compare(itemA.source.source, itemB.source.source) || + // The `.source` has been slightly tweaked. To stay fully deterministic, + // also sort on the original value. + compare(itemA.source.originalSource, itemB.source.originalSource) || +- // Then put type imports/exports before regular ones. +- compare(itemA.source.kind, itemB.source.kind) || + // Keep the original order if the sources are the same. It’s not worth + // trying to compare anything else, and you can use `import/no-duplicates` + // to get rid of the problem anyway. diff --git a/yarn.lock b/yarn.lock index cb690ca6bd..bb13481165 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3964,6 +3964,13 @@ __metadata: languageName: node linkType: hard +"@yarnpkg/lockfile@npm:^1.1.0": + version: 1.1.0 + resolution: "@yarnpkg/lockfile@npm:1.1.0" + checksum: 76f3f2625334fb4d37881408643b61ae08e1cfcdeb5db3e3e92f626b3535f99e963df8bafe5c07d85aa1dd09a308939eb4d0667ed4a4e93e645417b6af6e9a2f + languageName: node + linkType: hard + "@zondax/ledger-polkadot@npm:^0.11.0": version: 0.11.0 resolution: "@zondax/ledger-polkadot@npm:0.11.0" @@ -7963,6 +7970,15 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-simple-import-sort@npm:^6.0.1": + version: 6.0.1 + resolution: "eslint-plugin-simple-import-sort@npm:6.0.1" + peerDependencies: + eslint: ">=5.0.0" + checksum: d43a4eb603ea97b92076453be40217e3808e3f1e7901a0307c206ecff19bd85072dddfec16ec88d98bf3058781e98f62d5e929c3b0794f71d094688042714c61 + languageName: node + linkType: hard + "eslint-plugin-sort-destructure-keys@npm:^1.3.5": version: 1.3.5 resolution: "eslint-plugin-sort-destructure-keys@npm:1.3.5" @@ -8678,6 +8694,16 @@ __metadata: languageName: node linkType: hard +"find-yarn-workspace-root@npm:^1.2.1": + version: 1.2.1 + resolution: "find-yarn-workspace-root@npm:1.2.1" + dependencies: + fs-extra: ^4.0.3 + micromatch: ^3.1.4 + checksum: df97013b720daefe2746726144ed00b7b33a0e7f90213ba9e8e5c2c43e053903b2007b1496b7ab9a4694ca6dfae82cf97989e1d184c5e249e679412bdb215957 + languageName: node + linkType: hard + "find@npm:^0.3.0": version: 0.3.0 resolution: "find@npm:0.3.0" @@ -8840,6 +8866,28 @@ __metadata: languageName: node linkType: hard +"fs-extra@npm:^4.0.3": + version: 4.0.3 + resolution: "fs-extra@npm:4.0.3" + dependencies: + graceful-fs: ^4.1.2 + jsonfile: ^4.0.0 + universalify: ^0.1.0 + checksum: ad42def19446c82543ebfa707250de2e1adff8f1c902f9cad3946f69b3dad326696f70e86c3aebeab4bc4f19ff3ef9abee0460d7fb775122f3dc9142a4b1280f + languageName: node + linkType: hard + +"fs-extra@npm:^7.0.1": + version: 7.0.1 + resolution: "fs-extra@npm:7.0.1" + dependencies: + graceful-fs: ^4.1.2 + jsonfile: ^4.0.0 + universalify: ^0.1.0 + checksum: 0de3773953a13b517f053dbfa291166da076cc563cdd8f0ecefc64018ab15d2614f1707860b82e6b0e41695f613c1855f410749bd01bcb585f0243b1018a6595 + languageName: node + linkType: hard + "fs-extra@npm:^8.1.0": version: 8.1.0 resolution: "fs-extra@npm:8.1.0" @@ -11705,6 +11753,15 @@ fsevents@^1.2.7: languageName: node linkType: hard +"klaw-sync@npm:^6.0.0": + version: 6.0.0 + resolution: "klaw-sync@npm:6.0.0" + dependencies: + graceful-fs: ^4.1.11 + checksum: 40112f582d6b906ff556f2c8b67376bc1cad1939da981ac8265fcf6e46cad3bd521e7b9d1bd7e63016d744e7952eca4cb7a0da77466732c6b4e7fd51d42d76a4 + languageName: node + linkType: hard + "kleur@npm:^3.0.3": version: 3.0.3 resolution: "kleur@npm:3.0.3" @@ -13911,6 +13968,28 @@ fsevents@^1.2.7: languageName: node linkType: hard +"patch-package@npm:^6.2.2": + version: 6.2.2 + resolution: "patch-package@npm:6.2.2" + dependencies: + "@yarnpkg/lockfile": ^1.1.0 + chalk: ^2.4.2 + cross-spawn: ^6.0.5 + find-yarn-workspace-root: ^1.2.1 + fs-extra: ^7.0.1 + is-ci: ^2.0.0 + klaw-sync: ^6.0.0 + minimist: ^1.2.0 + rimraf: ^2.6.3 + semver: ^5.6.0 + slash: ^2.0.0 + tmp: ^0.0.33 + bin: + patch-package: index.js + checksum: 4225ee1028f387ed2c00d9c0d7ffbb03dba5b8adc26a6cc116e0f38f4cd08d232defa20dbca51bce088964d787291715f3603b496abc608f0c392643dd3d3a46 + languageName: node + linkType: hard + "path-browserify@npm:0.0.1": version: 0.0.1 resolution: "path-browserify@npm:0.0.1" @@ -14149,7 +14228,10 @@ fsevents@^1.2.7: electron: ^10.1.6 electron-builder: ^22.9.1 electron-builder-notarize: ^1.2.0 + eslint-plugin-simple-import-sort: ^6.0.1 i18next-scanner: ^2.11.0 + patch-package: ^6.2.2 + postinstall-prepare: ^1.0.1 react: ^17.0.1 react-dom: ^17.0.1 react-is: ^17.0.1 @@ -14334,6 +14416,13 @@ fsevents@^1.2.7: languageName: node linkType: hard +"postinstall-prepare@npm:^1.0.1": + version: 1.0.1 + resolution: "postinstall-prepare@npm:1.0.1" + checksum: f514ddcaf3efac225bb12488791ec26b345a3eb6ad49ca977a8ab79bbc7c42ad9548d8c5eccbd8bff214ca9d245da272b5f2f6a3b364fcf5a8818960467d70fa + languageName: node + linkType: hard + "prebuild-install@npm:^5.3.4, prebuild-install@npm:^5.3.5": version: 5.3.6 resolution: "prebuild-install@npm:5.3.6"