Skip to content

Commit 861fe14

Browse files
committed
fix: address CodeRabbit review — i18n and Trigger Redemption CTA
- Replace hardcoded 'Trigger Redemption →' button with Link to /force-redemption and use tDetail('triggerRedemptionCta') for i18n compliance - Add useTranslations to deployments/page.tsx ContractCard and replace hardcoded warning/danger status strings with tDeploy('warningStatus') and tDeploy('dangerStatus') - Add triggerRedemptionCta, warningStatus, dangerStatus keys to en.json
1 parent a9b118a commit 861fe14

3 files changed

Lines changed: 16 additions & 6 deletions

File tree

app/deployments/[id]/DeploymentDetailClient.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,10 +336,13 @@ export default function DeploymentDetailClient({ id }: { id: string }) {
336336
<p className="text-xs text-red-500 leading-5">
337337
{tDetail("activeDesc")}
338338
</p>
339-
<button className="flex items-center justify-center gap-2 w-full py-2.5 rounded-full bg-red-500 hover:bg-red-600 text-white text-xs font-bold transition">
339+
<Link
340+
href="/force-redemption"
341+
className="flex items-center justify-center gap-2 w-full py-2.5 rounded-full bg-red-500 hover:bg-red-600 text-white text-xs font-bold transition"
342+
>
340343
<span className="h-1.5 w-1.5 rounded-full bg-white animate-ping flex-shrink-0" />
341-
Trigger Redemption →
342-
</button>
344+
{tDetail("triggerRedemptionCta")}
345+
</Link>
343346
</div>
344347
) : d.status === "warning" ? (
345348
<div className="rounded-xl bg-amber-50 border border-amber-200 p-4">

app/deployments/page.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Navbar from "@/components/Navbar";
88
import type { RatioStatus, Deployment } from "@/lib/deployments-data";
99
import { DEPLOYMENTS } from "@/lib/deployments-data";
1010
import { statusCfg, pct } from "@/lib/deployments-ui";
11+
import { useTranslations } from "@/lib/i18n";
1112

1213

1314
const CHAINS = [
@@ -53,6 +54,7 @@ function StatusBadge({ status }: { status: RatioStatus }) {
5354
/* ─── Contract Card — clean summary card, single Open button ─── */
5455
function ContractCard({ d }: { d: Deployment }) {
5556
const c = statusCfg(d.status);
57+
const tDeploy = useTranslations("deployments");
5658
return (
5759
<div className={`rounded-xl border ${c.cardBorder} bg-[#fbf6ec] hover:shadow-lg hover:-translate-y-1 transition-all duration-200 flex flex-col`}>
5860
<div className="m-3 rounded-lg bg-white shadow-sm flex flex-col flex-1 overflow-hidden">
@@ -110,12 +112,12 @@ function ContractCard({ d }: { d: Deployment }) {
110112
</Link>
111113
{d.status === "warning" && (
112114
<p className="text-[10px] text-amber-600 text-center font-medium">
113-
⚡ Approaching 150% threshold
115+
{tDeploy("warningStatus")}
114116
</p>
115117
)}
116118
{d.status === "danger" && (
117119
<p className="text-[10px] text-red-500 text-center font-medium">
118-
⚠ Reserve below 150% — redemptions active
120+
{tDeploy("dangerStatus")}
119121
</p>
120122
)}
121123
</div>

lib/i18n/locales/en.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,12 @@
9999
"warning": "⚡ Warning",
100100
"warningDesc": "Approaching the 150% threshold. Monitor closely.",
101101
"notActive": "✓ Not Active",
102-
"notActiveDesc": "Reserve ratio is healthy. Normal operations running."
102+
"notActiveDesc": "Reserve ratio is healthy. Normal operations running.",
103+
"triggerRedemptionCta": "Trigger Redemption →"
104+
},
105+
"deployments": {
106+
"warningStatus": "⚡ Approaching 150% threshold",
107+
"dangerStatus": "⚠ Reserve below 150% — redemptions active"
103108
},
104109
"footer": {
105110
"desc": "Next-generation stablecoin protocol.",

0 commit comments

Comments
 (0)