Skip to content

Commit

Permalink
chore: Update naming of new prop
Browse files Browse the repository at this point in the history
  • Loading branch information
shan8851 committed Sep 23, 2024
1 parent 7a1eca8 commit 02ff986
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ describe('<VoteProposalDataListItemStructure /> 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();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export type IVoteProposalDataListItemStructureProps = IDataListItemProps & {
/**
* Custom label for the tag
*/
voteLabel?: string;
confirmationLabel?: string;
};

export const VoteProposalDataListItemStructure: React.FC<IVoteProposalDataListItemStructureProps> = (props) => {
const { proposalTitle, proposalId, voteIndicator, date, voteLabel, className, ...otherProps } = props;
const { proposalTitle, proposalId, voteIndicator, date, confirmationLabel, className, ...otherProps } = props;

const { copy } = useOdsModulesContext();

Expand All @@ -41,7 +41,7 @@ export const VoteProposalDataListItemStructure: React.FC<IVoteProposalDataListIt
<span className="truncate text-neutral-800">{proposalTitle}</span>
</div>
<div className="flex items-center gap-x-1 text-sm font-normal leading-tight text-neutral-500 md:gap-x-1.5 md:text-base">
<span>{voteLabel ?? copy.voteProposalDataListItemStructure.voted}</span>
<span>{confirmationLabel ?? copy.voteProposalDataListItemStructure.voted}</span>
<Tag
variant={voteIndicatorToTagVariant[voteIndicator]}
className="capitalize"
Expand Down

0 comments on commit 02ff986

Please sign in to comment.