mars-v2-frontend/src/components/Earn/vault/VaultExpanded.tsx
Bob van der Helm cd5ec3ee3b
Mp 2540 farm overview (#172)
* tidy: refactor text

* tidy: refactor text

* fix display of vaults table

* feat: added unstyled select

* tidy: useToggle

* tidy: useToggle

* add vaults to types

* MP-2344: first unstyled version of Select

* fix: fixed the build

* MP-2344: progress on the Select

* MP-2344: almost finished the Select

* implement basic vault modal (no logic)

* 🍱  max + displaycur for token input

* Convert to BN for TokenInputs

* env: update wallet-connector

* fix: fixed build errors and relative imports

* fix: updated TokenInput

* tidy: format

* fix: BN instead of new BigNumber

---------

Co-authored-by: Linkie Link <linkielink.dev@gmail.com>
2023-05-02 09:55:32 +02:00

54 lines
1.5 KiB
TypeScript

import { Row } from '@tanstack/react-table'
import VaultCard from 'components/Earn/vault/VaultCard'
import Text from 'components/Text'
import useStore from 'store'
interface Props {
row: Row<Vault>
resetExpanded: (defaultState?: boolean | undefined) => void
}
export default function VaultExpanded(props: Props) {
function enterVaultHandler() {
useStore.setState({ vaultModal: { vault: props.row.original } })
}
return (
<tr
key={props.row.id}
className='cursor-pointer bg-black/20 transition-colors'
onClick={(e) => {
e.preventDefault()
const isExpanded = props.row.getIsExpanded()
props.resetExpanded()
!isExpanded && props.row.toggleExpanded()
}}
>
<td colSpan={5}>
<Text className='border-b border-white/10 px-4 py-5 '>Select bonding period</Text>
<div className='grid grid-cols-3 md:[&>div:nth-child(3)]:border-none'>
<VaultCard
vault={props.row.original}
title='1 day unbonding'
subtitle='$0 deposited'
unbondingPeriod={1}
/>
<VaultCard
vault={props.row.original}
title='7 day unbonding'
subtitle='$0 deposited'
unbondingPeriod={7}
/>
<VaultCard
vault={props.row.original}
title='14 day unbonding'
subtitle='$0 deposited'
unbondingPeriod={14}
/>
</div>
</td>
</tr>
)
}