Add AmendmentDisclaimer component

This commit is contained in:
tequ
2025-07-29 13:24:21 +09:00
committed by mDuo13
parent c8cca1ebe8
commit 97c692c767
3 changed files with 47 additions and 0 deletions

View File

@@ -139,6 +139,10 @@ footer.community.report-a-scam: 詐欺の報告
component.tryit: 試してみる
component.queryexampletx: トランザクションの例を確認
component.amendment-status.requires.1: " "
component.amendment-status.requires.2: が必要です。
component.amendment-status.added.1: " "
component.amendment-status.added.2: により追加されました。
# Amendment tracker translations
amendment.loading: ロード中Amendments...

View File

@@ -380,3 +380,29 @@ function AmendmentBadge(props: { amendment: Amendment }) {
return <img src={badgeUrl} alt={status} className="shield" />;
}
export function AmendmentDisclaimer(props: {
name: string,
isVoting: boolean
}) {
const { useTranslate } = useThemeHooks();
const { translate } = useTranslate();
const link = () => <Link to={`/resources/known-amendments#${props.name.toLowerCase()}`}>{props.name} amendment</Link>
return (
<div><i>(
{
props.isVoting ? (
<>
{translate("component.amendment-status.requires.1", "Requires the ")}{link()}{translate("component.amendment-status.requires.2", ".")}
</>
) : (
<>
{translate("component.amendment-status.added.1", "Added by the ")}{link()}{translate("component.amendment-status.added.2", ".")}
</>
)
}
)</i></div>
)
}

View File

@@ -221,3 +221,20 @@ export const amendmentsTable: Schema & { tagName: string } = {
render: 'AmendmentsTable',
selfClosing: true
}
export const amendmentDisclaimer: Schema & { tagName: string } = {
tagName: 'amendment-disclaimer',
attributes: {
name: {
type: 'String',
required: true
},
isVoting: {
type: 'Boolean',
required: false,
default: false
}
},
render: 'AmendmentDisclaimer',
selfClosing: true
}