Skip to content

Commit 6d6495f

Browse files
committed
fix2
1 parent abf5027 commit 6d6495f

File tree

1 file changed

+19
-2
lines changed
  • src/components/pages/wallet/governance/proposal

1 file changed

+19
-2
lines changed

src/components/pages/wallet/governance/proposal/index.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,22 @@ import { useWalletsStore } from "@/lib/zustand/wallets";
1010
import useAppWallet from "@/hooks/useAppWallet";
1111
import VoteCard from "../vote-card";
1212
import { UTxO } from "@meshsdk/core";
13+
import UTxOSelector from "../../new-transaction/utxoSelector";
1314

14-
export default function WalletGovernanceProposal({ id, utxos }: { id: string; utxos: UTxO[] }) {
15+
export default function WalletGovernanceProposal({
16+
id,
17+
}: {
18+
id: string;
19+
}) {
1520
const network = useSiteStore((state) => state.network);
1621
const [proposalMetadata, setProposalMetadata] = useState<
1722
ProposalMetadata | undefined
1823
>(undefined);
1924
const drepInfo = useWalletsStore((state) => state.drepInfo);
2025
const { appWallet } = useAppWallet();
2126
const loading = useSiteStore((state) => state.loading);
27+
const [manualUtxos, setManualUtxos] = useState<UTxO[]>([]);
28+
const [manualSelected, setManualSelected] = useState(false);
2229

2330
useEffect(() => {
2431
const blockchainProvider = getProvider(network);
@@ -91,10 +98,20 @@ export default function WalletGovernanceProposal({ id, utxos }: { id: string; ut
9198
allowOverflow={true}
9299
/>
93100
</CardUI>
101+
{appWallet && (
102+
<UTxOSelector
103+
appWallet={appWallet}
104+
network={network}
105+
onSelectionChange={(utxos, manual) => {
106+
setManualUtxos(utxos);
107+
setManualSelected(manual);
108+
}}
109+
/>
110+
)}
94111
{appWallet && (
95112
<VoteCard
96113
appWallet={appWallet}
97-
utxos={utxos}
114+
utxos={manualUtxos}
98115
proposalId={`${proposalMetadata.tx_hash}#${proposalMetadata.cert_index}`}
99116
/>
100117
)}

0 commit comments

Comments
 (0)