From 1848cc5ecb7bb3bfa6e38fd2a753907ee154d770 Mon Sep 17 00:00:00 2001 From: Panteleymonchuk Date: Wed, 4 Dec 2024 11:13:13 +0200 Subject: [PATCH] refactor(dashboard): rename callbacks for clarity in AssetDialog --- .../components/Dialogs/Assets/AssetDialog.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/wallet-dashboard/components/Dialogs/Assets/AssetDialog.tsx b/apps/wallet-dashboard/components/Dialogs/Assets/AssetDialog.tsx index cb3262e08a1..502ff5a41ba 100644 --- a/apps/wallet-dashboard/components/Dialogs/Assets/AssetDialog.tsx +++ b/apps/wallet-dashboard/components/Dialogs/Assets/AssetDialog.tsx @@ -26,7 +26,7 @@ const INITIAL_VALUES: FormValues = { to: '', }; -export function AssetDialog({ onClose: onCloseCb, onSent, asset }: AssetsDialogProps): JSX.Element { +export function AssetDialog({ onClose, onSent, asset }: AssetsDialogProps): JSX.Element { const [view, setView] = useState(AssetsDialogView.Details); const account = useCurrentAccount(); const activeAddress = account?.address ?? ''; @@ -47,7 +47,7 @@ export function AssetDialog({ onClose: onCloseCb, onSent, asset }: AssetsDialogP try { await sendAsset.mutateAsync(values.to); addNotification('Transfer transaction successful', NotificationType.Success); - onCloseCb(); + onClose(); setView(AssetsDialogView.Details); await new Promise((resolve) => setTimeout(resolve, 1000)); onSent?.(); @@ -63,19 +63,19 @@ export function AssetDialog({ onClose: onCloseCb, onSent, asset }: AssetsDialogP function onSendViewBack() { setView(AssetsDialogView.Details); } - function onClose() { + function onOpenChange() { setView(AssetsDialogView.Details); - onCloseCb(); + onClose(); } return ( - + <> {view === AssetsDialogView.Details && ( - + )} {view === AssetsDialogView.Send && ( - + )}