parent
6c44b0c171
commit
40c6b943de
44
package.json
44
package.json
@ -56,12 +56,12 @@
|
||||
"test:skipped": "echo 'tests skipped'"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.16.10",
|
||||
"@babel/core": "^7.16.12",
|
||||
"@babel/register": "^7.16.9",
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@crustio/crust-pin": "^1.0.0",
|
||||
"@pinata/sdk": "^1.1.23",
|
||||
"@polkadot/dev": "^0.65.38",
|
||||
"@polkadot/dev": "^0.65.43",
|
||||
"@types/bn.js": "^4.11.6",
|
||||
"@types/chart.js": "^2.9.35",
|
||||
"@types/file-saver": "^2.0.5",
|
||||
@ -89,26 +89,26 @@
|
||||
"webpack-cli": "^4.9.1"
|
||||
},
|
||||
"resolutions": {
|
||||
"@polkadot/api": "^7.4.2-9",
|
||||
"@polkadot/api-augment": "^7.4.2-9",
|
||||
"@polkadot/api-base": "^7.4.2-9",
|
||||
"@polkadot/api-contract": "^7.4.2-9",
|
||||
"@polkadot/api-derive": "^7.4.2-9",
|
||||
"@polkadot/hw-ledger": "^8.3.2",
|
||||
"@polkadot/keyring": "^8.3.2",
|
||||
"@polkadot/networks": "^8.3.2",
|
||||
"@polkadot/phishing": "^0.8.49",
|
||||
"@polkadot/rpc-augment": "^7.4.2-9",
|
||||
"@polkadot/rpc-core": "^7.4.2-9",
|
||||
"@polkadot/rpc-provider": "^7.4.2-9",
|
||||
"@polkadot/types": "^7.4.2-9",
|
||||
"@polkadot/types-augment": "^7.4.2-9",
|
||||
"@polkadot/types-codec": "^7.4.2-9",
|
||||
"@polkadot/types-create": "^7.4.2-9",
|
||||
"@polkadot/types-known": "^7.4.2-9",
|
||||
"@polkadot/types-support": "^7.4.2-9",
|
||||
"@polkadot/util": "^8.3.2",
|
||||
"@polkadot/util-crypto": "^8.3.2",
|
||||
"@polkadot/api": "^7.5.1",
|
||||
"@polkadot/api-augment": "^7.5.1",
|
||||
"@polkadot/api-base": "^7.5.1",
|
||||
"@polkadot/api-contract": "^7.5.1",
|
||||
"@polkadot/api-derive": "^7.5.1",
|
||||
"@polkadot/hw-ledger": "^8.3.3",
|
||||
"@polkadot/keyring": "^8.3.3",
|
||||
"@polkadot/networks": "^8.3.3",
|
||||
"@polkadot/phishing": "^0.8.71",
|
||||
"@polkadot/rpc-augment": "^7.5.1",
|
||||
"@polkadot/rpc-core": "^7.5.1",
|
||||
"@polkadot/rpc-provider": "^7.5.1",
|
||||
"@polkadot/types": "^7.5.1",
|
||||
"@polkadot/types-augment": "^7.5.1",
|
||||
"@polkadot/types-codec": "^7.5.1",
|
||||
"@polkadot/types-create": "^7.5.1",
|
||||
"@polkadot/types-known": "^7.5.1",
|
||||
"@polkadot/types-support": "^7.5.1",
|
||||
"@polkadot/util": "^8.3.3",
|
||||
"@polkadot/util-crypto": "^8.3.3",
|
||||
"@polkadot/wasm-crypto": "^4.5.1",
|
||||
"babel-core": "^7.0.0-bridge.0",
|
||||
"styled-components": "^5.3.1",
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
"dependencies": {
|
||||
"@acala-network/type-definitions": "^3.0.2-4",
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@bifrost-finance/type-definitions": "1.3.19",
|
||||
"@bifrost-finance/type-definitions": "1.3.20",
|
||||
"@crustio/type-definitions": "1.2.0",
|
||||
"@darwinia/types": "2.7.2",
|
||||
"@digitalnative/type-definitions": "1.1.27",
|
||||
@ -28,12 +28,12 @@
|
||||
"@metaverse-network-sdk/type-definitions": "^0.0.1-6",
|
||||
"@parallel-finance/type-definitions": "1.4.4",
|
||||
"@phala/typedefs": "0.2.30",
|
||||
"@polkadot/api": "^7.4.2-9",
|
||||
"@polkadot/api-derive": "^7.4.2-9",
|
||||
"@polkadot/networks": "^8.3.2",
|
||||
"@polkadot/types": "^7.4.2-9",
|
||||
"@polkadot/util": "^8.3.2",
|
||||
"@polkadot/x-fetch": "^8.3.2",
|
||||
"@polkadot/api": "^7.5.1",
|
||||
"@polkadot/api-derive": "^7.5.1",
|
||||
"@polkadot/networks": "^8.3.3",
|
||||
"@polkadot/types": "^7.5.1",
|
||||
"@polkadot/util": "^8.3.3",
|
||||
"@polkadot/x-fetch": "^8.3.3",
|
||||
"@polymathnetwork/polymesh-types": "0.0.2",
|
||||
"@snowfork/snowbridge-types": "0.2.6",
|
||||
"@sora-substrate/type-definitions": "1.7.16",
|
||||
|
||||
@ -12,9 +12,9 @@
|
||||
"sideEffects": false,
|
||||
"version": "0.102.2-18",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.16.10",
|
||||
"@babel/core": "^7.16.12",
|
||||
"@babel/polyfill": "^7.12.1",
|
||||
"@polkadot/dev": "^0.65.38",
|
||||
"@polkadot/dev": "^0.65.43",
|
||||
"@polkadot/react-components": "^0.102.2-18",
|
||||
"electron-log": "^4.4.5",
|
||||
"electron-updater": "^4.6.5"
|
||||
|
||||
@ -13,12 +13,12 @@
|
||||
"type": "module",
|
||||
"version": "0.102.2-18",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.16.10",
|
||||
"@babel/core": "^7.16.12",
|
||||
"@babel/polyfill": "^7.12.1",
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/apps-config": "^0.102.2-18",
|
||||
"@polkadot/apps-routing": "^0.102.2-18",
|
||||
"@polkadot/dev": "^0.65.38",
|
||||
"@polkadot/dev": "^0.65.43",
|
||||
"@polkadot/react-api": "^0.102.2-18",
|
||||
"@polkadot/react-components": "^0.102.2-18",
|
||||
"@polkadot/react-hooks": "^0.102.2-18",
|
||||
|
||||
@ -14,9 +14,9 @@
|
||||
"version": "0.102.2-18",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/phishing": "^0.8.68",
|
||||
"@polkadot/phishing": "^0.8.71",
|
||||
"@polkadot/react-components": "^0.102.2-18",
|
||||
"@polkadot/vanitygen": "^0.48.13-0",
|
||||
"@polkadot/vanitygen": "^0.48.13",
|
||||
"detect-browser": "^5.3.0",
|
||||
"file-saver": "^2.0.5"
|
||||
},
|
||||
|
||||
@ -14,6 +14,6 @@
|
||||
"version": "0.102.2-18",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/api-contract": "^7.4.2-9"
|
||||
"@polkadot/api-contract": "^7.5.1"
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,9 +14,9 @@
|
||||
"version": "0.102.2-18",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/api": "^7.4.2-9",
|
||||
"@polkadot/extension-compat-metamask": "^0.42.7-0",
|
||||
"@polkadot/extension-dapp": "^0.42.7-0",
|
||||
"@polkadot/api": "^7.5.1",
|
||||
"@polkadot/extension-compat-metamask": "^0.42.7",
|
||||
"@polkadot/extension-dapp": "^0.42.7",
|
||||
"@substrate/connect": "0.4.6",
|
||||
"fflate": "^0.7.3",
|
||||
"rxjs": "^7.5.2"
|
||||
|
||||
@ -17,15 +17,15 @@
|
||||
"@fortawesome/fontawesome-svg-core": "^1.2.36",
|
||||
"@fortawesome/free-solid-svg-icons": "^5.15.4",
|
||||
"@fortawesome/react-fontawesome": "^0.1.16",
|
||||
"@polkadot/keyring": "^8.3.2",
|
||||
"@polkadot/keyring": "^8.3.3",
|
||||
"@polkadot/react-api": "^0.102.2-18",
|
||||
"@polkadot/react-identicon": "^0.89.2",
|
||||
"@polkadot/react-qr": "^0.89.2",
|
||||
"@polkadot/react-identicon": "^0.89.3",
|
||||
"@polkadot/react-qr": "^0.89.3",
|
||||
"@polkadot/react-query": "^0.102.2-18",
|
||||
"@polkadot/ui-keyring": "^0.89.2",
|
||||
"@polkadot/ui-settings": "^0.89.2",
|
||||
"@polkadot/util": "^8.3.2",
|
||||
"@polkadot/util-crypto": "^8.3.2",
|
||||
"@polkadot/ui-keyring": "^0.89.3",
|
||||
"@polkadot/ui-settings": "^0.89.3",
|
||||
"@polkadot/util": "^8.3.3",
|
||||
"@polkadot/util-crypto": "^8.3.3",
|
||||
"chart.js": "^2.9.4",
|
||||
"codeflask": "^1.4.1",
|
||||
"i18next": "^21.6.7",
|
||||
|
||||
@ -4,14 +4,12 @@
|
||||
import type { IconName } from '@fortawesome/fontawesome-svg-core';
|
||||
import type { QueueStatus, QueueTx, QueueTxStatus } from './types';
|
||||
|
||||
import React, { useCallback, useContext, useEffect, useState } from 'react';
|
||||
import React, { useContext, useEffect, useState } from 'react';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import AddressMini from '../AddressMini';
|
||||
import Button from '../Button';
|
||||
import Icon from '../Icon';
|
||||
import Spinner from '../Spinner';
|
||||
import { useTranslation } from '../translate';
|
||||
import { STATUS_COMPLETE } from './constants';
|
||||
import StatusContext from './Context';
|
||||
|
||||
@ -151,17 +149,14 @@ function filterSt (stqueue?: QueueStatus[]): QueueStatus[] {
|
||||
return (stqueue || []).filter(({ isCompleted }) => !isCompleted);
|
||||
}
|
||||
|
||||
function filterTx (txqueue?: QueueTx[]): [QueueTx[], QueueTx[]] {
|
||||
const allTx = (txqueue || []).filter(({ status }) => !['completed', 'incomplete'].includes(status));
|
||||
|
||||
return [allTx, allTx.filter(({ status }) => STATUS_COMPLETE.includes(status))];
|
||||
function filterTx (txqueue?: QueueTx[]): QueueTx[] {
|
||||
return (txqueue || []).filter(({ status }) => !['completed', 'incomplete'].includes(status));
|
||||
}
|
||||
|
||||
function Status ({ className = '' }: Props): React.ReactElement<Props> | null {
|
||||
const { stqueue, txqueue } = useContext(StatusContext);
|
||||
const [allSt, setAllSt] = useState<QueueStatus[]>([]);
|
||||
const [[allTx, completedTx], setAllTx] = useState<[QueueTx[], QueueTx[]]>([[], []]);
|
||||
const { t } = useTranslation();
|
||||
const [allTx, setAllTx] = useState<QueueTx[]>([]);
|
||||
|
||||
useEffect((): void => {
|
||||
setAllSt(filterSt(stqueue));
|
||||
@ -171,31 +166,12 @@ function Status ({ className = '' }: Props): React.ReactElement<Props> | null {
|
||||
setAllTx(filterTx(txqueue));
|
||||
}, [txqueue]);
|
||||
|
||||
const _onDismiss = useCallback(
|
||||
(): void => {
|
||||
allSt.map((s) => s.removeItem());
|
||||
completedTx.map((t) => t.removeItem());
|
||||
},
|
||||
[allSt, completedTx]
|
||||
);
|
||||
|
||||
if (!allSt.length && !allTx.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={`ui--Status ${className}`}>
|
||||
{(allSt.length + completedTx.length) > 1 && (
|
||||
<div className='dismiss'>
|
||||
<Button
|
||||
icon='times'
|
||||
isBasic
|
||||
isFull
|
||||
label={t<string>('Dismiss all notifications')}
|
||||
onClick={_onDismiss}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{allTx.map(renderItem)}
|
||||
{allSt.map(renderStatus)}
|
||||
</div>
|
||||
@ -223,16 +199,6 @@ export default React.memo(styled(Status)`
|
||||
}
|
||||
}
|
||||
|
||||
.dismiss {
|
||||
margin-bottom: 0.25rem;
|
||||
|
||||
.ui--Button {
|
||||
border: 1px solid white;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.item {
|
||||
display: block;
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
"testcontainers": "^8.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/types-support": "^7.4.2-9",
|
||||
"@polkadot/types-support": "^7.5.1",
|
||||
"@testing-library/jest-dom": "^5.16.1",
|
||||
"tsconfig-paths": "^3.12.0"
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user