diff --git a/src/components/Modals/Account/AccountDeleteAlertDialog.tsx b/src/components/Modals/Account/AccountDeleteAlertDialog.tsx index 750f68f7..38ad936b 100644 --- a/src/components/Modals/Account/AccountDeleteAlertDialog.tsx +++ b/src/components/Modals/Account/AccountDeleteAlertDialog.tsx @@ -5,7 +5,7 @@ import useAlertDialog from 'hooks/useAlertDialog' interface Props { title: string - description: string + description: string | JSX.Element closeHandler: () => void positiveButton: AlertDialogButton } diff --git a/src/components/Modals/Account/AccountDeleteModal.tsx b/src/components/Modals/Account/AccountDeleteModal.tsx index 65ecd464..622988a3 100644 --- a/src/components/Modals/Account/AccountDeleteModal.tsx +++ b/src/components/Modals/Account/AccountDeleteModal.tsx @@ -2,10 +2,8 @@ import { useCallback, useMemo, useState } from 'react' import { useLocation, useNavigate, useParams } from 'react-router-dom' import AssetBalanceRow from 'components/AssetBalanceRow' -import Button from 'components/Button' import { ArrowRight } from 'components/Icons' -import Modal from 'components/Modal' -import AccoundDeleteAlertDialog from 'components/Modals/Account/AccountDeleteAlertDialog' +import AccountDeleteAlertDialog from 'components/Modals/Account/AccountDeleteAlertDialog' import Text from 'components/Text' import useStore from 'store' import { BNCoin } from 'types/classes/BNCoin' @@ -56,7 +54,7 @@ function AccountDeleteModal(props: Props) { if (debts.length > 0) return ( - 0) return ( - - {`Delete Credit Account ${modal.id}`} - - } - modalClassName='max-w-modal-sm' - headerClassName='gradient-header p-4 border-b-white/5 border-b' - contentClassName='w-full' - > -
- - The following assets within your credit account will be sent to your wallet. - -
-
- {depositsAndLends.map((position, index) => { - const coin = BNCoin.fromDenomAndBigNumber(position.denom, position.amount) - const asset = getAssetByDenom(position.denom) + + + The following assets within your credit account will be sent to your wallet. + +
+ {depositsAndLends.map((position, index) => { + const coin = BNCoin.fromDenomAndBigNumber(position.denom, position.amount) + const asset = getAssetByDenom(position.denom) - if (!asset) return null - return - })} -
-
-
- + if (!asset) return null + return + })} +
+ + } + closeHandler={closeDeleteAccountModal} + positiveButton={{ + text: 'Delete Account', + icon: , + isAsync: true, + onClick: deleteAccountHandler, + }} + /> ) } \ No newline at end of file diff --git a/src/components/Modals/AlertDialog/index.tsx b/src/components/Modals/AlertDialog/index.tsx index 48e8b948..69f660b5 100644 --- a/src/components/Modals/AlertDialog/index.tsx +++ b/src/components/Modals/AlertDialog/index.tsx @@ -1,5 +1,5 @@ -import { useState } from 'react' import classNames from 'classnames' +import { useState } from 'react' import Button from 'components/Button' import { ExclamationMarkCircled } from 'components/Icons' @@ -34,7 +34,7 @@ function AlertDialog(props: Props) { async function handleAsyncButtonClick(button?: AlertDialogButton) { if (!button?.onClick) return setIsConfirming(true) - await button.onClick() + button.onClick() setIsConfirming(false) props.close() } @@ -60,7 +60,7 @@ function AlertDialog(props: Props) { {positiveButton && (