handle cancel tx in wallet and correctly z-sort notifications
This commit is contained in:
parent
cab4fe113c
commit
b5555a7a16
|
@ -89,7 +89,7 @@ const ConnectWalletButton = (props) => {
|
||||||
<span className="text-sm">{name}</span>
|
<span className="text-sm">{name}</span>
|
||||||
|
|
||||||
{provider?.url === url ? (
|
{provider?.url === url ? (
|
||||||
<CheckIcon className="h-4 w-4 text-green-400 stroke-3" />
|
<CheckIcon className="h-4 w-4 stroke-3" />
|
||||||
) : null}
|
) : null}
|
||||||
</button>
|
</button>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
|
|
|
@ -17,6 +17,7 @@ import useVaults from '../hooks/useVaults'
|
||||||
import usePool from '../hooks/usePool'
|
import usePool from '../hooks/usePool'
|
||||||
import styled from '@emotion/styled'
|
import styled from '@emotion/styled'
|
||||||
import 'twin.macro'
|
import 'twin.macro'
|
||||||
|
import { notify } from '../utils/notifications'
|
||||||
|
|
||||||
const SmallButton = styled.button``
|
const SmallButton = styled.button``
|
||||||
|
|
||||||
|
@ -126,10 +127,16 @@ const ContributionModal = () => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (submitting) {
|
if (submitting) {
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
|
try {
|
||||||
await actions.submitContribution(contributionAmount)
|
await actions.submitContribution(contributionAmount)
|
||||||
setSubmitted(true)
|
} catch (e) {
|
||||||
|
notify({ type: 'error', message: e.message })
|
||||||
|
console.error(e.message)
|
||||||
|
} finally {
|
||||||
|
setSubmitted(false)
|
||||||
setSubmitting(false)
|
setSubmitting(false)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
handleSubmit()
|
handleSubmit()
|
||||||
}
|
}
|
||||||
}, [submitting])
|
}, [submitting])
|
||||||
|
|
|
@ -29,7 +29,7 @@ const NotificationList = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={`fixed inset-0 flex items-end px-4 py-6 pointer-events-none sm:p-6`}
|
className={`z-20 fixed inset-0 flex items-end px-4 py-6 pointer-events-none sm:p-6`}
|
||||||
>
|
>
|
||||||
<div className={`flex flex-col w-full`}>
|
<div className={`flex flex-col w-full`}>
|
||||||
{reversedNotifications.map((n, idx) => (
|
{reversedNotifications.map((n, idx) => (
|
||||||
|
@ -59,13 +59,11 @@ const Notification = ({ type, message, description, txid }) => {
|
||||||
<div className={`flex items-center`}>
|
<div className={`flex items-center`}>
|
||||||
<div className={`flex-shrink-0`}>
|
<div className={`flex-shrink-0`}>
|
||||||
{type === 'success' ? (
|
{type === 'success' ? (
|
||||||
<CheckCircleIcon className={`text-green h-9 w-9 mr-1`} />
|
<CheckCircleIcon className={`h-9 w-9 mr-1`} />
|
||||||
) : null}
|
) : null}
|
||||||
{type === 'info' && (
|
{type === 'info' && <XCircleIcon className={`h-9 w-9 mr-1`} />}
|
||||||
<XCircleIcon className={`text-primary h-9 w-9 mr-1`} />
|
|
||||||
)}
|
|
||||||
{type === 'error' && (
|
{type === 'error' && (
|
||||||
<InformationCircleIcon className={`text-red h-9 w-9 mr-1`} />
|
<InformationCircleIcon className={`h-9 w-9 mr-1`} />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className={`ml-2 w-0 flex-1`}>
|
<div className={`ml-2 w-0 flex-1`}>
|
||||||
|
|
Loading…
Reference in New Issue