Skip to content

Commit 271ef36

Browse files
committed
toast notifications
1 parent 3c5d201 commit 271ef36

2 files changed

Lines changed: 45 additions & 45 deletions

File tree

frontend/src/components/VaultDashboard.tsx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,26 @@ const VaultDashboard: React.FC<VaultDashboardProps> = ({
3333
const value = Number(amount);
3434

3535
if (!walletAddress) {
36-
toast.warning({
37-
title: "Wallet required",
38-
description: "Connect your wallet before submitting a transaction.",
39-
});
36+
toast.warning({
37+
title: "Wallet required",
38+
description: "Connect your wallet before submitting a transaction.",
39+
});
4040
return;
4141
}
4242

4343
if (!amount || Number.isNaN(value) || value <= 0) {
44-
toast.warning({
45-
title: "Enter a valid amount",
46-
description: "Choose a valid USDC amount before submitting the transaction.",
47-
});
44+
toast.warning({
45+
title: "Enter a valid amount",
46+
description: "Choose a valid USDC amount before submitting the transaction.",
47+
});
4848
return;
4949
}
5050

5151
if (actionType === "withdraw" && value > availableBalance) {
52-
toast.warning({
53-
title: "Insufficient balance",
54-
description: "The withdrawal amount exceeds your available USDC balance.",
55-
});
52+
toast.warning({
53+
title: "Insufficient balance",
54+
description: "The withdrawal amount exceeds your available USDC balance.",
55+
});
5656
return;
5757
}
5858

@@ -64,13 +64,13 @@ const VaultDashboard: React.FC<VaultDashboardProps> = ({
6464
);
6565
setAmount("");
6666
setIsProcessing(null);
67-
toast.success({
68-
title: actionType === "deposit" ? "Deposit queued" : "Withdrawal queued",
69-
description:
70-
actionType === "deposit"
71-
? `${value.toFixed(2)} USDC has been added to your pending vault activity.`
72-
: `${value.toFixed(2)} USDC has been added to your pending withdrawal activity.`,
73-
});
67+
toast.success({
68+
title: actionType === "deposit" ? "Deposit queued" : "Withdrawal queued",
69+
description:
70+
actionType === "deposit"
71+
? `${value.toFixed(2)} USDC has been added to your pending vault activity.`
72+
: `${value.toFixed(2)} USDC has been added to your pending withdrawal activity.`,
73+
});
7474
}, 2000);
7575
};
7676

frontend/src/components/WalletConnect.tsx

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ const WalletConnect: React.FC<WalletConnectProps> = ({ walletAddress, onConnect,
3131
}
3232

3333
if (walletAddress) {
34-
onDisconnect();
35-
toast.info({
36-
title: "Wallet disconnected",
37-
description: "Freighter is no longer connected to this session.",
38-
});
39-
}
34+
onDisconnect();
35+
toast.info({
36+
title: "Wallet disconnected",
37+
description: "Freighter is no longer connected to this session.",
38+
});
39+
}
4040
};
4141

4242
syncConnection();
@@ -56,31 +56,31 @@ const WalletConnect: React.FC<WalletConnectProps> = ({ walletAddress, onConnect,
5656
if (allowed.isAllowed) {
5757
const userInfo = await getAddress();
5858
if (userInfo.address) {
59-
onConnect(userInfo.address);
60-
toast.success({
61-
title: t('toast.walletConnected.title'),
62-
description: t('toast.walletConnected.description'),
63-
});
59+
onConnect(userInfo.address);
60+
toast.success({
61+
title: t('toast.walletConnected.title'),
62+
description: t('toast.walletConnected.description'),
63+
});
6464
}
6565
}
6666
const discoveredAddress = await discoverConnectedAddress();
6767
if (discoveredAddress) {
68-
onConnect(discoveredAddress);
69-
toast.success({
70-
title: "Wallet connected",
71-
description: "Freighter is now connected to your YieldVault session.",
72-
});
68+
onConnect(discoveredAddress);
69+
toast.success({
70+
title: "Wallet connected",
71+
description: "Freighter is now connected to your YieldVault session.",
72+
});
7373
} else {
74-
toast.warning({
75-
title: t('toast.walletPermissionRequired.title'),
76-
description: t('toast.walletPermissionRequired.description'),
77-
});
74+
toast.warning({
75+
title: t('toast.walletPermissionRequired.title'),
76+
description: t('toast.walletPermissionRequired.description'),
77+
});
7878
}
7979
} catch (e: unknown) {
80-
console.error(e);
81-
toast.error({
82-
title: t('toast.walletConnectionFailed.title'),
83-
description: t('toast.walletConnectionFailed.description'),
80+
console.error(e);
81+
toast.error({
82+
title: t('toast.walletConnectionFailed.title'),
83+
description: t('toast.walletConnectionFailed.description'),
8484
});
8585
} finally {
8686
setIsConnecting(false);
@@ -138,8 +138,8 @@ const WalletConnect: React.FC<WalletConnectProps> = ({ walletAddress, onConnect,
138138
onClick={() => {
139139
onDisconnect();
140140
toast.info({
141-
title: t('toast.walletDisconnected.title'),
142-
description: t('toast.walletDisconnected.description'),
141+
title: t('toast.walletDisconnected.title'),
142+
description: t('toast.walletDisconnected.description'),
143143
});
144144
}}
145145
aria-label={t('wallet.disconnectAria')}

0 commit comments

Comments
 (0)