Skip to content

Commit de5251a

Browse files
authored
add recipient address copy to manager (#3796)
* add recipient copy to manager * fix lockfile
1 parent 72231b7 commit de5251a

File tree

10 files changed

+28
-8
lines changed

10 files changed

+28
-8
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ REACT_APP_PASSPORT_API_COMMUNITY_ID_AVALANCHE=0000
3030
##Indexer & Data Layer - DEFAULTS SUFFICIENT
3131
# URL of the indexer. http://localhost:8080 for local indexer
3232
REACT_APP_INDEXER_V1_API_URL=https://grants-stack-indexer-v2.gitcoin.co
33-
REACT_APP_INDEXER_V2_API_URL=http://gitcoin-data-layer-staging-lb-242619440.us-east-2.elb.amazonaws.com/v1
33+
REACT_APP_INDEXER_V2_API_URL=https://beta.indexer.gitcoin.co/v1
3434

3535
# Search API URL where the Data Layer should point to
3636
REACT_APP_GRANTS_STACK_SEARCH_API_BASE_URL=https://d2n9vtjeq685yt.cloudfront.net

packages/common/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"@wagmi/chains": "^1.8.0",
2929
"abitype": "^0.10.3",
3030
"classnames": "^2.3.2",
31+
"@heroicons/react": "^2.0.13",
3132
"data-layer": "workspace:*",
3233
"dompurify": "^2.4.3",
3334
"eslint-config-gitcoin": "workspace:*",

packages/grant-explorer/src/features/round/CopyToClipboard.tsx renamed to packages/common/src/components/CopyToClipboard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
CheckCircleIcon,
44
DocumentDuplicateIcon,
55
} from "@heroicons/react/24/outline";
6-
import { truncate } from "../common/utils/truncate";
6+
import { truncate } from "./truncate";
77
import { isAddress } from "viem";
88

99
const CopyToClipboard = ({ text }: { text: string | undefined }) => {

packages/grant-explorer/src/features/round/ViewProjectDetails.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { useAccount, useEnsName } from "wagmi";
2626
import DefaultLogoImage from "../../assets/default_logo.png";
2727
import { ReactComponent as GithubIcon } from "../../assets/github-logo.svg";
2828
import { ReactComponent as TwitterIcon } from "../../assets/twitter-logo.svg";
29-
import { ReactComponent as EthereumIcon } from "../../assets/icons/ethereum-icon.svg";
29+
import { ReactComponent as EthereumIcon } from "common/src/assets/ethereum-icon.svg";
3030
import { ReactComponent as GlobeIcon } from "../../assets/icons/globe-icon.svg";
3131
import { useRoundById } from "../../context/RoundContext";
3232
import { CartProject, GrantApplicationFormAnswer, Project } from "../api/types";
@@ -56,7 +56,7 @@ import {
5656
useApplication,
5757
} from "../projects/hooks/useApplication";
5858
import { PassportWidget } from "../common/PassportWidget";
59-
import CopyToClipboard from "./CopyToClipboard";
59+
import CopyToClipboard from "common/src/components/CopyToClipboard";
6060

6161
const CalendarIcon = (props: React.SVGProps<SVGSVGElement>) => {
6262
return (

packages/grant-explorer/src/features/round/__tests__/ViewProjectDetails.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
setWindowDimensions,
88
} from "../../../test-utils";
99
import ViewProjectDetails from "../ViewProjectDetails";
10-
import { truncate } from "../../common/utils/truncate";
10+
import { truncate } from "common/src/components/truncate";
1111
import { formatDateWithOrdinal } from "common";
1212
import { useApplication } from "../../projects/hooks/useApplication";
1313
import { beforeEach, expect, Mock } from "vitest";

packages/grant-explorer/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
"types": ["vitest/globals", "@testing-library/jest-dom"],
2020
"incremental": true
2121
},
22-
"include": ["src"]
22+
"include": ["src", "../common/src/components/CopyToClipboard.tsx", "../common/src/components/truncate.ts"]
2323
}

packages/round-manager/src/features/round/ViewApplicationPage.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ import {
5252
isDirectRound,
5353
ApplicationOpenDateRange,
5454
} from "./ViewRoundPage";
55+
import CopyToClipboard from "common/src/components/CopyToClipboard";
56+
import { ReactComponent as EthereumIcon } from "common/src/assets/ethereum-icon.svg";
57+
import { useEnsName } from "wagmi";
5558

5659
import {
5760
CalendarIcon,
@@ -135,6 +138,9 @@ export default function ViewApplicationPage() {
135138
contractUpdatingStatus == ProgressStatus.IN_PROGRESS ||
136139
indexingStatus == ProgressStatus.IN_PROGRESS;
137140

141+
const recipient = application?.recipient;
142+
// @ts-expect-error Temp until viem (could also cast recipient as Address or update the type)
143+
const ens = useEnsName({ address: recipient, enabled: Boolean(recipient) });
138144
const progressSteps: ProgressStep[] = [
139145
{
140146
name: "Updating",
@@ -806,6 +812,16 @@ export default function ViewApplicationPage() {
806812
: "-"}
807813
</span>
808814
</span>
815+
{/* Application wallet address */}
816+
<span
817+
className="flex flex-row items-center"
818+
data-testid="application-recipient"
819+
>
820+
<EthereumIcon className="h-4 w-4 mr-2 text-grey-400" />
821+
<span className="text-sm text-grey-400">
822+
<CopyToClipboard text={ens.data || recipient} />
823+
</span>
824+
</span>
809825
</div>
810826
<hr className="my-6" />
811827
{/* Description */}

pnpm-lock.yaml

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)