-
+
+
Create a vibrant community around the {tokenGarden.name} by
providing the necessary details below.
diff --git a/apps/web/components/Button.tsx b/apps/web/components/Button.tsx
index 96ad71906..b0513687f 100644
--- a/apps/web/components/Button.tsx
+++ b/apps/web/components/Button.tsx
@@ -79,18 +79,22 @@ export function Button({
icon,
type = "button",
}: ButtonProps) {
- const buttonContent =
- isLoading ?
: children;
-
const buttonElement = (
);
diff --git a/apps/web/components/ConnectWalletButton.tsx b/apps/web/components/ConnectWalletButton.tsx
index 34c474b91..f75cd913b 100644
--- a/apps/web/components/ConnectWalletButton.tsx
+++ b/apps/web/components/ConnectWalletButton.tsx
@@ -151,12 +151,10 @@ export function ConnectWallet() {
@@ -199,17 +197,6 @@ export function ConnectWallet() {
);
})()}
- {urlChainId === chain?.id && tokenUrlAddress !== undefined && (
-
- )}
>
);
}}
diff --git a/apps/web/components/DisputeButton.tsx b/apps/web/components/DisputeButton.tsx
index 7d80e883f..aac422bda 100644
--- a/apps/web/components/DisputeButton.tsx
+++ b/apps/web/components/DisputeButton.tsx
@@ -155,13 +155,17 @@ export const DisputeButton: FC
= ({ proposalData }) => {
async function handleSubmit() {
setIsLoading(true);
- const reasonHash = await ipfsJsonUpload({ reason }, "disputeReason");
- if (!reasonHash) {
- return;
+ try {
+ const reasonHash = await ipfsJsonUpload({ reason }, "disputeReason");
+ if (!reasonHash) {
+ return;
+ }
+ await writeDisputeProposalAsync({
+ args: [BigInt(proposalData.proposalNumber), reasonHash, "0x0"],
+ });
+ } catch (error) {
+ setIsLoading(false);
}
- await writeDisputeProposalAsync({
- args: [BigInt(proposalData.proposalNumber), reasonHash, "0x0"],
- });
setIsLoading(false);
}
@@ -315,7 +319,6 @@ export const DisputeButton: FC = ({ proposalData }) => {
/>
)}
)}
diff --git a/apps/web/components/Forms/FormPreview.tsx b/apps/web/components/Forms/FormPreview.tsx
index 3ee58c435..4a82a8708 100644
--- a/apps/web/components/Forms/FormPreview.tsx
+++ b/apps/web/components/Forms/FormPreview.tsx
@@ -19,32 +19,15 @@ export function FormPreview({
return <>Error no Data>;
}
- // description or covenant
- {
- /*
-
- {previewTitle}
-
+
{title && description && (
-
-
- {title}
-
-
- {description}
-
+
+
{title}
+
{description}
)}
diff --git a/apps/web/components/Modal.tsx b/apps/web/components/Modal.tsx
index fb3eb8d46..cea078a9c 100644
--- a/apps/web/components/Modal.tsx
+++ b/apps/web/components/Modal.tsx
@@ -22,15 +22,29 @@ export function Modal({
const dialogRef = useRef
(null);
useEffect(() => {
+ const dialogElement = dialogRef.current;
+
if (isOpen) {
- dialogRef.current?.showModal();
+ dialogElement?.showModal();
} else {
- dialogRef.current?.close();
+ dialogElement?.close();
}
- }, [isOpen]);
+
+ const handleDialogClose = () => {
+ if (!dialogElement?.open) {
+ onClose();
+ }
+ };
+
+ dialogElement?.addEventListener("close", handleDialogClose);
+
+ return () => {
+ dialogElement?.removeEventListener("close", handleDialogClose);
+ };
+ }, [isOpen, onClose]);
const handleClose = () => {
- onClose?.();
+ onClose();
dialogRef.current?.close();
};
diff --git a/apps/web/components/PoolHeader.tsx b/apps/web/components/PoolHeader.tsx
index f9e3aa883..86095c1f9 100644
--- a/apps/web/components/PoolHeader.tsx
+++ b/apps/web/components/PoolHeader.tsx
@@ -1,4 +1,4 @@
-import React, { useState } from "react";
+import { useState } from "react";
import {
BoltIcon,
ChartBarIcon,
@@ -154,7 +154,7 @@ export default function PoolHeader({
abi: abiWithErrors(registryCommunityABI),
contractName: "Registry Community",
functionName: "addStrategyByPoolId",
- fallbackErrorMessage: "Error creating a pool. Please ty again.",
+ fallbackErrorMessage: "Error approving pool. Please try again.",
args: [BigInt(poolId)],
onConfirmations: () => {
publish({
@@ -171,7 +171,7 @@ export default function PoolHeader({
abi: abiWithErrors(registryCommunityABI),
contractName: "Registry Community",
functionName: "removeStrategyByPoolId",
- fallbackErrorMessage: "Error creating a pool. Please ty again.",
+ fallbackErrorMessage: "Error disabling pool. Please try again.",
args: [BigInt(poolId)],
onConfirmations: () => {
publish({
diff --git a/apps/web/components/ProposalCard.tsx b/apps/web/components/ProposalCard.tsx
index f48f1f935..a350fbc08 100644
--- a/apps/web/components/ProposalCard.tsx
+++ b/apps/web/components/ProposalCard.tsx
@@ -111,8 +111,9 @@ export function ProposalCard({
}
/>
- {[...Array(21)].map((_) => (
-
+ {[...Array(21)].map((_, i) => (
+ // eslint-disable-next-line react/no-array-index-key
+
|
))}
diff --git a/apps/web/components/Proposals.tsx b/apps/web/components/Proposals.tsx
index 8d70cb57c..2c83f9e5a 100644
--- a/apps/web/components/Proposals.tsx
+++ b/apps/web/components/Proposals.tsx
@@ -5,6 +5,7 @@ import {
AdjustmentsHorizontalIcon,
PlusIcon,
} from "@heroicons/react/24/outline";
+import { filter } from "lodash-es";
import Link from "next/link";
import { Address as AddressType, useAccount } from "wagmi";
import {
@@ -30,7 +31,7 @@ import { useContractWriteWithConfirmations } from "@/hooks/useContractWriteWithC
import { ConditionObject, useDisableButtons } from "@/hooks/useDisableButtons";
import { useSubgraphQuery } from "@/hooks/useSubgraphQuery";
import { alloABI, cvStrategyABI } from "@/src/generated";
-import { LightCVStrategy } from "@/types";
+import { LightCVStrategy, ProposalStatus } from "@/types";
import { abiWithErrors } from "@/utils/abiWithErrors";
import { encodeFunctionParams } from "@/utils/encodeFunctionParams";
import { useErrorDetails } from "@/utils/getErrorName";
@@ -98,11 +99,18 @@ export function Proposals({
me: wallet?.toLowerCase(),
comm: strategy.registryCommunity.id.toLowerCase(),
},
- changeScope: {
- topic: "member",
- id: wallet,
- type: ["add", "delete"],
- },
+ changeScope: [
+ {
+ topic: "member",
+ id: wallet,
+ type: ["add", "delete"],
+ },
+ {
+ topic: "proposal",
+ containerId: strategy.id,
+ function: "allocate",
+ },
+ ],
enabled: !!wallet,
});
@@ -197,7 +205,11 @@ export function Proposals({
getProposals(wallet, strategy)
.then((res) => {
if (res !== undefined) {
- setProposals(res);
+ const filteredProposals = res.filter(
+ ({ status }) => ProposalStatus[status] !== "rejected",
+ );
+ console.log(filteredProposals);
+ setProposals(filteredProposals);
} else {
console.debug("No proposals");
}
@@ -289,9 +301,8 @@ export function Proposals({
publish({
topic: "proposal",
type: "update",
- id: alloInfo.id,
+ containerId: strategy.id,
function: "allocate",
- urlChainId,
});
},
});
@@ -471,7 +482,10 @@ function UserAllocationStats({ stats }: { stats: Stats[] }) {
Your Allocation Overview
{stats.map((stat) => (
-
+
{
return (
-
- {icon &&
{icon}
}
- {(label ?? count) && (
-
- {label}: {count}
-
- )}
+
+
+ {icon &&
{icon}
}
+ {label && (
+
+ {label}: {count}
+
+ )}
+
{children}
);
diff --git a/apps/web/components/WalletBalance.tsx b/apps/web/components/WalletBalance.tsx
index b641ff96e..7a3c06c4d 100644
--- a/apps/web/components/WalletBalance.tsx
+++ b/apps/web/components/WalletBalance.tsx
@@ -76,10 +76,10 @@ export const WalletBalance: FC
= ({
Your balance:
[0];
let toastOptions: Partial;
- const clickToExplorer = () =>
- window.open(
- `${chainDataMap[chain?.id ?? 0].explorer}/tx/${transactionData?.hash}`,
- "_blank",
- );
+ const clickToExplorer = () => {
+ if (transactionData?.hash) {
+ window.open(
+ `${chainDataMap[chain?.id ?? 0].explorer}/tx/${transactionData?.hash}`,
+ "_blank",
+ );
+ } else {
+ return;
+ }
+ };
switch (transactionStatus) {
case "waiting":
@@ -173,6 +178,8 @@ export const TransactionStatusNotification = ({
break;
}
+ // if error on wagmi or no tx hash then not clickable
+
return (
{icon && (