Skip to content

Commit

Permalink
democracy show button
Browse files Browse the repository at this point in the history
  • Loading branch information
2nthony committed Apr 3, 2024
1 parent c17b84d commit 97dc2d6
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ import { DelegateAvatar } from "../referenda/avatar";
import useRealAddress from "next-common/utils/hooks/useRealAddress";
import useSubDemocracyDelegating from "next-common/utils/hooks/referenda/useSubDemocracyDelegating";

export default function DemocracyDelegateCard({ delegate = {} }) {
export default function DemocracyDelegateCard({
delegate = {},
showDelegateButton = true,
}) {
const { address, manifesto } = delegate;

const realAddress = useRealAddress();
const { delegating } = useSubDemocracyDelegating(realAddress);

const isDelegatee = realAddress === address;

const [detailOpen, setDetailOpen] = useState(false);

return (
Expand All @@ -30,7 +31,7 @@ export default function DemocracyDelegateCard({ delegate = {} }) {
<DelegateAvatar address={address} />

<div className="space-x-2">
{!isDelegatee && (
{showDelegateButton && (
<DemocracyNewDelegation
disabled={!!delegating}
defaultTargetAddress={address}
Expand Down

0 comments on commit 97dc2d6

Please sign in to comment.