Skip to content

Commit dc98817

Browse files
committed
cleanups, updated constants and wagmi config
1 parent 6a8beb1 commit dc98817

File tree

4 files changed

+31
-34
lines changed

4 files changed

+31
-34
lines changed

components/report-details/support/dialog.tsx

+11-31
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
import { ConnectButton } from "@/components/global/connect-button";
44
import { Button } from "@/components/ui/button";
55
import { Card } from "@/components/ui/card";
6-
import {
7-
Dialog,
8-
DialogContent,
9-
DialogHeader,
10-
DialogTrigger,
11-
} from "@/components/ui/dialog";
12-
import { Drawer, DrawerContent, DrawerHeader } from "@/components/ui/drawer";
6+
import { DialogTrigger } from "@/components/ui/dialog";
137
import { Separator } from "@/components/ui/separator";
8+
import {
9+
ALLO_POOLID,
10+
DONATION_RECEIVER,
11+
DOOGLY_CONTRACT,
12+
RECEIVING_TOKEN,
13+
} from "@/config/constants";
1414
import { useMediaQuery } from "@/hooks/use-media-query";
1515
import type { SupportReportInfo } from "@/types";
1616
import { DooglyDonateButton } from "@doogly/doogly-donate-component";
@@ -143,37 +143,17 @@ const SupportReport = ({
143143
setOpen,
144144
};
145145

146-
// if (isDesktop) {
147-
// return (
148-
// <ReportSupportUI
149-
// {...props}
150-
// UIComponent={Dialog}
151-
// ContentComponent={DialogContent}
152-
// HeaderComponent={DialogHeader}
153-
// />
154-
// );
155-
// }
156-
157-
// return (
158-
// <ReportSupportUI
159-
// {...props}
160-
// UIComponent={Drawer}
161-
// ContentComponent={(props) => (
162-
// <DrawerContent {...props} className="bg-vd-beige-100 p-3" />
163-
// )}
164-
// HeaderComponent={DrawerHeader}
165-
// />
166-
// );
167146
return (
168147
<DooglyDonateButton
169148
buttonText="Support this report"
170149
modalTitle="Support this report"
171150
config={{
172151
destinationChain: "optimism",
173-
destinationAddress: "0x8a4c14d50c43363a28647188534db7004112091c",
174-
splitsAddress: "0xD8813c65a4A21772C360f32B2C7960040fa84a8B",
152+
destinationAddress: DOOGLY_CONTRACT,
153+
splitsAddress: DONATION_RECEIVER,
175154
hypercertFractionId: hypercertId?.split("-")[2],
176-
poolId: 0,
155+
poolId: ALLO_POOLID as number,
156+
destinationOutputTokenAddress: RECEIVING_TOKEN,
177157
}}
178158
buttonClassName="rounded-3xl bg-vd-blue-900 text-vd-beige-100 hover:bg-vd-blue-700 dark:bg-vd-beige-100 dark:text-vd-blue-900 dark:hover:bg-vd-beige-100/90 active:outline-none active:scale-95 active:ring-2 active:ring-vd-blue-400 active:ring-offset-2"
179159
modalStyles={{

config/constants.ts

+17
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ import { Environment } from "@hypercerts-org/sdk";
55
export const WC_PROJECT_ID = process.env.NEXT_PUBLIC_WC_PROJECT_ID;
66
export const ENVIRONMENT = process.env.NEXT_PUBLIC_ENVIRONMENT as Environment;
77

8+
// This is the Doogly gateway for receiving cross-chain donations on Optimism
9+
export const DOOGLY_CONTRACT =
10+
process.env.NEXT_PUBLIC_DOOGLY_CONTRACT ??
11+
"0x3652eC40C4D8F3e804373455EF155777F250a6E2";
12+
// Allo pool id to transfer donations
13+
// If 0 then DONATION_RECEIVER could be EOA or Split Contract
14+
// Else DONATION_RECEIVER is expected to be Allo pool contract
15+
export const ALLO_POOLID = process.env.NEXT_PUBLIC_ALLO_POOLID ?? 0;
16+
// Donation receiver address
17+
export const DONATION_RECEIVER =
18+
process.env.NEXT_PUBLIC_DONATION_RECEIVER ??
19+
"0xD8813c65a4A21772C360f32B2C7960040fa84a8B";
20+
// Token address to receive donations in, defaults to USDC
21+
export const RECEIVING_TOKEN =
22+
process.env.NEXT_PUBLIC_RECEIVING_TOKEN ??
23+
"0x7F5c764cBc14f9669B88837ca1490cCa17c31607";
24+
825
export const testNetChains = [sepolia] as const;
926
export const prodNetChains = [optimism] as const;
1027

config/wagmi.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { defaultWagmiConfig } from "@web3modal/wagmi/react/config";
22

33
import { cookieStorage, createStorage } from "wagmi";
44
import { getVoiceDeckUrl } from "./endpoint";
5-
import { optimism } from "viem/chains";
5+
import { arbitrum, base, celo, optimism } from "viem/chains";
66

77
// Get projectId at https://cloud.walletconnect.com
88
export const projectId = process.env.NEXT_PUBLIC_WC_PROJECT_ID;
@@ -19,7 +19,7 @@ const metadata = {
1919

2020
// Create wagmiConfig
2121
export const config = defaultWagmiConfig({
22-
chains: [optimism], // required
22+
chains: [optimism, base, celo, arbitrum], // required
2323
projectId, // required
2424
metadata, // required
2525
ssr: true,

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"dependencies": {
1515
"@anon-aadhaar/react": "^2.4.0",
1616
"@directus/sdk": "^15.0.2",
17-
"@doogly/doogly-donate-component": "^1.0.4",
17+
"@doogly/doogly-donate-component": "^1.0.5",
1818
"@ethersproject/providers": "^5.7.2",
1919
"@fontsource-variable/plus-jakarta-sans": "^5.0.20",
2020
"@hookform/resolvers": "^3.3.4",

0 commit comments

Comments
 (0)