Skip to content

Commit

Permalink
Merge pull request #3213 from OlympusDAO/supportValueIndex
Browse files Browse the repository at this point in the history
support value index fix
  • Loading branch information
brightiron authored Oct 7, 2024
2 parents 81651c3 + c02a2f2 commit 211b13d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/views/Governance/Proposals/VoteDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ import { VoteRow } from "src/views/Governance/Proposals/VoteRow";
const tablesData = [
{
id: "For",
contractValue: 1,
},
{
id: "Against",
contractValue: 0,
},
{
id: "Abstain",
contractValue: 2,
},
];

Expand All @@ -41,9 +44,11 @@ const TabPanel = (props: { children: React.ReactNode; value: number; index: numb
export default function GovernanceTable() {
const { id } = useParams();
const [tabIndex, setTabIndex] = useState(0);
const { data: voteData } = useGetVotes({ proposalId: id, support: tabIndex + 1 });
const [supportValue, setSupportValue] = useState(1);
const { data: voteData } = useGetVotes({ proposalId: id, support: supportValue });

const handleTabChange = (event: React.SyntheticEvent, newIndex: number) => {
setSupportValue(tablesData[newIndex].contractValue);
setTabIndex(newIndex);
};

Expand Down

0 comments on commit 211b13d

Please sign in to comment.