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 { FunctionComponent, ReactNode } from 'react'
|
2021-08-24 09:28:25 -07:00
|
|
|
import useMangoStore from '../stores/useMangoStore'
|
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 Button from './Button'
|
|
|
|
|
|
|
|
interface EmptyStateProps {
|
|
|
|
buttonText?: string
|
|
|
|
icon: ReactNode
|
|
|
|
onClickButton?: () => void
|
|
|
|
desc?: string
|
|
|
|
title: string
|
|
|
|
}
|
|
|
|
|
|
|
|
const EmptyState: FunctionComponent<EmptyStateProps> = ({
|
|
|
|
buttonText,
|
|
|
|
icon,
|
|
|
|
onClickButton,
|
|
|
|
desc,
|
|
|
|
title,
|
|
|
|
}) => {
|
2021-08-24 09:28:25 -07:00
|
|
|
const wallet = useMangoStore((s) => s.wallet.current)
|
|
|
|
|
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 flex-col items-center text-th-fgd-1 px-4 pb-2 rounded-lg">
|
|
|
|
<div className="w-6 h-6 mb-1 text-th-primary">{icon}</div>
|
2021-07-22 04:34:03 -07:00
|
|
|
<div className="font-bold text-base pb-1">{title}</div>
|
|
|
|
{desc ? (
|
|
|
|
<p
|
|
|
|
className={`text-center ${
|
|
|
|
buttonText && onClickButton ? 'mb-1' : 'mb-0'
|
|
|
|
}`}
|
|
|
|
>
|
|
|
|
{desc}
|
|
|
|
</p>
|
|
|
|
) : null}
|
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
|
|
|
{buttonText && onClickButton ? (
|
2021-08-24 09:28:25 -07:00
|
|
|
<Button className="mt-2" onClick={onClickButton} disabled={!wallet}>
|
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
|
|
|
{buttonText}
|
|
|
|
</Button>
|
|
|
|
) : null}
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default EmptyState
|