File tree Expand file tree Collapse file tree 4 files changed +11
-5
lines changed
(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20
team/components/last-visited-page Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -3,3 +3,4 @@ export const COOKIE_PREFIX_TOKEN = "tw_token_";
33
44export const LAST_USED_PROJECT_ID = "last-used-project-id" ;
55export const LAST_USED_TEAM_ID = "last-used-team-id" ;
6+ export const HAS_USED_DASHBOARD = "has-used-dashboard" ;
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import Link from "next/link";
99import { useMemo } from "react" ;
1010import { type ThirdwebContract , ZERO_ADDRESS } from "thirdweb" ;
1111import type { ChainMetadata } from "thirdweb/chains" ;
12- import { useActiveAccount } from "thirdweb/react" ;
1312import { Img } from "@/components/blocks/Img" ;
1413import { Button } from "@/components/ui/button" ;
1514import { CopyAddressButton } from "@/components/ui/CopyAddressButton" ;
@@ -51,6 +50,7 @@ export function ContractHeaderUI(props: {
5150 imageClassName ?: string ;
5251 contractCreator : string | null ;
5352 className ?: string ;
53+ isDashboardUser : boolean ;
5454} ) {
5555 const socialUrls = useMemo ( ( ) => {
5656 const socialUrlsValue : { name : string ; href : string } [ ] = [ ] ;
@@ -66,7 +66,6 @@ export function ContractHeaderUI(props: {
6666
6767 return socialUrlsValue ;
6868 } , [ props . socialUrls ] ) ;
69- const activeAccount = useActiveAccount ( ) ;
7069
7170 const cleanedChainName = props . chainMetadata ?. name
7271 ?. replace ( "Mainnet" , "" )
@@ -172,8 +171,7 @@ export function ContractHeaderUI(props: {
172171 variant = "outline"
173172 />
174173
175- { props . contractCreator ?. toLowerCase ( ) ===
176- activeAccount ?. address ?. toLowerCase ( ) && (
174+ { props . isDashboardUser && (
177175 < ToolTipLabel
178176 contentClassName = "max-w-[300px]"
179177 label = {
Original file line number Diff line number Diff line change 1+ import { cookies } from "next/headers" ;
12import type { ThirdwebContract } from "thirdweb" ;
23import type { ChainMetadata } from "thirdweb/chains" ;
34import { getContractMetadata } from "thirdweb/extensions/common" ;
45import { decimals , getActiveClaimCondition } from "thirdweb/extensions/erc20" ;
56import { GridPattern } from "@/components/ui/background-patterns" ;
7+ import { HAS_USED_DASHBOARD } from "@/constants/cookie" ;
68import { resolveFunctionSelectors } from "@/lib/selectors" ;
79import { AssetPageView } from "../_components/asset-page-view" ;
810import { getContractCreator } from "../_components/getContractCreator" ;
@@ -65,6 +67,9 @@ export async function ERC20PublicPage(props: {
6567 : undefined ,
6668 ] ) ;
6769
70+ const cookieStore = await cookies ( ) ;
71+ const isDashboardUser = cookieStore . has ( HAS_USED_DASHBOARD ) ;
72+
6873 const buyEmbed = (
6974 < BuyEmbed
7075 chainMetadata = { props . chainMetadata }
@@ -96,6 +101,7 @@ export async function ERC20PublicPage(props: {
96101 clientContract = { props . clientContract }
97102 contractCreator = { contractCreator }
98103 image = { contractMetadata . image }
104+ isDashboardUser = { isDashboardUser }
99105 name = { contractMetadata . name }
100106 socialUrls = {
101107 typeof contractMetadata . social_urls === "object" &&
Original file line number Diff line number Diff line change 22
33import { usePathname } from "next/navigation" ;
44import { useEffect } from "react" ;
5- import { LAST_USED_TEAM_ID } from "@/constants/cookie" ;
5+ import { HAS_USED_DASHBOARD , LAST_USED_TEAM_ID } from "@/constants/cookie" ;
66import { setCookie } from "@/utils/cookie" ;
77import { LAST_VISITED_TEAM_PAGE_PATH } from "./consts" ;
88
@@ -13,6 +13,7 @@ export function SaveLastVisitedTeamPage(props: { teamId: string }) {
1313 useEffect ( ( ) => {
1414 setCookie ( LAST_VISITED_TEAM_PAGE_PATH , pathname ) ;
1515 setCookie ( LAST_USED_TEAM_ID , props . teamId ) ;
16+ setCookie ( HAS_USED_DASHBOARD , "true" ) ;
1617 } , [ pathname , props . teamId ] ) ;
1718
1819 return null ;
You can’t perform that action at this time.
0 commit comments