diff --git a/src/modules/explorer/components/ProposalsList.tsx b/src/modules/explorer/components/ProposalsList.tsx index 18c0280e..5048e71b 100644 --- a/src/modules/explorer/components/ProposalsList.tsx +++ b/src/modules/explorer/components/ProposalsList.tsx @@ -40,6 +40,7 @@ interface Props { proposalStyle?: any showFullList?: boolean filters: undefined | Filters + daoId?: string } interface ProposalObj { @@ -53,7 +54,8 @@ export const ProposalsList: React.FC = ({ liteProposals, proposalStyle, showFullList = true, - filters = undefined + filters = undefined, + daoId }) => { const [currentPage, setCurrentPage] = useState(0) const [offset, setOffset] = useState(0) @@ -196,7 +198,7 @@ export const ProposalsList: React.FC = ({ ) : (
- +
) )} diff --git a/src/modules/explorer/pages/Proposals/index.tsx b/src/modules/explorer/pages/Proposals/index.tsx index 0b03174e..eb567f6c 100644 --- a/src/modules/explorer/pages/Proposals/index.tsx +++ b/src/modules/explorer/pages/Proposals/index.tsx @@ -307,6 +307,7 @@ const TezosProposals = () => { proposals={undefined} liteProposals={polls} filters={filters} + daoId={daoId} /> )} {!(polls && polls.length > 0) ? ( diff --git a/src/modules/explorer/pages/User/components/UserMovements.tsx b/src/modules/explorer/pages/User/components/UserMovements.tsx index 69141f6e..0d6c07ad 100644 --- a/src/modules/explorer/pages/User/components/UserMovements.tsx +++ b/src/modules/explorer/pages/User/components/UserMovements.tsx @@ -280,6 +280,7 @@ export const UserMovements: React.FC<{ liteProposals={showActivity ? pollsPosted : pollsPosted?.slice(0, 2)} showFullList={showActivity} filters={filters} + daoId={daoId} /> )} {!(proposalsCreated && proposalsCreated.length > 0) && !(pollsPosted && pollsPosted.length > 0) ? ( @@ -304,6 +305,7 @@ export const UserMovements: React.FC<{ liteProposals={showActivity ? votedPolls : votedPolls.slice(0, 2)} showFullList={showActivity} filters={filters} + daoId={daoId} /> )} {!(proposalsVoted && proposalsVoted.length > 0) && !(votedPolls && votedPolls.length > 0) ? ( diff --git a/src/modules/lite/explorer/pages/ProposalDetails/index.tsx b/src/modules/lite/explorer/pages/ProposalDetails/index.tsx index 04f08a7f..1cab9b6b 100644 --- a/src/modules/lite/explorer/pages/ProposalDetails/index.tsx +++ b/src/modules/lite/explorer/pages/ProposalDetails/index.tsx @@ -91,7 +91,9 @@ export const ProposalDetails: React.FC<{ id: string }> = ({ id }) => { const [isLoading, setIsLoading] = useState(false) const navigateToDao = () => { - if (historyLength > 1) { + if (state?.daoId) { + navigate.push(`/explorer/dao/${state.daoId}`) + } else if (historyLength > 1) { navigate.goBack() } else { const daoUrl = pathname?.replace(`proposal/${proposalId}`, "") diff --git a/src/services/services/dao/hooks/useAllDAOs.ts b/src/services/services/dao/hooks/useAllDAOs.ts index 70f5a882..57e3f708 100644 --- a/src/services/services/dao/hooks/useAllDAOs.ts +++ b/src/services/services/dao/hooks/useAllDAOs.ts @@ -65,7 +65,12 @@ export const useAllDAOs = (network: Network) => { lite_daos = [] } - return [...homebase_daos, ...lite_daos] + // Filter out lite DAOs that already have a corresponding full (on-chain) DAO, + // since the full DAO page already displays their off-chain polls. + const fullDaoAddresses = new Set(homebase_daos.map((dao: any) => dao.address)) + const dedupedLiteDaos = lite_daos.filter((dao: any) => !dao.daoContract || !fullDaoAddresses.has(dao.daoContract)) + + return [...homebase_daos, ...dedupedLiteDaos] }, { // Always create the hook; let the fetcher short-circuit for Etherlink networks. diff --git a/src/services/services/lite/lite-services.ts b/src/services/services/lite/lite-services.ts index b8242558..0cf0697d 100644 --- a/src/services/services/lite/lite-services.ts +++ b/src/services/services/lite/lite-services.ts @@ -68,6 +68,7 @@ export const getLiteDAOs = async (network: string) => { }, votingAddressesCount: dao.votingAddressesCount, allowPublicAccess: dao.allowPublicAccess, + daoContract: dao.daoContract, ledgers: dao.members.map(member => { return { holder: { diff --git a/src/services/services/types.ts b/src/services/services/types.ts index 42d2f67d..02789b48 100644 --- a/src/services/services/types.ts +++ b/src/services/services/types.ts @@ -203,6 +203,7 @@ export interface DAOListItem { token: TokenDTO votingAddressesCount: number allowPublicAccess: boolean + daoContract?: string } export type FetchedDAO = DAODTO & { @@ -251,4 +252,5 @@ export interface Community { decimals: string network: Network votingAddressesCount: number + daoContract?: string }