Merge pull request #38 from mars-protocol/v1.6.1

v1.6.1
This commit is contained in:
Linkie Link 2023-08-04 12:53:17 +02:00 committed by GitHub
commit 7e5281b011
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 3 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "mars", "name": "mars",
"homepage": "./", "homepage": "./",
"version": "1.6.0", "version": "1.6.1",
"license": "SEE LICENSE IN LICENSE FILE", "license": "SEE LICENSE IN LICENSE FILE",
"private": false, "private": false,
"scripts": { "scripts": {
@ -22,11 +22,10 @@
"@cosmjs/launchpad": "^0.27.1", "@cosmjs/launchpad": "^0.27.1",
"@cosmjs/proto-signing": "^0.31.0", "@cosmjs/proto-signing": "^0.31.0",
"@cosmjs/stargate": "^0.31.0", "@cosmjs/stargate": "^0.31.0",
"@marsprotocol/wallet-connector": "^1.9.6", "@marsprotocol/wallet-connector": "^2.0.2",
"@material-ui/core": "^4.12.4", "@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3", "@material-ui/icons": "^4.11.3",
"@ramonak/react-progress-bar": "^5.0.3", "@ramonak/react-progress-bar": "^5.0.3",
"@sentry/nextjs": "^7.36.0",
"@tanstack/react-query": "^4.24.4", "@tanstack/react-query": "^4.24.4",
"@tanstack/react-table": "^8.7.9", "@tanstack/react-table": "^8.7.9",
"@testing-library/dom": "^8.20.0", "@testing-library/dom": "^8.20.0",

View File

@ -1,4 +1,5 @@
import { ColumnDef, createColumnHelper } from '@tanstack/react-table' import { ColumnDef, createColumnHelper } from '@tanstack/react-table'
import BigNumber from 'bignumber.js'
import { AnimatedNumber, Button, CellAmount, SVG, TextTooltip } from 'components/common' import { AnimatedNumber, Button, CellAmount, SVG, TextTooltip } from 'components/common'
import Image from 'next/image' import Image from 'next/image'
import { useMemo } from 'react' import { useMemo } from 'react'
@ -49,6 +50,11 @@ export const useBorrowColumns = () => {
}), }),
columnHelper.accessor('borrowBalance', { columnHelper.accessor('borrowBalance', {
enableSorting: enableSorting, enableSorting: enableSorting,
sortingFn: (a, b): number => {
const balanceA = new BigNumber(a.original.borrowBalance).shiftedBy(-a.original.decimals)
const balanceB = new BigNumber(b.original.borrowBalance).shiftedBy(-b.original.decimals)
return balanceA.minus(balanceB).toNumber()
},
header: () => ( header: () => (
<TextTooltip <TextTooltip
text={t('common.borrowed')} text={t('common.borrowed')}

View File

@ -1,4 +1,5 @@
import { ColumnDef, createColumnHelper } from '@tanstack/react-table' import { ColumnDef, createColumnHelper } from '@tanstack/react-table'
import BigNumber from 'bignumber.js'
import classNames from 'classnames' import classNames from 'classnames'
import { AnimatedNumber, Apr, Button, CellAmount, SVG, TextTooltip } from 'components/common' import { AnimatedNumber, Apr, Button, CellAmount, SVG, TextTooltip } from 'components/common'
import { convertPercentage } from 'functions' import { convertPercentage } from 'functions'
@ -53,6 +54,11 @@ export const useDepositColumns = () => {
}), }),
columnHelper.accessor('depositBalance', { columnHelper.accessor('depositBalance', {
enableSorting: enableSorting, enableSorting: enableSorting,
sortingFn: (a, b): number => {
const balanceA = new BigNumber(a.original.depositBalance).shiftedBy(-a.original.decimals)
const balanceB = new BigNumber(b.original.depositBalance).shiftedBy(-b.original.decimals)
return balanceA.minus(balanceB).toNumber()
},
header: () => ( header: () => (
<TextTooltip <TextTooltip
text={t('common.deposited')} text={t('common.deposited')}