diff --git a/CHANGELOG.md b/CHANGELOG.md index 08382aff9..0612ba550 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- `VoterListItem` onClick action to open etherscan + ## [0.2.11] - 2023-08-23 ### Fixed diff --git a/src/components/listItem/voter.tsx b/src/components/listItem/voter.tsx index dc14af302..1e48c55ad 100644 --- a/src/components/listItem/voter.tsx +++ b/src/components/listItem/voter.tsx @@ -28,7 +28,7 @@ export type ListItemVoterProps = ButtonHTMLAttributes & { walletTag?: TagProps; voteReplaced?: boolean; voteReplacedLabel?: string; - onClick: () => null; + onClick: () => void; }; const colorScheme = (option: string) => diff --git a/src/components/table/votersTable.stories.tsx b/src/components/table/votersTable.stories.tsx index 84355c317..6db506d3d 100644 --- a/src/components/table/votersTable.stories.tsx +++ b/src/components/table/votersTable.stories.tsx @@ -41,4 +41,5 @@ Default.args = { onLoadMore: () => alert('load more clicked'), showOption: true, showAmount: true, + explorerURL: 'https://etherscan.io/', }; diff --git a/src/components/table/votersTable.tsx b/src/components/table/votersTable.tsx index 147d3299b..6b916116e 100644 --- a/src/components/table/votersTable.tsx +++ b/src/components/table/votersTable.tsx @@ -24,6 +24,7 @@ export type VotersTableProps = { showOption?: boolean; showAmount?: boolean; pageSize?: number; // number of rows to show + explorerURL: string; }; const colorScheme = (option: VoterType['walletTag']) => (option === 'You' ? 'neutral' : 'info'); @@ -35,6 +36,7 @@ export const VotersTable: React.FC = ({ page = 1, showAmount = false, pageSize = 3, + explorerURL, }) => { const displayedVoters = page * pageSize; @@ -46,7 +48,9 @@ export const VotersTable: React.FC = ({ label={shortenAddress(voter.wallet)} src={voter.src} option={voter.option} - onClick={() => null} + onClick={() => { + window.open(`${explorerURL}address/${voter.wallet}`, '_blank'); + }} voteReplaced={voter.voteReplaced} {...(voter.walletTag && { walletTag: {