Skip to content

Commit

Permalink
democracy delegate
Browse files Browse the repository at this point in the history
  • Loading branch information
2nthony committed Apr 3, 2024
1 parent 8515ff8 commit 61cceb9
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { AvatarContextProvider } from "next-common/context/avatar";
import nextApi from "next-common/services/nextApi";
import { delegationDemocracyDelegatesAddressApi } from "next-common/services/url";
import useRealAddress from "next-common/utils/hooks/useRealAddress";
import { useEffect, useState } from "react";
import Delegates from "../../democracy/members";
import MemberCardListContainer from "../../common/cardListContainer";
import DemocracyDelegateCard from "../../democracy/card";
import Announcement from "./announcement";

export default function DemocracyAnnouncement() {
Expand All @@ -19,8 +21,16 @@ export default function DemocracyAnnouncement() {
});
}, [realAddress]);

const addressAvatarMap = new Map([[data?.address, data?.manifesto?.image]]);

if (data) {
return <Delegates delegates={[data]} />;
return (
<AvatarContextProvider addressAvatarMap={addressAvatarMap}>
<MemberCardListContainer>
<DemocracyDelegateCard delegate={data} showDelegateButton={false} />
</MemberCardListContainer>
</AvatarContextProvider>
);
}

return <Announcement />;
Expand Down

0 comments on commit 61cceb9

Please sign in to comment.