Skip to content

Commit

Permalink
Patch - Fixed the bug for MyDAOs (#875)
Browse files Browse the repository at this point in the history
* Fixed the typo

* Fixed the bug for mydaos

* Changes
- DAO name on center
- Fixed Votes Count on Proposal page
- Removed deprecated package
  • Loading branch information
ashutoshpw authored Dec 2, 2024
1 parent 88276b5 commit 62c64ba
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 246 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@types/react-paginate": "^7.1.2",
"@types/react-router-hash-link": "^2.4.5",
"@types/valid-url": "^1.0.4",
"@web3modal/wagmi": "^5.0.6",
"@wagmi/core": "2.13.4",
"assert": "^2.0.0",
"bignumber.js": "^9.0.1",
"blockies-ts": "^1.0.0",
Expand Down
5 changes: 3 additions & 2 deletions src/modules/explorer/pages/DAOList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,12 @@ export const DAOList: React.FC = () => {
(formattedDao.symbol && formattedDao.symbol.toLowerCase().includes(searchText.toLowerCase()))
)
}
return formattedDAOs.filter(dao => dao.votingAddresses.includes(account))
const accountAddress = account || etherlink?.account?.address
return formattedDAOs.filter(dao => dao.votingAddresses.includes(accountAddress))
}

return []
}, [daos, searchText, account])
}, [daos, searchText, account, etherlink?.account?.address])

console.log({ daos, currentDAOs, myDAOs })

Expand Down
4 changes: 3 additions & 1 deletion src/modules/lite/explorer/components/DaoCardDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ const TermsText = styled(Link)(({ theme }) => ({
const CommunityText = styled(Typography)({
fontWeight: 500,
fontSize: 30,
lineHeight: "146.3%"
lineHeight: "146.3%",
margin: "auto",
textAlign: "center"
})

const CommunityDescription = styled(Typography)({
Expand Down
5 changes: 2 additions & 3 deletions src/modules/lite/explorer/components/DownloadCsvFile.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React, { useEffect, useState } from "react"
import { Button, Typography } from "@material-ui/core"
import { ReactComponent as DownloadCSVIcon } from "assets/img/download_csv.svg"
import { Choice, WalletAddress } from "models/Choice"
import { mkConfig, generateCsv, download, asString } from "export-to-csv"
import { writeFile } from "node:fs"
import { Choice } from "models/Choice"
import { mkConfig, generateCsv, download } from "export-to-csv"
import { useNotification } from "modules/lite/components/hooks/useNotification"

type DownloadCsvFileProps = {
Expand Down
2 changes: 0 additions & 2 deletions src/modules/lite/explorer/pages/ProposalDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ export const ProposalDetails: React.FC<{ id: string }> = ({ id }) => {
poll?.referenceBlock
)

console.log({ voteWeight })

const [votingPower, setVotingPower] = useState(poll?.isXTZ ? voteWeight?.votingXTZWeight : voteWeight?.votingWeight)

const choices = usePollChoices(poll, refresh)
Expand Down
10 changes: 1 addition & 9 deletions src/services/lite/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,7 @@ export const calculateProposalTotal = (choices: Choice[], decimals: any) => {
}

const getUsers = (options: Choice[]) => {
console.log("options", options)
const addresses: string[] = []

options.forEach(option => {
// TODO: ashutoshpw - Replace with wallet.address
option.walletAddresses.forEach(wallet => addresses.push((wallet as any)?._id))
})
// debugger

const addresses: string[] = options.flatMap(option => option.walletAddresses.map(wallet => (wallet as any)?.address))
return new Set(addresses)
}

Expand Down
Loading

0 comments on commit 62c64ba

Please sign in to comment.