Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/web/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"connectUSDC": "Connect your Freighter wallet to deposit USDC and start earning yield automatically.",
"amount": "Amount",
"balance": "Balance",
"max": "Max",
"position": "You have no active position to withdraw from.",
"shares": "Shares",
"waiting": "Waiting for signature...",
Expand Down
1 change: 1 addition & 0 deletions apps/web/messages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"connectUSDC": "Connectez votre portefeuille Freighter pour déposer des USDC et commencer à générer du rendement automatiquement.",
"amount": "Montant",
"balance": "Solde",
"max": "Max",
"position": "Vous n'avez aucune position active à retirer.",
"shares": "Parts",
"waiting": "En attente de signature...",
Expand Down
8 changes: 8 additions & 0 deletions apps/web/src/__tests__/components/WithdrawTab.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ describe("WithdrawTab", () => {
expect(onAmountChange).toHaveBeenCalledWith("50.0000000");
});

it("renders the Max label through the translation key", () => {
renderWithdrawTab();

expect(screen.getByTestId("vault-withdraw-max").textContent).toBe(
"vaultPanel.max: 50.00"
);
});

it("calls onSubmit when the withdraw button is clicked", () => {
renderWithdrawTab({ amount: "10" });

Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/dashboard/WithdrawTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function WithdrawTab({
onClick={() => onAmountChange(position!.shares.toFixed(7))}
className="text-xs text-emerald-500 hover:text-emerald-400 transition-colors duration-150"
>
Max: {position!.shares.toFixed(2)}
{t("vaultPanel.max")}: {position!.shares.toFixed(2)}
</button>
</div>
<AmountInput
Expand Down