diff --git a/apps/dcellar-web-ui/src/components/layout/Header/index.tsx b/apps/dcellar-web-ui/src/components/layout/Header/index.tsx index a3b77170..5e53ed2e 100644 --- a/apps/dcellar-web-ui/src/components/layout/Header/index.tsx +++ b/apps/dcellar-web-ui/src/components/layout/Header/index.tsx @@ -91,7 +91,7 @@ export const Header = ({ taskManagement = true }: { taskManagement?: boolean }) - Available Balance + Greenfield Available Balance { > - + ))} diff --git a/apps/dcellar-web-ui/src/modules/upload/NameItem.tsx b/apps/dcellar-web-ui/src/modules/upload/NameItem.tsx index fa10fe64..5a9d85ec 100644 --- a/apps/dcellar-web-ui/src/modules/upload/NameItem.tsx +++ b/apps/dcellar-web-ui/src/modules/upload/NameItem.tsx @@ -6,11 +6,10 @@ type Props = { name: string; size: number; msg?: string; - maxW: string; status?: string; [key: string]: any; }; -export const NameItem = ({ name, size, msg, maxW, status, ...styleProps }: Props) => { +export const NameItem = ({ name, size, msg, status, ...styleProps }: Props) => { const fileType = contentIconTypeToExtension(name); const icon = ( ); return ( - + {icon} {name} {status && ['CANCEL', 'ERROR'].includes(status) || msg ? ( - {msg} + {msg} ) : ( - {formatBytes(size)} + {formatBytes(size)} )} diff --git a/apps/dcellar-web-ui/src/modules/upload/PathItem.tsx b/apps/dcellar-web-ui/src/modules/upload/PathItem.tsx index fff0bbea..e9aa9030 100644 --- a/apps/dcellar-web-ui/src/modules/upload/PathItem.tsx +++ b/apps/dcellar-web-ui/src/modules/upload/PathItem.tsx @@ -9,9 +9,10 @@ export const PathItem = ({ path, ...styleProps }: Props) => { return ( {path} diff --git a/apps/dcellar-web-ui/src/modules/upload/SimulateFee.tsx b/apps/dcellar-web-ui/src/modules/upload/SimulateFee.tsx index 4f7eb0cc..7ac7743c 100644 --- a/apps/dcellar-web-ui/src/modules/upload/SimulateFee.tsx +++ b/apps/dcellar-web-ui/src/modules/upload/SimulateFee.tsx @@ -8,7 +8,7 @@ import { import { useAppDispatch, useAppSelector } from '@/store'; import { MsgCreateObjectTypeUrl } from '@bnb-chain/greenfield-chain-sdk'; import { Box, Flex, Slide, Text, useDisclosure, Link } from '@totejs/uikit'; -import React, { useMemo } from 'react'; +import React, { useEffect, useMemo } from 'react'; import { useAsyncEffect, useMount } from 'ahooks'; import { WaitFile, setupPreLockFeeObjects, setupTmpAvailableBalance } from '@/store/slices/global'; import { isEmpty } from 'lodash-es'; @@ -65,7 +65,7 @@ export const Fee = () => { ? -1 : waitQueue.filter((item: WaitFile) => item.status !== 'ERROR').length * singleTxGasFee; - useUpdateEffect(() => { + useEffect(() => { if (gasFee && lockFee) { dispatch(setEditUpload({ gasFee: BigNumber(gasFee).toString(DECIMAL_NUMBER), @@ -74,7 +74,7 @@ export const Fee = () => { isBalanceAvailable: BigNumber(availableBalance).minus(BigNumber(gasFee)).minus(BigNumber(lockFee)).isPositive(), })) } - }, [gasFee, lockFee]); + }, [availableBalance, dispatch, gasFee, lockFee]); useMount(() => { dispatch(setupTmpAvailableBalance(loginAccount)); }); diff --git a/apps/dcellar-web-ui/src/modules/upload/TaskManagement.tsx b/apps/dcellar-web-ui/src/modules/upload/TaskManagement.tsx index b3c7d7e0..0b34a432 100644 --- a/apps/dcellar-web-ui/src/modules/upload/TaskManagement.tsx +++ b/apps/dcellar-web-ui/src/modules/upload/TaskManagement.tsx @@ -42,10 +42,22 @@ export const TaskManagement = () => { onToggle()} > - + Task Management diff --git a/apps/dcellar-web-ui/src/modules/upload/UploadObjects.tsx b/apps/dcellar-web-ui/src/modules/upload/UploadObjects.tsx index 6b868126..f3ddc0e8 100644 --- a/apps/dcellar-web-ui/src/modules/upload/UploadObjects.tsx +++ b/apps/dcellar-web-ui/src/modules/upload/UploadObjects.tsx @@ -203,16 +203,17 @@ export const UploadObjects = () => { }, [preLockFeeObjects, selectedFiles]); const checkedQueue = selectedFiles.filter((item) => item.status === 'WAIT'); + console.log(loading, creating, !checkedQueue?.length, !editUpload.isBalanceAvailable, editUpload) return ( Upload Objects {!isEmpty(selectedFiles) && ( - + setActiveKey(key)}> {tabOptions.map((item) => ( - + {item.icon} {item.title}({item.len}) @@ -246,7 +247,7 @@ export const UploadObjects = () => { ), )} {' '} - / {checkedQueue.length} Files + / {checkedQueue.length} Objects diff --git a/apps/dcellar-web-ui/src/modules/upload/UploadProgress.tsx b/apps/dcellar-web-ui/src/modules/upload/UploadProgress.tsx index 5cfb7d10..872c0864 100644 --- a/apps/dcellar-web-ui/src/modules/upload/UploadProgress.tsx +++ b/apps/dcellar-web-ui/src/modules/upload/UploadProgress.tsx @@ -6,9 +6,9 @@ type Props = { }; export const UploadProgress = memo(({ value }: Props) => { return ( - + - + {value}% diff --git a/apps/dcellar-web-ui/src/modules/upload/UploadingObjects.tsx b/apps/dcellar-web-ui/src/modules/upload/UploadingObjects.tsx index 98779a94..556f92b4 100644 --- a/apps/dcellar-web-ui/src/modules/upload/UploadingObjects.tsx +++ b/apps/dcellar-web-ui/src/modules/upload/UploadingObjects.tsx @@ -16,7 +16,7 @@ import { Text, } from '@totejs/uikit'; import { FILE_UPLOAD_STATIC_URL, UPLOAD_TASK_EMPTY_ICON } from '@/modules/file/constant'; -import { ColoredErrorIcon, ColoredSuccessIcon, Icon } from '@totejs/icons'; +import { ColoredAlertIcon, ColoredSuccessIcon } from '@totejs/icons'; import { Loading } from '@/components/common/Loading'; import { UploadFile } from '@/store/slices/global'; import { useTaskManagementTab } from './useTaskManagementTab'; @@ -32,34 +32,40 @@ export const UploadingObjects = () => { case 'WAIT': return ( <> - - waiting + + + Waiting + ); case 'HASH': return ( <> - - hashing + + + Hashing + ); case 'READY': - return + return ; case 'UPLOAD': - return + return ; case 'SEAL': return ( <> - - sealing + + + Sealing + ); case 'FINISH': return ; case 'ERROR': - return ; + return ; case 'CANCEL': - return ; + return ; default: return null; } @@ -99,14 +105,15 @@ export const UploadingObjects = () => { key={item.key} tabKey={item.key} paddingBottom={'8px'} + fontWeight={500} _hover={{ color: 'readable.brand6', - fontWeight: '600', + fontWeight: '500', borderBottom: '3px solid readable.brand6', }} _selected={{ color: 'readable.brand6', - fontWeight: '600', + fontWeight: '500', borderBottom: '3px solid readable.brand6', }} > @@ -139,12 +146,11 @@ export const UploadingObjects = () => { _hover={{}} maxW={'520px'} key={task.id} - paddingX={'6px'} + paddingX={'0'} right={null} display="block" > { size={task.file.size} msg={task.msg} status={task.status} - maxW="200px" - flex="1" + w={300} /> - + diff --git a/apps/dcellar-web-ui/src/modules/upload/useTaskManagementTab.tsx b/apps/dcellar-web-ui/src/modules/upload/useTaskManagementTab.tsx index 233b3177..52e79262 100644 --- a/apps/dcellar-web-ui/src/modules/upload/useTaskManagementTab.tsx +++ b/apps/dcellar-web-ui/src/modules/upload/useTaskManagementTab.tsx @@ -1,5 +1,6 @@ import { useAppSelector } from '@/store'; import { TUploadStatus, UploadFile } from '@/store/slices/global'; +import { ColoredAlertIcon } from '@totejs/icons'; // import { ColoredAlertIcon } from '@totejs/icons'; import { sortBy } from 'lodash-es';