mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-19 19:25:51 +00:00
Add AmendmentDisclaimer component
This commit is contained in:
@@ -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>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user