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 } from 'react'
|
|
|
|
import {
|
|
|
|
CheckCircleIcon,
|
|
|
|
ExclamationCircleIcon,
|
|
|
|
ExclamationIcon,
|
2021-10-26 07:25:36 -07:00
|
|
|
InformationCircleIcon,
|
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
|
|
|
} from '@heroicons/react/outline'
|
|
|
|
|
|
|
|
interface InlineNotificationProps {
|
2021-11-09 16:34:03 -08:00
|
|
|
desc?: string | (() => string)
|
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
|
|
|
title?: string
|
|
|
|
type: string
|
|
|
|
}
|
|
|
|
|
|
|
|
const InlineNotification: FunctionComponent<InlineNotificationProps> = ({
|
|
|
|
desc,
|
|
|
|
title,
|
|
|
|
type,
|
|
|
|
}) => (
|
|
|
|
<div
|
|
|
|
className={`border ${
|
|
|
|
type === 'error'
|
|
|
|
? 'border-th-red'
|
|
|
|
: type === 'success'
|
|
|
|
? 'border-th-green'
|
2021-10-26 07:25:36 -07:00
|
|
|
: type === 'info'
|
|
|
|
? 'border-th-bkg-4'
|
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
|
|
|
: 'border-th-orange'
|
2021-10-26 07:25:36 -07:00
|
|
|
} flex items-center p-2 rounded-md`}
|
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
|
|
|
>
|
|
|
|
{type === 'error' ? (
|
|
|
|
<ExclamationCircleIcon className="flex-shrink-0 h-5 w-5 mr-2 text-th-red" />
|
|
|
|
) : null}
|
|
|
|
{type === 'success' ? (
|
|
|
|
<CheckCircleIcon className="flex-shrink-0 h-5 w-5 mr-2 text-th-green" />
|
|
|
|
) : null}
|
|
|
|
{type === 'warning' ? (
|
|
|
|
<ExclamationIcon className="flex-shrink-0 h-5 w-5 mr-2 text-th-orange" />
|
|
|
|
) : null}
|
2021-10-26 07:25:36 -07:00
|
|
|
{type === 'info' ? (
|
|
|
|
<InformationCircleIcon className="flex-shrink-0 h-5 w-5 mr-2 text-th-fgd-3" />
|
|
|
|
) : 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
|
|
|
<div>
|
2021-10-26 07:25:36 -07:00
|
|
|
<div className="text-th-fgd-3">{title}</div>
|
|
|
|
<div
|
|
|
|
className={`${
|
|
|
|
title && desc && 'pt-1'
|
|
|
|
} font-normal text-xs text-th-fgd-3`}
|
|
|
|
>
|
|
|
|
{desc}
|
|
|
|
</div>
|
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
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
|
|
|
|
export default InlineNotification
|