From 45c20e85321cfc3d18a349c197f95a59852a162f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cshrutipanjwani=E2=80=9D?= Date: Tue, 16 Jul 2024 01:10:19 +0530 Subject: [PATCH 1/2] fix: clickable addresses of issuers --- src/components/bounty/BountyInfo.tsx | 9 ++++++++- src/components/bounty/ProofItem.tsx | 7 +++++-- src/components/bounty/ProofItemAccount.tsx | 4 ++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/components/bounty/BountyInfo.tsx b/src/components/bounty/BountyInfo.tsx index 36418e83..989313e0 100644 --- a/src/components/bounty/BountyInfo.tsx +++ b/src/components/bounty/BountyInfo.tsx @@ -11,6 +11,7 @@ import CreateProof from '@/components/ui/CreateProof'; import { cancelOpenBounty, cancelSoloBounty } from '@/app/context/web3'; import { blacklistedBounties } from '@/constant/blacklist'; +import Link from 'next/link'; // function weiToEther(weiValue: string | number | bigint): string { const etherValue = Number(weiValue) / 1e18; @@ -114,7 +115,13 @@ const BountyInfo = ({ bountyId }: { bountyId: string }) => {

bounty issuer:{' '} - {bountyData?.issuerDegenOrEnsName || bountyData?.issuer} + + {' '} + {bountyData?.issuerDegenOrEnsName || bountyData?.issuer} +

diff --git a/src/components/bounty/ProofItem.tsx b/src/components/bounty/ProofItem.tsx index 31106992..948a2af4 100644 --- a/src/components/bounty/ProofItem.tsx +++ b/src/components/bounty/ProofItem.tsx @@ -9,6 +9,7 @@ import { useBountyContext } from '@/components/bounty/BountyProvider'; import { acceptClaim, getURI, submitClaimForVote } from '@/app/context/web3'; import { applyBreakAllToLongWords } from '@/lib/uiHelpers'; +import Link from 'next/link'; interface ProofItemProps { id: string; @@ -160,8 +161,10 @@ const ProofItem: React.FC = ({
issuer - {issuerDegenOrEnsName || - `$` + issuer.slice(0, 5) + '...' + issuer.slice(-6)} + + {issuerDegenOrEnsName || + `$` + issuer.slice(0, 5) + '...' + issuer.slice(-6)} +
From 958121a09ae6b6e012313f30796aedfa54826c66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cshrutipanjwani=E2=80=9D?= Date: Tue, 16 Jul 2024 15:00:31 +0530 Subject: [PATCH 2/2] fix: added current network --- src/components/bounty/BountyInfo.tsx | 2 +- src/components/bounty/ProofItem.tsx | 14 +++++++++++++- src/components/bounty/ProofItemAccount.tsx | 13 ++++++++++++- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/components/bounty/BountyInfo.tsx b/src/components/bounty/BountyInfo.tsx index 989313e0..7add95fe 100644 --- a/src/components/bounty/BountyInfo.tsx +++ b/src/components/bounty/BountyInfo.tsx @@ -116,7 +116,7 @@ const BountyInfo = ({ bountyId }: { bountyId: string }) => {

bounty issuer:{' '} {' '} diff --git a/src/components/bounty/ProofItem.tsx b/src/components/bounty/ProofItem.tsx index 948a2af4..331b4a86 100644 --- a/src/components/bounty/ProofItem.tsx +++ b/src/components/bounty/ProofItem.tsx @@ -10,6 +10,7 @@ import { useBountyContext } from '@/components/bounty/BountyProvider'; import { acceptClaim, getURI, submitClaimForVote } from '@/app/context/web3'; import { applyBreakAllToLongWords } from '@/lib/uiHelpers'; import Link from 'next/link'; +import { usePathname } from 'next/navigation'; interface ProofItemProps { id: string; @@ -36,6 +37,9 @@ const ProofItem: React.FC = ({ const { user, primaryWallet } = useDynamicContext(); const [claimsURI, setClaimsURI] = useState(''); const [imageUrl, setImageUrl] = useState(null); + + const path = usePathname(); + const [currentNetworkName, setCurrentNetworkName] = useState(''); const { isMultiplayer, isOwner, @@ -45,6 +49,11 @@ const ProofItem: React.FC = ({ } = useBountyContext()!; const issuerDegenOrEnsName = useDegenOrEnsName(issuer); + useEffect(() => { + const currentUrl = path.split('/')[1]; + setCurrentNetworkName(currentUrl || 'base'); + }, []); + useEffect(() => { if (id) { getURI(id) @@ -161,7 +170,10 @@ const ProofItem: React.FC = ({

issuer - + {issuerDegenOrEnsName || `$` + issuer.slice(0, 5) + '...' + issuer.slice(-6)} diff --git a/src/components/bounty/ProofItemAccount.tsx b/src/components/bounty/ProofItemAccount.tsx index d207fa76..29db711f 100644 --- a/src/components/bounty/ProofItemAccount.tsx +++ b/src/components/bounty/ProofItemAccount.tsx @@ -5,6 +5,7 @@ import React, { useEffect, useState } from 'react'; import { useDegenOrEnsName } from '@/hooks/useDegenOrEnsName'; import { acceptClaim, getURI, submitClaimForVote } from '@/app/context/web3'; +import { usePathname } from 'next/navigation'; interface ProofItemProps { id: string; @@ -35,6 +36,13 @@ const ProofItem: React.FC = ({ // const currentUser = user?.verifiedCredentials[0].address; // const notOwner = currentUser === issuer ; + const path = usePathname(); + const [currentNetworkName, setCurrentNetworkName] = useState(''); + + useEffect(() => { + const currentUrl = path.split('/')[1]; + setCurrentNetworkName(currentUrl || 'base'); + }, []); useEffect(() => { if (id) { @@ -112,7 +120,10 @@ const ProofItem: React.FC = ({
issuer - + {issuerDegenOrEnsName || `$` + issuer.slice(0, 5) + '...' + issuer.slice(-6)}