Skip to content

Commit

Permalink
Merge pull request #516 from provenance-io/aj/add-ids-for-tracking
Browse files Browse the repository at this point in the history
Add ids to governance buttons for event tracking
  • Loading branch information
webbushka committed Jul 12, 2023
2 parents e151d95 + e9f44fc commit 8d833a4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/Components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ interface ButtonProps {
iconSize?: string;
iconColor?: string;
iconOptions?: object; // see Components/Sprite for available options
id?: string;
onClick?: (arg?: any) => void;
children: React.ReactNode;
disabled?: boolean;
Expand Down Expand Up @@ -58,12 +59,14 @@ const Button = ({
iconSize = '2.2rem',
iconColor = 'ICON_WHITE',
iconOptions,
id,
onClick = (arg?: any) => {},
children,
disabled = false,
type,
}: ButtonProps) => (
<StyledButton
id={id}
className={className}
onClick={onClick}
color={color.toUpperCase()}
Expand Down
4 changes: 3 additions & 1 deletion src/redux/hooks/useProposal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ export const useProposal = () => {

const ManageProposalBtn = () =>
!isLoggedIn ? null : (
<Button onClick={() => handleManageProposalClick()}>Submit New Proposal</Button>
<Button id="gov-create" onClick={() => handleManageProposalClick()}>
Submit New Proposal
</Button>
);

return {
Expand Down
6 changes: 5 additions & 1 deletion src/redux/hooks/useVoting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ export const useVoting = () => {
};

const ManageVotingBtn = ({ title }: { title: string }) =>
!isLoggedIn ? null : <Button onClick={() => handleManageVotingClick()}>Vote on {title}</Button>;
!isLoggedIn ? null : (
<Button id="gov-voting" onClick={handleManageVotingClick}>
Vote on {title}
</Button>
);

ManageVotingBtn.propTypes = {
title: PropTypes.string.isRequired,
Expand Down

0 comments on commit 8d833a4

Please sign in to comment.