Skip to content

Commit

Permalink
feat(dcellar-web-ui): add ts check on pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
devinxl committed Jul 30, 2023
1 parent b137300 commit b25b7d6
Show file tree
Hide file tree
Showing 10 changed files with 669 additions and 21 deletions.
6 changes: 4 additions & 2 deletions apps/dcellar-web-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
"eslint": "8.39.0",
"husky": "^8.0.3",
"lint-staged": "^13.1.1",
"prettier": "^2.8.4"
"prettier": "^2.8.4",
"tsc-files": "~1.1.4"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
Expand All @@ -76,7 +77,8 @@
],
"*.{css,less,md}": [
"prettier --write"
]
],
"*.ts?(x)": "tsc-files --noEmit"
},
"prettier": "@totejs/prettier-config",
"eslintConfig": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const DeleteBucket = ({ isOpen, onClose, bucketName, refetch, sp }: any)
const { _availableBalance: availableBalance } = useAppSelector((root) => root.global);
const balance = BigNumber(availableBalance || 0);
const { chain } = useNetwork();
const { gasList } = useAppSelector((root) => root.global.gasHub);
const { gasObjects } = useAppSelector((root) => root.global.gasHub);

useEffect(() => {
if (!isOpen) return;
Expand All @@ -51,7 +51,7 @@ export const DeleteBucket = ({ isOpen, onClose, bucketName, refetch, sp }: any)

const requestGetBucketFee = useCallback(async () => {
setIsGasLoading(true);
const decimalGasFee = await getDeleteBucketFee(gasList);
const decimalGasFee = await getDeleteBucketFee(gasObjects);
const [data, error] = await preExecDeleteBucket(bucketName, address);
if (error) {
if (error.toLowerCase().includes('not empty')) {
Expand All @@ -60,7 +60,7 @@ export const DeleteBucket = ({ isOpen, onClose, bucketName, refetch, sp }: any)
}
setGasFee(BigNumber(decimalGasFee));
setIsGasLoading(false);
}, [address, bucketName, gasList]);
}, [address, bucketName, gasObjects]);

useEffect(() => {
if (isEmpty(chain)) return;
Expand Down
4 changes: 2 additions & 2 deletions apps/dcellar-web-ui/src/modules/upload/SimulateFee.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export const Fee = () => {
<Flex display={'flex'} flexDirection={'column'} gap={'4px'} paddingTop={'4px'}>
{renderFee(
'Pre-locked storage fee',
lockFee,
lockFee + '',
+exchangeRate,
<Tips
iconSize={'14px'}
Expand Down Expand Up @@ -171,7 +171,7 @@ export const Fee = () => {
{/*todo correct the error showing logics*/}
<Text fontSize={'12px'} lineHeight={'16px'} color={'scene.danger.normal'}>
{!isChecking &&
renderInsufficientBalance(gasFee + '', lockFee, availableBalance || '0', {
renderInsufficientBalance(gasFee + '', lockFee + '', availableBalance || '0', {
gaShowName: 'dc.file.upload_modal.transferin.show',
gaClickName: 'dc.file.upload_modal.transferin.click',
})}
Expand Down
8 changes: 8 additions & 0 deletions common/autoinstallers/rush-plugins/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "rush-plugins",
"version": "1.0.0",
"private": true,
"dependencies": {
"rush-lint-staged-plugin": "0.1.6"
}
}
Loading

0 comments on commit b25b7d6

Please sign in to comment.