diff --git a/CHANGELOG.md b/CHANGELOG.md index f107a465..86238bca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Added -- Add optional `voteLabel` prop to the `VoteProposalDataListItem` component in order to pass a custom string wen +- Add optional `confirmationLabel` prop to the `VoteProposalDataListItem` component in order to pass a custom string when needed. - Add new `xs` size for core `Avatar` component diff --git a/src/modules/components/vote/voteProposalDataListItem/voteProposalDataListItemStructure/voteProposalDataListItemStructure.stories.tsx b/src/modules/components/vote/voteProposalDataListItem/voteProposalDataListItemStructure/voteProposalDataListItemStructure.stories.tsx index cd25008c..3e675186 100644 --- a/src/modules/components/vote/voteProposalDataListItem/voteProposalDataListItemStructure/voteProposalDataListItemStructure.stories.tsx +++ b/src/modules/components/vote/voteProposalDataListItem/voteProposalDataListItemStructure/voteProposalDataListItemStructure.stories.tsx @@ -35,7 +35,7 @@ export const TokenVotingCustomLabel: Story = { proposalTitle: 'Introduction of Layer 2 Scaling Solutions', voteIndicator: 'yes', date: 1613984914000, - voteLabel: 'Cutom label', + confirmationLabel: 'Cutom label', }, }; diff --git a/src/modules/components/vote/voteProposalDataListItem/voteProposalDataListItemStructure/voteProposalDataListItemStructure.test.tsx b/src/modules/components/vote/voteProposalDataListItem/voteProposalDataListItemStructure/voteProposalDataListItemStructure.test.tsx index 0c15eda9..04bc722e 100644 --- a/src/modules/components/vote/voteProposalDataListItem/voteProposalDataListItemStructure/voteProposalDataListItemStructure.test.tsx +++ b/src/modules/components/vote/voteProposalDataListItem/voteProposalDataListItemStructure/voteProposalDataListItemStructure.test.tsx @@ -39,9 +39,9 @@ describe(' component', () => { }); it('renders the custom label if available', () => { - const voteLabel = 'Custom label'; - render(createTestComponent({ voteLabel })); + const confirmationLabel = 'Custom label'; + render(createTestComponent({ confirmationLabel })); - expect(screen.getByText(voteLabel)).toBeInTheDocument(); + expect(screen.getByText(confirmationLabel)).toBeInTheDocument(); }); }); diff --git a/src/modules/components/vote/voteProposalDataListItem/voteProposalDataListItemStructure/voteProposalDataListItemStructure.tsx b/src/modules/components/vote/voteProposalDataListItem/voteProposalDataListItemStructure/voteProposalDataListItemStructure.tsx index 86230890..098826bb 100644 --- a/src/modules/components/vote/voteProposalDataListItem/voteProposalDataListItemStructure/voteProposalDataListItemStructure.tsx +++ b/src/modules/components/vote/voteProposalDataListItem/voteProposalDataListItemStructure/voteProposalDataListItemStructure.tsx @@ -23,11 +23,11 @@ export type IVoteProposalDataListItemStructureProps = IDataListItemProps & { /** * Custom label for the tag */ - voteLabel?: string; + confirmationLabel?: string; }; export const VoteProposalDataListItemStructure: React.FC = (props) => { - const { proposalTitle, proposalId, voteIndicator, date, voteLabel, className, ...otherProps } = props; + const { proposalTitle, proposalId, voteIndicator, date, confirmationLabel, className, ...otherProps } = props; const { copy } = useOdsModulesContext(); @@ -41,7 +41,7 @@ export const VoteProposalDataListItemStructure: React.FC{proposalTitle}
- {voteLabel ?? copy.voteProposalDataListItemStructure.voted} + {confirmationLabel ?? copy.voteProposalDataListItemStructure.voted}