revert button text change and remove extra notifications

This commit is contained in:
Tyler Shipe 2021-04-15 11:57:00 -04:00
parent e6909363a7
commit e765ffa3d7
6 changed files with 6 additions and 29 deletions

View File

@ -17,7 +17,7 @@ const Button: FunctionComponent<ButtonProps> = ({
<button <button
onClick={onClick} onClick={onClick}
disabled={disabled} disabled={disabled}
className={`${className} text-th-fgd-3 px-6 py-2 border border-th-fgd-4 bg-th-bkg-2 rounded-md className={`${className} px-6 py-2 border border-th-fgd-4 bg-th-bkg-2 rounded-md
active:border-mango-yellow hover:bg-th-bkg-3 focus:outline-none disabled:bg-th-bkg-2 active:border-mango-yellow hover:bg-th-bkg-3 focus:outline-none disabled:bg-th-bkg-2
disabled:text-th-fgd-4 disabled:cursor-not-allowed`} disabled:text-th-fgd-4 disabled:cursor-not-allowed`}
{...props} {...props}

View File

@ -64,15 +64,11 @@ const DepositModal = ({ isOpen, onClose }) => {
selectedAccount.publicKey, selectedAccount.publicKey,
Number(inputAmount) Number(inputAmount)
) )
.then((response: Array<any>) => { .then((_response: Array<any>) => {
actions.fetchWalletBalances() actions.fetchWalletBalances()
actions.fetchMangoGroup() actions.fetchMangoGroup()
actions.fetchMarginAccounts() actions.fetchMarginAccounts()
setSubmitting(false) setSubmitting(false)
notify({
message: `Deposited ${inputAmount} into your account`,
txid: response[1],
})
onClose() onClose()
}) })
.catch((err) => { .catch((err) => {
@ -96,15 +92,11 @@ const DepositModal = ({ isOpen, onClose }) => {
selectedAccount.publicKey, selectedAccount.publicKey,
Number(inputAmount) Number(inputAmount)
) )
.then((response: string) => { .then((_response: string) => {
actions.fetchWalletBalances() actions.fetchWalletBalances()
actions.fetchMangoGroup() actions.fetchMangoGroup()
actions.fetchMarginAccounts() actions.fetchMarginAccounts()
setSubmitting(false) setSubmitting(false)
notify({
message: `Deposited ${inputAmount} into your account`,
txid: `${response}`,
})
onClose() onClose()
}) })
.catch((err) => { .catch((err) => {

View File

@ -65,11 +65,6 @@ const DepositSrmModal = ({ isOpen, onClose }) => {
actions.fetchMangoSrmAccounts() actions.fetchMangoSrmAccounts()
actions.fetchWalletBalances() actions.fetchWalletBalances()
actions.fetchMangoGroup() actions.fetchMangoGroup()
notify({
message: `Deposited ${inputAmount} SRM into your account`,
description: ``,
type: 'info',
})
onClose() onClose()
}) })
.catch((err) => { .catch((err) => {

View File

@ -16,7 +16,7 @@ const NotificationList = () => {
setMangoStore((state) => { setMangoStore((state) => {
state.notifications = notifications.slice(1, notifications.length) state.notifications = notifications.slice(1, notifications.length)
}) })
}, 6000) }, 5000)
return () => { return () => {
clearInterval(id) clearInterval(id)

View File

@ -63,15 +63,10 @@ const WithdrawModal = ({ isOpen, onClose }) => {
selectedAccount.publicKey, selectedAccount.publicKey,
Number(inputAmount) Number(inputAmount)
) )
.then((transSig: string) => { .then((_transSig: string) => {
setSubmitting(false) setSubmitting(false)
actions.fetchMangoGroup() actions.fetchMangoGroup()
actions.fetchMarginAccounts() actions.fetchMarginAccounts()
notify({
message: `Withdrew ${inputAmount} ${symbol} into your account`,
txid: `${transSig}`,
type: 'info',
})
onClose() onClose()
}) })
.catch((err) => { .catch((err) => {

View File

@ -54,13 +54,8 @@ const WithdrawModal = ({ isOpen, onClose }) => {
walletSrmAccount.publicKey, walletSrmAccount.publicKey,
Number(inputAmount) Number(inputAmount)
) )
.then((transSig: string) => { .then((_transSig: string) => {
setSubmitting(false) setSubmitting(false)
notify({
message: `Withdrew ${inputAmount} SRM into your account`,
txid: `${transSig}`,
type: 'info',
})
onClose() onClose()
actions.fetchWalletBalances() actions.fetchWalletBalances()
actions.fetchMangoSrmAccounts() actions.fetchMangoSrmAccounts()