Skip to content

Commit

Permalink
chore: merge recent commits
Browse files Browse the repository at this point in the history
  • Loading branch information
nick134-bit committed Aug 18, 2023
1 parent 303c293 commit 598b9b9
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 50 deletions.
2 changes: 1 addition & 1 deletion components/InfoTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const IncentiveTooltip = ({ IconSize }) => (
<InfoTooltip
IconSize={IconSize}
description={
'The Incentive Flow Creator can close their flows anytime after the set timeframe. All unclaimed tokens will be clawed back. '
'The Incentive Flow Creator can close their flows anytime. All unclaimed tokens will be clawed back.'
}
/>
)
Expand Down
11 changes: 1 addition & 10 deletions components/Pages/Liquidity/DepositForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,6 @@ const DepositForm = ({
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [tx?.txStep])

const errorButtonMessage = () => {
if (tx?.error) {
if (tx.error.includes('sentFunds: invalid coins')) {
return 'Insufficient Funds'
}
}
}

const buttonLabel = useMemo(() => {
if (connected !== WalletStatusType.connected) {
Expand All @@ -144,9 +137,7 @@ const DepositForm = ({
return 'Enter Amount'
} else if (tx?.buttonLabel) {
return tx?.buttonLabel
} else if (errorButtonMessage()) {
return errorButtonMessage()
}
}
return 'Deposit'
}, [tx?.buttonLabel, tokenB.tokenSymbol, connected, amountA])

Expand Down
2 changes: 1 addition & 1 deletion components/Pages/Liquidity/Multiplicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const incentiveDisclaimer = (incentivized) => {
<InfoTooltip
IconSize={'3'}
description={
'This Pool is currently incentivized. After the incentivized Timeframe, the creator can clawback all unclaimed rewards at anytime. '
'This Pool is currently incentivized. The creator can clawback all unclaimed rewards at anytime. Claim them regularly.'
}
/>
)
Expand Down
73 changes: 35 additions & 38 deletions components/Pages/Pools/MyPoolsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,113 +9,112 @@ import {
Tfoot,
Th,
Thead,
Tr,
Tr
} from '@chakra-ui/react'
import {
createColumnHelper,
flexRender,
getCoreRowModel,
useReactTable,
useReactTable
} from '@tanstack/react-table'

import { IncentiveTooltip } from '../../InfoTooltip'
import Loader from '../../Loader'
import Apr from './components/Apr'
import Liquidity from './components/liquidity'
import PoolName from './components/PoolName'
import { Pool } from './types'
import { IncentiveTooltip } from '../../InfoTooltip'
import Liquidity from './components/liquidity'

const columnHelper = createColumnHelper<Pool>()

const columns = [
columnHelper.accessor('pool', {
header: () => <Text color="brand.50">Pool</Text>,
cell: (info) => (
'header': () => <Text color="brand.50">Pool</Text>,
'cell': (info) => (
<PoolName
poolId={info.getValue()}
token1Img={info.row.original?.token1Img}
token2Img={info.row.original?.token2Img}
/>
),
)
}),
columnHelper.accessor('price', {
header: () => (
'header': () => (
<Text align="right" color="brand.50">
{'RATIO'}
</Text>
),
cell: (info) => <Text align="right">{info.getValue()}</Text>,
'cell': (info) => <Text align="right">{info.getValue()}</Text>
}),
columnHelper.accessor('apr', {
header: () => (
'header': () => (
<Text align="right" color="brand.50">
{'APR'}
</Text>
),
cell: (info) =>
info.getValue() === 'n/a' ? (
<Text>{info.getValue()}</Text>
) : (
<Apr
apr={info.getValue()?.toString()}
flows={info.row.original.flows}
/>
),
'cell': (info) => (info.getValue() === 'n/a' ? (
<Text>{info.getValue()}</Text>
) : (
<Apr
apr={info.getValue()?.toString()}
flows={info.row.original.flows}
/>
))
}),
columnHelper.accessor('volume24hr', {
header: () => (
'header': () => (
<Text align="right" color="brand.50">
{'24hr Volume'}
</Text>
),
cell: (info) => <Text align="right">{info.getValue()}</Text>,
'cell': (info) => <Text align="right">{info.getValue()}</Text>
}),
columnHelper.accessor('totalLiq', {
header: () => (
'header': () => (
<Text align="right" color="brand.50">
{'Total Liquidity'}
</Text>
),
cell: (info) => (
'cell': (info) => (
<Liquidity
liquidity={info.getValue()?.toString()}
infos={info.row.original}
/>
),
)
}),
columnHelper.accessor('myPosition', {
header: () => (
'header': () => (
<Text align="right" color="brand.50">
{'My Position'}
</Text>
),
cell: (info) => <Text align="right">${info.getValue()}</Text>,
'cell': (info) => <Text align="right">${info.getValue()}</Text>
}),
columnHelper.accessor('incentives', {
header: () => (
'header': () => (
<HStack paddingTop={'4'}>
<IncentiveTooltip IconSize={'3'} />
<Text align="left" color="brand.50">
{'Incentives'}
</Text>
</HStack>
),
cell: (info) => info.getValue(),
'cell': (info) => info.getValue()
}),
columnHelper.accessor('action', {
header: () => (
'header': () => (
<Text align="left" color="brand.50">
Action
</Text>
),
cell: (info) => info.getValue(),
}),
'cell': (info) => info.getValue()
})
]

const PoolsTable = ({
show,
pools,
isLoading,
isLoading
}: {
show: boolean
pools: Pool[]
Expand All @@ -125,9 +124,9 @@ const PoolsTable = ({
return null
}
const table = useReactTable({
data: pools,
'data': pools,
columns,
getCoreRowModel: getCoreRowModel(),
'getCoreRowModel': getCoreRowModel()
})

if (isLoading || !pools) {
Expand Down Expand Up @@ -200,10 +199,8 @@ const PoolsTable = ({
>
{header.isPlaceholder
? null
: flexRender(
header.column.columnDef.header,
header.getContext()
)}
: flexRender(header.column.columnDef.header,
header.getContext())}
</Th>
))}
</Tr>
Expand Down

0 comments on commit 598b9b9

Please sign in to comment.