Skip to content

Commit

Permalink
refactor(governance): simplify button text handling
Browse files Browse the repository at this point in the history
  • Loading branch information
fedosov committed Jan 6, 2025
1 parent 089e32e commit 89c6481
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
10 changes: 4 additions & 6 deletions app/components/governance/MotionDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -364,21 +364,19 @@ export function MotionDetails({
loading={votingLoading[`${hash}-true`]}
onClick={() => onVote(motion, true)}
className="min-w-[140px] !h-10"
text={t("governance.ayes")}
icon={ayeVotes.map((a) => a.toString()).includes(selectedAddress || "") ? "tick" : undefined}
disabled={ayeVotes.map((a) => a.toString()).includes(selectedAddress || "")}
>
{ayeVotes.map((a) => a.toString()).includes(selectedAddress || "") ? t("governance.ayes") : t("governance.ayes")}
</Button>
></Button>
<Button
intent={Intent.DANGER}
loading={votingLoading[`${hash}-false`]}
onClick={() => onVote(motion, false)}
className="min-w-[140px] !h-10"
text={t("governance.nays")}
icon={nayVotes.map((a) => a.toString()).includes(selectedAddress || "") ? "tick" : undefined}
disabled={nayVotes.map((a) => a.toString()).includes(selectedAddress || "")}
>
{nayVotes.map((a) => a.toString()).includes(selectedAddress || "") ? t("governance.nays") : t("governance.nays")}
</Button>
></Button>
</div>
) : (
<Button
Expand Down
4 changes: 2 additions & 2 deletions app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@
"threshold": "Threshold",
"no_active_motions": "No active motions",
"motions": "Motions",
"ayes": "Yes",
"nays": "No",
"ayes": "Aye",
"nays": "Nay",
"members": "Members",
"member": "Council Member",
"balance": "Stake Balance",
Expand Down
4 changes: 2 additions & 2 deletions app/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@
"threshold": "Umbral",
"no_active_motions": "No hay mociones activas",
"motions": "Mociones",
"ayes": "A favor",
"nays": "En contra",
"ayes": "",
"nays": "No",
"members": "Miembros",
"member": "Miembro del Consejo",
"balance": "Balance en Stake",
Expand Down
4 changes: 2 additions & 2 deletions app/translations/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@
"threshold": "Limite",
"no_active_motions": "Sem moções ativas",
"motions": "Moções",
"ayes": "A favor",
"nays": "Contra",
"ayes": "Sim",
"nays": "Não",
"members": "Membros",
"member": "Membro do Conselho",
"balance": "Saldo em Stake",
Expand Down

0 comments on commit 89c6481

Please sign in to comment.