diff --git a/package.json b/package.json index 1f715aae8d..94e36f00a2 100644 --- a/package.json +++ b/package.json @@ -88,24 +88,24 @@ "webpack-cli": "^4.9.2" }, "resolutions": { - "@polkadot/api": "^7.8.1", - "@polkadot/api-augment": "^7.8.1", - "@polkadot/api-base": "^7.8.1", - "@polkadot/api-contract": "^7.8.1", - "@polkadot/api-derive": "^7.8.1", + "@polkadot/api": "^7.8.2-4", + "@polkadot/api-augment": "^7.8.2-4", + "@polkadot/api-base": "^7.8.2-4", + "@polkadot/api-contract": "^7.8.2-4", + "@polkadot/api-derive": "^7.8.2-4", "@polkadot/hw-ledger": "^8.4.1", "@polkadot/keyring": "^8.4.1", "@polkadot/networks": "^8.4.1", - "@polkadot/phishing": "^0.8.167", - "@polkadot/rpc-augment": "^7.8.1", - "@polkadot/rpc-core": "^7.8.1", - "@polkadot/rpc-provider": "^7.8.1", - "@polkadot/types": "^7.8.1", - "@polkadot/types-augment": "^7.8.1", - "@polkadot/types-codec": "^7.8.1", - "@polkadot/types-create": "^7.8.1", - "@polkadot/types-known": "^7.8.1", - "@polkadot/types-support": "^7.8.1", + "@polkadot/phishing": "^0.8.179", + "@polkadot/rpc-augment": "^7.8.2-4", + "@polkadot/rpc-core": "^7.8.2-4", + "@polkadot/rpc-provider": "^7.8.2-4", + "@polkadot/types": "^7.8.2-4", + "@polkadot/types-augment": "^7.8.2-4", + "@polkadot/types-codec": "^7.8.2-4", + "@polkadot/types-create": "^7.8.2-4", + "@polkadot/types-known": "^7.8.2-4", + "@polkadot/types-support": "^7.8.2-4", "@polkadot/util": "^8.4.1", "@polkadot/util-crypto": "^8.4.1", "@polkadot/wasm-crypto": "^4.5.1", diff --git a/packages/apps-config/package.json b/packages/apps-config/package.json index f23617cfdc..646cbbbf68 100644 --- a/packages/apps-config/package.json +++ b/packages/apps-config/package.json @@ -28,10 +28,10 @@ "@metaverse-network-sdk/type-definitions": "^0.0.1-6", "@parallel-finance/type-definitions": "1.5.1", "@phala/typedefs": "0.2.30", - "@polkadot/api": "^7.8.1", - "@polkadot/api-derive": "^7.8.1", + "@polkadot/api": "^7.8.2-4", + "@polkadot/api-derive": "^7.8.2-4", "@polkadot/networks": "^8.4.1", - "@polkadot/types": "^7.8.1", + "@polkadot/types": "^7.8.2-4", "@polkadot/util": "^8.4.1", "@polkadot/x-fetch": "^8.4.1", "@polymathnetwork/polymesh-types": "0.0.2", diff --git a/packages/apps-routing/src/files.ts b/packages/apps-routing/src/files.ts index 30f35ae98e..4c69ac1ad5 100644 --- a/packages/apps-routing/src/files.ts +++ b/packages/apps-routing/src/files.ts @@ -10,11 +10,12 @@ export default function create (t: TFunction): Route { return { Component, display: { + needsAccounts: true, needsApi: [] }, - group: 'files', + group: 'developer', icon: 'file', name: 'files', - text: t('nav.files', 'Files', { ns: 'apps-routing' }) + text: t('nav.files', 'Files (IPFS)', { ns: 'apps-routing' }) }; } diff --git a/packages/apps-routing/src/index.ts b/packages/apps-routing/src/index.ts index 20cfc41349..9663bec705 100644 --- a/packages/apps-routing/src/index.ts +++ b/packages/apps-routing/src/index.ts @@ -60,8 +60,8 @@ export default function create (t: TFunction): Routes { rpc(t), signing(t), sudo(t), - js(t), files(t), + js(t), settings(t) ]; } diff --git a/packages/page-accounts/package.json b/packages/page-accounts/package.json index 1d795d29f9..d22f585948 100644 --- a/packages/page-accounts/package.json +++ b/packages/page-accounts/package.json @@ -15,11 +15,11 @@ "dependencies": { "@babel/runtime": "^7.17.2", "@polkadot/hw-ledger": "^8.4.1", - "@polkadot/phishing": "^0.8.175", + "@polkadot/phishing": "^0.8.179", "@polkadot/react-components": "^0.106.2-4", "@polkadot/react-hooks": "^0.106.2-4", "@polkadot/util": "^8.4.1", - "@polkadot/vanitygen": "^0.49.3", + "@polkadot/vanitygen": "^0.49.4-0", "detect-browser": "^5.3.0", "file-saver": "^2.0.5" }, diff --git a/packages/page-contracts/package.json b/packages/page-contracts/package.json index 9960c82fb7..da009f6ffe 100644 --- a/packages/page-contracts/package.json +++ b/packages/page-contracts/package.json @@ -14,6 +14,6 @@ "version": "0.106.2-4", "dependencies": { "@babel/runtime": "^7.17.2", - "@polkadot/api-contract": "^7.8.1" + "@polkadot/api-contract": "^7.8.2-4" } } diff --git a/packages/page-files/package.json b/packages/page-files/package.json index e58b4c2755..6c30a5e506 100644 --- a/packages/page-files/package.json +++ b/packages/page-files/package.json @@ -14,6 +14,6 @@ "version": "0.105.2-24", "dependencies": { "@babel/runtime": "^7.17.0", - "@polkadot/react-components": "^0.105.2-24" + "@polkadot/react-components": "^0.106.2-4" } } diff --git a/packages/page-files/src/CrustFiles.tsx b/packages/page-files/src/CrustFiles.tsx index c96ed2c15a..6369b0f93e 100644 --- a/packages/page-files/src/CrustFiles.tsx +++ b/packages/page-files/src/CrustFiles.tsx @@ -5,13 +5,13 @@ import FileSaver from 'file-saver'; import React, { useCallback, useContext, useRef, useState } from 'react'; import styled from 'styled-components'; -import { useFiles } from '@polkadot/app-files/hooks'; -import UploadModal from '@polkadot/app-files/UploadModal'; import { Badge, Button, CopyButton, Icon, StatusContext, Table } from '@polkadot/react-components'; import { ActionStatusBase, QueueProps } from '@polkadot/react-components/Status/types'; +import { useFiles } from './hooks'; import { useTranslation } from './translate'; import { DirFile, FileInfo, SaveFile } from './types'; +import UploadModal from './UploadModal'; const MCopyButton = styled(CopyButton)` .copySpan { @@ -276,10 +276,13 @@ function CrustFiles ({ className }: Props): React.ReactElement { {f.items && } + > + {f.items && ( + + )} {shortStr(f.Name)} { colSpan={1} >
- {!f.items && ('Download')} - icon='download' - onClick={createOnDown(f)} - />} + {!f.items && ( + ('Download')} + icon='download' + onClick={createOnDown(f)} + /> + )} void, onSuccess?: (res: SaveFile) => void, @@ -27,14 +28,7 @@ function ShowFile (p: { file: DirFile | File }) { const f = p.file as DirFile; return ( -
+
@@ -54,8 +48,7 @@ interface SignerState { const NOOP = (): void => undefined; -function UploadModal (p: Props): React.ReactElement { - const { file, onClose = NOOP, onSuccess = NOOP } = p; +function UploadModal ({ className, file, onClose = NOOP, onSuccess = NOOP }: Props): React.ReactElement { const { t } = useTranslation(); const endpoints = useMemo( () => createAuthIpfsEndpoints(t) @@ -71,7 +64,6 @@ function UploadModal (p: Props): React.ReactElement { } ], [t]); const [currentPinEndpoint, setCurrentPinEndpoint] = useState(pinEndpoints[0]); - const { hasAccounts } = useAccounts(); const [currentPair, setCurrentPair] = useState(() => keyring.getPairs()[0] || null); const [account, setAccount] = useState(''); const [{ isInjected }, setAccountState] = useState({ @@ -190,11 +182,11 @@ function UploadModal (p: Props): React.ReactElement { const base64Signature = Buffer.from(perSignData).toString('base64'); const AuthBasic = `Basic ${base64Signature}`; const AuthBearer = `Bearer ${base64Signature}`; - // 2: up file const cancel = axios.CancelToken.source(); setCancelUp(cancel); setUpState({ progress: 0, up: true }); + const form = new FormData(); if (file.file) { @@ -277,6 +269,7 @@ function UploadModal (p: Props): React.ReactElement { return ( ('Upload File')} onClose={_onClose} open={true} @@ -284,10 +277,8 @@ function UploadModal (p: Props): React.ReactElement { > -
- { - file.file && - } +
+ {file.file && } {file.files && file.files.map((f, i) => { value={currentPinEndpoint.value} /> - {t('Need to connect a plug-in wallet or import an account first')} -

- } - > + ('Please choose account')} labelExtra={ { /> } - { - errorText && -
- {errorText} -
- } + {errorText && ( + + )}