Skip to content

Commit

Permalink
[#464] add tooltips for gov actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Sworzen1 committed Apr 16, 2024
1 parent b4f132f commit 7fc7f6e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Dispatch, SetStateAction } from "react";
import { ActionRadio, Spacer, Typography } from "@atoms";
import { GovernanceActionTootlip } from "@consts";
import {
useCreateGovernanceActionForm,
useScreenDimension,
Expand Down Expand Up @@ -34,7 +35,6 @@ export const ChooseGovernanceActionType = ({
setValue("governance_action_type", value as GovernanceActionType);
};

// TODO: Add tooltips when they will be available
const renderGovernanceActionTypes = () =>
Object.keys(GovernanceActionType).map(
(type, index, governanceActionTypes) => {
Expand All @@ -46,6 +46,10 @@ export const ChooseGovernanceActionType = ({
onChange={onChangeType}
title={type}
value={type}
tooltipTitle={type}
tooltipText={
GovernanceActionTootlip[type as GovernanceActionType]
}
/>
{index + 1 < governanceActionTypes.length ? <Spacer y={2} /> : null}
</div>
Expand Down
5 changes: 5 additions & 0 deletions govtool/frontend/src/consts/governanceAction/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ import {
SharedGovernanceActionFieldSchema,
} from "@/types/governanceAction";

export const GovernanceActionTootlip = {
Info: I18n.t("govActions.tooltips.info"),
Treasury: I18n.t("govActions.tooltips.treasury"),
};

export const CIP_100 =
"https://github.com/cardano-foundation/CIPs/blob/master/CIP-0100/README.md#";
export const CIP_108 =
Expand Down
4 changes: 4 additions & 0 deletions govtool/frontend/src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,10 @@ export const en = {
partOne: "Governance action with id",
partTwo: "does not exist.",
},
tooltips: {
info: "An action that has no effect on-chain, other than an on-chain record",
treasury: "Withdrawals from the treasury",
},
type: {
noConfidence: {
title: "No Confidence",
Expand Down

0 comments on commit 7fc7f6e

Please sign in to comment.