User account page (#22)
* layout, overview, start on assets, borrows and open orders
* trade history, sortable data hook for tables, borrow page
* handle deposit and withdraw buttons
* borrow modal ui and integration + settle borrow for individual assets
* in orders balance to asset table and totals, responsive css, new connected wallet button + small tweaks
* account switch/creation flow
* accounts modal, update to usebalances hook
* handle settle, deposit before settle, save last account
* disable borrow/withdraw button when no account
2021-06-05 07:11:44 -07:00
|
|
|
import { useState } from 'react'
|
|
|
|
import TradeHistoryTable from '../TradeHistoryTable'
|
|
|
|
|
2021-06-05 09:14:34 -07:00
|
|
|
// const historyViews = ['Trades', 'Deposits', 'Withdrawals', 'Liquidations']
|
User account page (#22)
* layout, overview, start on assets, borrows and open orders
* trade history, sortable data hook for tables, borrow page
* handle deposit and withdraw buttons
* borrow modal ui and integration + settle borrow for individual assets
* in orders balance to asset table and totals, responsive css, new connected wallet button + small tweaks
* account switch/creation flow
* accounts modal, update to usebalances hook
* handle settle, deposit before settle, save last account
* disable borrow/withdraw button when no account
2021-06-05 07:11:44 -07:00
|
|
|
|
|
|
|
export default function AccountHistory() {
|
2021-06-05 09:14:34 -07:00
|
|
|
const [view] = useState('Trades')
|
User account page (#22)
* layout, overview, start on assets, borrows and open orders
* trade history, sortable data hook for tables, borrow page
* handle deposit and withdraw buttons
* borrow modal ui and integration + settle borrow for individual assets
* in orders balance to asset table and totals, responsive css, new connected wallet button + small tweaks
* account switch/creation flow
* accounts modal, update to usebalances hook
* handle settle, deposit before settle, save last account
* disable borrow/withdraw button when no account
2021-06-05 07:11:44 -07:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<div className="flex items-center justify-between pb-3.5 sm:pt-1">
|
|
|
|
<div className="text-th-fgd-1 text-lg">{view.slice(0, -1)} History</div>
|
|
|
|
{/* Todo: add this back when the data is available */}
|
|
|
|
{/* <div className="flex">
|
|
|
|
{historyViews.map((section) => (
|
|
|
|
<div
|
|
|
|
className={`border px-3 py-1.5 mr-2 rounded cursor-pointer default-transition
|
|
|
|
${
|
|
|
|
view === section
|
|
|
|
? `bg-th-bkg-3 border-th-bkg-3 text-th-primary`
|
|
|
|
: `border-th-fgd-4 text-th-fgd-1 opacity-80 hover:opacity-100`
|
|
|
|
}
|
|
|
|
`}
|
|
|
|
onClick={() => setView(section)}
|
|
|
|
key={section as string}
|
|
|
|
>
|
|
|
|
{section}
|
|
|
|
</div>
|
|
|
|
))}
|
|
|
|
</div> */}
|
|
|
|
</div>
|
|
|
|
<ViewContent view={view} />
|
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
const ViewContent = ({ view }) => {
|
|
|
|
switch (view) {
|
|
|
|
case 'Trades':
|
|
|
|
return <TradeHistoryTable />
|
|
|
|
case 'Deposits':
|
|
|
|
return <div>Deposits</div>
|
|
|
|
case 'Withdrawals':
|
|
|
|
return <div>Withdrawals</div>
|
|
|
|
case 'Liquidations':
|
|
|
|
return <div>Liquidations</div>
|
|
|
|
default:
|
|
|
|
return <TradeHistoryTable />
|
|
|
|
}
|
|
|
|
}
|