From 9e04d4e71cdabfd100cd4ca5eec8a841dc89d7b1 Mon Sep 17 00:00:00 2001 From: Oliver Eggert Date: Fri, 26 Sep 2025 16:22:07 -0700 Subject: [PATCH] update amendment badge to account for eta status --- @l10n/ja/translations.yaml | 1 + @theme/markdoc/components.tsx | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/@l10n/ja/translations.yaml b/@l10n/ja/translations.yaml index cc2d730f83..4dc6d13499 100644 --- a/@l10n/ja/translations.yaml +++ b/@l10n/ja/translations.yaml @@ -151,6 +151,7 @@ amendment.table.name: 名前 amendment.table.introduced: 登場 amendment.table.status: ステータス amendment.status.enabled: 有効 +amendment.status.eta: 予定 amendment.status.openForVoting: 投票中 # index.page.tsx diff --git a/@theme/markdoc/components.tsx b/@theme/markdoc/components.tsx index a9b0e64e40..fcd46f4883 100644 --- a/@theme/markdoc/components.tsx +++ b/@theme/markdoc/components.tsx @@ -229,6 +229,7 @@ type Amendment = { consensus?: string; date?: string; id: string; + eta?: string; }; type AmendmentsResponse = { @@ -260,6 +261,7 @@ export function AmendmentsTable() { .sort((a: Amendment, b: Amendment) => { // Sort by status priority (lower number = higher priority) const getStatusPriority = (amendment: Amendment): number => { + if (amendment.eta) return 0; // Expected if (amendment.consensus) return 1; // Open for Voting if (amendment.tx_hash) return 2; // Enabled }; @@ -349,6 +351,7 @@ function AmendmentBadge(props: { amendment: Amendment }) { const enabledLabel = translate("amendment.status.enabled", "Enabled"); const votingLabel = translate("amendment.status.openForVoting", "Open for Voting"); + const etaLabel = translate("amendment.status.eta", "Expected"); React.useEffect(() => { const amendment = props.amendment; @@ -360,13 +363,20 @@ function AmendmentBadge(props: { amendment: Amendment }) { setColor('green'); setHref(`https://livenet.xrpl.org/transactions/${amendment.tx_hash}`); } + // Check if expected activation is provided (has eta field) + else if (amendment.eta) { + let etaDate = new Date(amendment.eta).toISOString().split('T')[0]; + setStatus(`${etaLabel}: ${etaDate}`); + setColor('blue'); + setHref(undefined); + } // Check if amendment is currently being voted on (has consensus field) else if (amendment.consensus) { setStatus(`${votingLabel}: ${amendment.consensus}`); setColor('80d0e0'); setHref(undefined); // No link for voting amendments } - }, [props.amendment, enabledLabel, votingLabel]); + }, [props.amendment, enabledLabel, etaLabel, votingLabel]); // Split the status at the colon to create two-color badge const parts = status.split(':');