-
Notifications
You must be signed in to change notification settings - Fork 619
[BLD-166] Dashboard: Show Manage Contract button if user has used dashboard #7898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BLD-166] Dashboard: Show Manage Contract button if user has used dashboard #7898
Conversation
|
WalkthroughAdds a HAS_USED_DASHBOARD cookie constant, sets that cookie when saving a team’s last-visited page, reads it server-side on ERC20 and NFT public pages to compute isDashboardUser, and forwards that boolean to ContractHeaderUI which now renders “Manage Contract” based on this prop rather than active account. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant TeamPage as Team Page (client)
participant Cookie as Browser Cookies
User->>TeamPage: Visit team page
TeamPage->>Cookie: set LAST_VISITED_TEAM_PAGE_PATH
TeamPage->>Cookie: set LAST_USED_TEAM_ID
TeamPage->>Cookie: set HAS_USED_DASHBOARD = "true"
note over Cookie: Flag marks user as a dashboard user
sequenceDiagram
autonumber
participant Client as Browser
participant Server as Public Page (server)
participant Cookie as Request Cookies
participant Header as ContractHeaderUI
Client->>Server: Request public page
Server->>Server: Fetch contract metadata & other data
Server->>Cookie: read HAS_USED_DASHBOARD
Server->>Header: render with isDashboardUser = Cookie.present
alt isDashboardUser = true
Header->>Client: Include "Manage Contract" UI
else
Header->>Client: Omit "Manage Contract" UI
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Assessment against linked issues
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7898 +/- ##
=======================================
Coverage 56.53% 56.53%
=======================================
Files 904 904
Lines 58592 58592
Branches 4143 4143
=======================================
Hits 33126 33126
Misses 25360 25360
Partials 106 106
🚀 New features to boost your workflow:
|
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.tsx (1)
174-198: Revise CTA copy, add accessibility label, and correct the dashboard routeIn
ContractHeader.tsx(apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.tsx, lines 174–198):
- Simplify the tooltip and button text for clarity.
- Add an
aria-labelto the<Link>for screen-reader access.- Update the
hrefto use the actual internal route
/team/${teamSlug}/${projectSlug}/contract/${chainIdOrSlug}/${contractAddress}
(see apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/contract/[chainIdOrSlug]/[contractAddress]/page.tsx).--- a/.../ContractHeader.tsx +++ b/.../ContractHeader.tsx @@ 174,198 - {props.isDashboardUser && ( - <ToolTipLabel - contentClassName="max-w-[300px]" - label={ - <> - View this contract in thirdweb dashboard to view contract - management interface - </> - } - > - <Button - asChild - className="rounded-full bg-card gap-1.5 text-xs py-1.5 px-2.5 h-auto" - size="sm" - variant="outline" - > - <Link - href={`/team/~/~/contract/${props.chainMetadata.slug}/${props.clientContract.address}`} - > - <Settings2Icon className="size-3.5 text-muted-foreground" /> - Manage Contract - </Link> - </Button> - </ToolTipLabel> - )} + {props.isDashboardUser && ( + <ToolTipLabel + contentClassName="max-w-[300px]" + label={<>Open this contract in the dashboard to manage it.</>} + > + <Button + asChild + className="rounded-full bg-card gap-1.5 text-xs py-1.5 px-2.5 h-auto" + size="sm" + variant="outline" + > + <Link + aria-label="Manage this contract in the dashboard" + href={`/team/${teamSlug}/${projectSlug}/contract/${props.chainMetadata.slug}/${props.clientContract.address}`} + > + <Settings2Icon className="size-3.5 text-muted-foreground" /> + Manage Contract + </Link> + </Button> + </ToolTipLabel> + )}Note: you’ll need to import or derive
teamSlugandprojectSlug(e.g. via Next.js’suseParams()) so the link resolves correctly.
🧹 Nitpick comments (6)
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.tsx (2)
53-54: Type the new prop, and narrowsocialUrlsshapeGood call surfacing
isDashboardUserin the public API. While touching the signature, let’s:
- replace
socialUrls: objectwith a precise shape (Record<string, string>)- extract a
ContractHeaderPropstype alias- add an explicit return type on the component
Apply this diff to the function signature:
-export function ContractHeaderUI(props: { - name: string; - symbol: string | undefined; - image: string | undefined; - chainMetadata: ChainMetadata; - clientContract: ThirdwebContract; - socialUrls: object; - imageClassName?: string; - contractCreator: string | null; - className?: string; - isDashboardUser: boolean; -}) { +export function ContractHeaderUI(props: ContractHeaderProps): JSX.Element {And add this type alias above the component (e.g., after
platformToIcons):type ContractHeaderProps = { name: string; symbol: string | undefined; image: string | undefined; chainMetadata: ChainMetadata; clientContract: ThirdwebContract; socialUrls: Record<string, string>; imageClassName?: string; contractCreator: string | null; className?: string; isDashboardUser: boolean; };
137-159: AvoidtoSortedfor broader runtime compatibility
Array.prototype.toSortedis still relatively new and may lack polyfills in some environments. Replace with a stable pattern.- {socialUrls - .toSorted((a, b) => { + {socialUrls + .slice() + .sort((a, b) => { const aIcon = platformToIcons[a.name.toLowerCase()]; const bIcon = platformToIcons[b.name.toLowerCase()]; if (aIcon && bIcon) { return 0; } if (aIcon) { return -1; } return 1; })apps/dashboard/src/app/(app)/team/components/last-visited-page/SaveLastVisitedPage.tsx (2)
5-5: Import is correct; consider explicit return type on componentImport looks good. Since this component returns
null, consider adding an explicit return type for clarity and to align with the repo’s TypeScript guideline.Example:
export function SaveLastVisitedTeamPage(props: { teamId: string }): null { // ... return null; }
16-17: Cookie Utility Signature & DefaultsThe
setCookiefunction inapps/dashboard/src/@/utils/cookie.tsis defined asexport function setCookie(name: string, value: string, days = 365) { … }which means:
- Persistence is controlled via the
daysparameter (default 365 days).- There is no
pathoption, so the cookie is scoped to the current path by default.To ensure this flag is both broadly available (path = “/”) and survives browser restarts:
• If you only need to adjust persistence, you can pass a 3rd arg in days, e.g.:
setCookie(HAS_USED_DASHBOARD, "true", 180);• If you also want to scope the cookie to
/, consider refactoring the util to accept an options object:// apps/dashboard/src/@/utils/cookie.ts -export function setCookie(name: string, value: string, days = 365) { - const date = new Date(); - date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000); - document.cookie = `${name}=${value}; expires=${date.toUTCString()}`; -} +interface CookieOptions { + days?: number; + path?: string; +} + +export function setCookie( + name: string, + value: string, + options: CookieOptions = {} +) { + const { days = 365, path = "/" } = options; + const expires = new Date(Date.now() + days * 24 * 60 * 60 * 1000).toUTCString(); + document.cookie = `${name}=${value}; expires=${expires}; path=${path}`; +}You could then call in your effect:
setCookie(HAS_USED_DASHBOARD, "true", { days: 180, path: "/" });Let me know if you’d like assistance wiring up this optional refactor!
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx (2)
70-72: Don’t awaitcookies(); consider checking the cookie value explicitly
cookies()is synchronous;awaitis unnecessary. Also, since you set"true"as the value, checking the value increases resilience if we ever set it to"false"(or remove it) later.Apply this diff:
- const cookieStore = await cookies(); - const isDashboardUser = cookieStore.has(HAS_USED_DASHBOARD); + const cookieStore = cookies(); + const isDashboardUser = cookieStore.get(HAS_USED_DASHBOARD)?.value === "true";
1-1: Mark as a server-only moduleAdd the guard to prevent accidental client bundling.
+import "server-only"; import { cookies } from "next/headers";
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (4)
apps/dashboard/src/@/constants/cookie.ts(1 hunks)apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.tsx(2 hunks)apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx(3 hunks)apps/dashboard/src/app/(app)/team/components/last-visited-page/SaveLastVisitedPage.tsx(2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from@/typesor localtypes.tsbarrels
Prefer type aliases over interface except for nominal shapes
Avoidanyandunknownunless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial,Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Files:
apps/dashboard/src/@/constants/cookie.tsapps/dashboard/src/app/(app)/team/components/last-visited-page/SaveLastVisitedPage.tsxapps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.tsxapps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)
Files:
apps/dashboard/src/@/constants/cookie.tsapps/dashboard/src/app/(app)/team/components/last-visited-page/SaveLastVisitedPage.tsxapps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.tsxapps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx
apps/{dashboard,playground-web}/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
apps/{dashboard,playground-web}/**/*.{ts,tsx}: Import UI primitives from@/components/ui/*(Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
UseNavLinkfor internal navigation with automatic active states in dashboard and playground apps
Use Tailwind CSS only – no inline styles or CSS modules
Usecn()from@/lib/utilsfor conditional class logic
Use design system tokens (e.g.,bg-card,border-border,text-muted-foreground)
Server Components (Node edge): Start files withimport "server-only";
Client Components (browser): Begin files with'use client';
Always callgetAuthToken()to retrieve JWT from cookies on server side
UseAuthorization: Bearerheader – never embed tokens in URLs
Return typed results (e.g.,Project[],User[]) – avoidany
Wrap client-side data fetching calls in React Query (@tanstack/react-query)
Use descriptive, stablequeryKeysfor React Query cache hits
ConfigurestaleTime/cacheTimein React Query based on freshness (default ≥ 60s)
Keep tokens secret via internal API routes or server actions
Never importposthog-jsin server components
Files:
apps/dashboard/src/@/constants/cookie.tsapps/dashboard/src/app/(app)/team/components/last-visited-page/SaveLastVisitedPage.tsxapps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.tsxapps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx
🧠 Learnings (6)
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{ts,tsx} : Reading cookies/headers with `next/headers` (`getAuthToken()`, `cookies()`).
Applied to files:
apps/dashboard/src/@/constants/cookie.tsapps/dashboard/src/app/(app)/team/components/last-visited-page/SaveLastVisitedPage.tsxapps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (`useState`, `useEffect`, React Query, wallet hooks).
Applied to files:
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.tsxapps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx
📚 Learning: 2025-06-17T18:30:52.976Z
Learnt from: MananTank
PR: thirdweb-dev/js#7356
File: apps/nebula/src/app/not-found.tsx:1-1
Timestamp: 2025-06-17T18:30:52.976Z
Learning: In the thirdweb/js project, the React namespace is available for type annotations (like React.FC) without needing to explicitly import React. This is project-specific configuration that differs from typical TypeScript/React setups.
Applied to files:
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.tsx
📚 Learning: 2025-05-27T19:54:55.885Z
Learnt from: MananTank
PR: thirdweb-dev/js#7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx:15-17
Timestamp: 2025-05-27T19:54:55.885Z
Learning: The `fetchDashboardContractMetadata` function from "3rdweb-sdk/react/hooks/useDashboardContractMetadata" has internal error handlers for all promises and cannot throw errors, so external error handling is not needed when calling this function.
Applied to files:
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Anything that consumes hooks from `tanstack/react-query` or thirdweb SDKs.
Applied to files:
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : When you need access to browser APIs (localStorage, window, IntersectionObserver etc.).
Applied to files:
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx
🧬 Code graph analysis (2)
apps/dashboard/src/app/(app)/team/components/last-visited-page/SaveLastVisitedPage.tsx (1)
apps/dashboard/src/@/constants/cookie.ts (1)
HAS_USED_DASHBOARD(6-6)
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx (1)
apps/dashboard/src/@/constants/cookie.ts (1)
HAS_USED_DASHBOARD(6-6)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: Unit Tests
- GitHub Check: Size
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: Build Packages
- GitHub Check: Lint Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apps/dashboard/src/@/constants/cookie.ts (1)
6-6: Cookie key addition looks good; confirm scope and retention
HAS_USED_DASHBOARDis straightforward. Please confirm:
- we want simple presence-based detection (vs checking value)
- cookie should be accessible across the whole dashboard domain (
path=/) and persist beyond the sessionIf persistence and global scope are desired, ensure the writer sets appropriate options (see comment in SaveLastVisitedPage).
.../src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx
Show resolved
Hide resolved
e3a4173 to
c98e51d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (5)
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.stories.tsx (2)
106-122: Add a Storybook control + set default args to avoid duplicationThe dedicated NotDashboardUser story is useful. To reduce repetition across stories and make it easy to toggle, set a default
argsand expose a boolean control forisDashboardUserat the meta level.Apply this diff to add controls/defaults:
const meta = { component: ContractHeaderUI, decorators: [ @@ parameters: { nextjs: { appDirectory: true, }, }, + argTypes: { + isDashboardUser: { control: "boolean" }, + }, + args: { + isDashboardUser: true, + }, title: "ERC20/ContractHeader", } satisfies Meta<typeof ContractHeaderUI>;Then keep
NotDashboardUseras the lone override withisDashboardUser: false.
140-140: DRY: Remove repeatedisDashboardUser: truewhen defaulted in metaIf you accept the meta default, these explicit fields become redundant. Consider removing them for brevity.
Example cleanup:
symbol: "SMPL", - isDashboardUser: true,Also applies to: 155-155, 168-168, 189-189, 214-214, 233-233, 249-249
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page.tsx (2)
105-107: Remove unnecessary await oncookies()
cookies()fromnext/headersis synchronous. Theawaitis unnecessary and slightly misleading.Apply this diff:
- const cookieStore = await cookies(); + const cookieStore = cookies();
1-1: Mark as server-only to prevent accidental client bundlingThis file executes entirely on the server (uses
cookies()and no client hooks). Add theserver-onlydirective to ensure it never gets bundled for the client.Apply this diff:
+import "server-only"; import { cookies } from "next/headers";apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page-layout.tsx (1)
10-14: Optional: strengthen types to avoid repeated runtime checksYou’re guarding
contractMetadata.imageandsocial_urlsat runtime. If a shared type exists, prefer importing it; otherwise introduce a narrow local type to reducetypeofchecks and improve readability.Example:
-export function NFTPublicPageLayout(props: { - clientContract: ThirdwebContract; - chainMetadata: ChainMetadata; - contractMetadata: { - name: string; - symbol: string; - [key: string]: unknown; - }; +type SocialUrls = Partial<Record< + "custom" | "discord" | "github" | "instagram" | "linkedin" | "reddit" | "telegram" | "tiktok" | "twitter" | "website" | "youtube", + string +>>; + +type ContractMetadataLite = { + name: string; + symbol: string; + image?: string; + social_urls?: SocialUrls; +}; + +export function NFTPublicPageLayout(props: { + clientContract: ThirdwebContract; + chainMetadata: ChainMetadata; + contractMetadata: ContractMetadataLite; children: React.ReactNode; contractCreator: string | null; isDashboardUser: boolean; }) { @@ - image={ - typeof props.contractMetadata.image === "string" - ? props.contractMetadata.image - : undefined - } + image={props.contractMetadata.image} @@ - socialUrls={ - typeof props.contractMetadata.social_urls === "object" && - props.contractMetadata.social_urls !== null - ? props.contractMetadata.social_urls - : {} - } + socialUrls={props.contractMetadata.social_urls ?? {}}If a canonical metadata type already exists in
@/types, re-use it instead of introducing a new local alias.Also applies to: 34-41
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (7)
apps/dashboard/src/@/constants/cookie.ts(1 hunks)apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.stories.tsx(8 hunks)apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.tsx(2 hunks)apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx(3 hunks)apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page-layout.tsx(2 hunks)apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page.tsx(2 hunks)apps/dashboard/src/app/(app)/team/components/last-visited-page/SaveLastVisitedPage.tsx(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
- apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.tsx
- apps/dashboard/src/@/constants/cookie.ts
- apps/dashboard/src/app/(app)/team/components/last-visited-page/SaveLastVisitedPage.tsx
- apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from@/typesor localtypes.tsbarrels
Prefer type aliases over interface except for nominal shapes
Avoidanyandunknownunless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial,Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Files:
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.stories.tsxapps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page.tsxapps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page-layout.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)
Files:
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.stories.tsxapps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page.tsxapps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page-layout.tsx
apps/{dashboard,playground-web}/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
apps/{dashboard,playground-web}/**/*.{ts,tsx}: Import UI primitives from@/components/ui/*(Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
UseNavLinkfor internal navigation with automatic active states in dashboard and playground apps
Use Tailwind CSS only – no inline styles or CSS modules
Usecn()from@/lib/utilsfor conditional class logic
Use design system tokens (e.g.,bg-card,border-border,text-muted-foreground)
Server Components (Node edge): Start files withimport "server-only";
Client Components (browser): Begin files with'use client';
Always callgetAuthToken()to retrieve JWT from cookies on server side
UseAuthorization: Bearerheader – never embed tokens in URLs
Return typed results (e.g.,Project[],User[]) – avoidany
Wrap client-side data fetching calls in React Query (@tanstack/react-query)
Use descriptive, stablequeryKeysfor React Query cache hits
ConfigurestaleTime/cacheTimein React Query based on freshness (default ≥ 60s)
Keep tokens secret via internal API routes or server actions
Never importposthog-jsin server components
Files:
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.stories.tsxapps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page.tsxapps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page-layout.tsx
**/*.stories.tsx
📄 CodeRabbit inference engine (CLAUDE.md)
For new UI components, add Storybook stories (
*.stories.tsx) alongside the code
Files:
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.stories.tsx
🧠 Learnings (10)
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{ts,tsx} : Reading cookies/headers with `next/headers` (`getAuthToken()`, `cookies()`).
Applied to files:
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (`useState`, `useEffect`, React Query, wallet hooks).
Applied to files:
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page.tsxapps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page-layout.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Pages requiring fast transitions where data is prefetched on the client.
Applied to files:
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page.tsx
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Always call `getAuthToken()` to retrieve JWT from cookies on server side
Applied to files:
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/layout.tsx : Building layout shells (`layout.tsx`) and top-level pages that mainly assemble data.
Applied to files:
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page.tsxapps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page-layout.tsx
📚 Learning: 2025-05-27T19:54:55.885Z
Learnt from: MananTank
PR: thirdweb-dev/js#7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx:15-17
Timestamp: 2025-05-27T19:54:55.885Z
Learning: The `fetchDashboardContractMetadata` function from "3rdweb-sdk/react/hooks/useDashboardContractMetadata" has internal error handlers for all promises and cannot throw errors, so external error handling is not needed when calling this function.
Applied to files:
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Anything that consumes hooks from `tanstack/react-query` or thirdweb SDKs.
Applied to files:
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : When you need access to browser APIs (localStorage, window, IntersectionObserver etc.).
Applied to files:
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Create light wrappers (e.g. `fetchJson`) that automatically attach the JWT from cookies/session when calling internal API routes.
Applied to files:
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : For notices & skeletons rely on `AnnouncementBanner`, `GenericLoadingPage`, `EmptyStateCard`.
Applied to files:
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page.tsx
🧬 Code graph analysis (1)
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page.tsx (2)
apps/dashboard/src/@/constants/cookie.ts (1)
HAS_USED_DASHBOARD(6-6)apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page-layout.tsx (1)
NFTPublicPageLayout(7-51)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: Size
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Unit Tests
- GitHub Check: Build Packages
- GitHub Check: Lint Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (6)
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.stories.tsx (1)
102-104: Prop wired correctly in storiesAdding
isDashboardUser: trueensures stories reflect the new API surface ofContractHeaderUI. Looks good.apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page.tsx (3)
8-8: Import path for cookie constant is consistent with aliasUsing
@/constants/cookiematches the alias used elsewhere in dashboard code. No issues.
105-107: Confirm dynamic rendering impact of cookies()Next.js’ App Router treats calls to cookies() as a “Dynamic Function,” opting the route into dynamic rendering at request time and disabling full static optimization (stackoverflow.com, medium.com). We ran a search across apps/dashboard/src/app/**/public-pages/nft/*.{ts,tsx} and found no explicit segment config (e.g. export const dynamic, revalidate, fetchCache, runtime or generateStaticParams) to override this behavior.
Please review whether the conditional “Manage Contract” button UX gain outweighs the loss of CDN-backed static caching. If retaining static generation is important:
- Move the HAS_USED_DASHBOARD check into a lightweight client component (e.g., a “use client” boundary) so the page itself can remain static.
- Or infer dashboard-user status via a header-only mechanism or client-side data fetch after hydration.
114-115: AllContractHeaderUIandNFTPublicPageLayoutcall sites includeisDashboardUserRan a full consistency sweep across
apps/dashboard/srcand confirmed every instance of both components now passes theisDashboardUserprop. No missing usages were found, so the prop plumbing is complete.apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page-layout.tsx (2)
17-17: API extension is minimal and clearAdding
isDashboardUser: booleanto the layout’s props is straightforward and keeps concerns localized.
42-42: Prop forwarded correctly toContractHeaderUIThe boolean is passed through as intended; aligns with the ERC20 header usage.
Merge activity
|
…hboard (#7898) <!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR introduces a new constant `HAS_USED_DASHBOARD` to track user engagement with the dashboard. It updates several components to include the `isDashboardUser` prop, allowing for conditional rendering based on whether the user has previously accessed the dashboard. ### Detailed summary - Added `HAS_USED_DASHBOARD` constant in `cookie.ts`. - Updated `NFTPublicPageLayout` to accept `isDashboardUser` prop. - Modified `SaveLastVisitedTeamPage` to set `HAS_USED_DASHBOARD` cookie. - Integrated `isDashboardUser` in `NFTPublicPage` and `ERC20PublicPage`. - Updated `ContractHeaderUI` to conditionally render elements based on `isDashboardUser`. - Enhanced storybook stories to include `isDashboardUser` prop for testing. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Dashboard users are now detected via a persistent flag so public ERC20 and NFT pages can tailor the header UI and surface “Manage Contract” controls when appropriate. * Stories updated to cover dashboard vs non-dashboard header states. * **Bug Fixes** * More reliable dashboard-user detection ensures the “Manage Contract” controls display consistently on public contract pages. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
c98e51d to
98fab93
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.stories.tsx (3)
102-104: Deduplicate isDashboardUser across stories; set a default in meta and add a Storybook control.You’re repeating
isDashboardUser: truein most stories. Prefer a default at the meta level plus a boolean control so reviewers can toggle the state interactively. Keep the explicitfalseonly where you need to showcase the non-dashboard behavior.Apply these removals within the shown ranges:
- isDashboardUser: true,Then update the
metaobject to set a default and expose a control (outside the selected ranges; shown here for clarity):const meta = { component: ContractHeaderUI, decorators: [ (Story) => ( <ThirdwebProvider> <div className="container max-w-7xl py-10"> <Story /> </div> </ThirdwebProvider> ), ], parameters: { nextjs: { appDirectory: true } }, title: "ERC20/ContractHeader", // New: default args + control args: { isDashboardUser: true, }, argTypes: { isDashboardUser: { control: { type: "boolean" }, description: "Whether the viewer has used the Dashboard; toggles Manage Contract affordances.", }, }, } satisfies Meta<typeof ContractHeaderUI>;Also applies to: 140-141, 155-156, 168-169, 189-190, 214-215, 233-234, 249-250
106-122: Good negative-state coverage; add a simple play assertion to prevent regressions.Nice addition of a “non-dashboard user” story. Add a
playfunction to assert that “Manage Contract” is not rendered so future refactors can’t silently break the condition.Apply this diff within this story block:
export const NotDashboardUser: Story = { args: { chainMetadata: ethereumChainMetadata, clientContract: mockContract, contractCreator: null, image: mockTokenImage, name: "Sample Token", socialUrls: { discord: mockSocialUrls.discord, github: mockSocialUrls.github, telegram: mockSocialUrls.telegram, twitter: mockSocialUrls.twitter, website: mockSocialUrls.website, }, symbol: "SMPL", isDashboardUser: false, }, + // Assert "Manage Contract" is not visible for non-dashboard users + async play({ canvasElement }) { + const { within } = await import("@storybook/test"); + const canvas = within(canvasElement); + const link = canvas.queryByRole("link", { name: /manage contract/i }); + const btn = canvas.queryByRole("button", { name: /manage contract/i }); + if (link || btn) { + throw new Error('Expected "Manage Contract" to be hidden when isDashboardUser=false'); + } + }, };Note: If your project pins SB v7 and doesn’t expose
@storybook/test, import from@storybook/testing-libraryinstead. If desired, mirror this with a positive assertion in one of theisDashboardUser=truestories.
12-17: Pass the Thirdweb client into the provider to avoid context gaps.
ThirdwebProvidercan accept aclientprop. Since your mocks are created withstorybookThirdwebClient, pass it through the provider to ensure any components under test that rely on context read the same client instance.- <ThirdwebProvider> + <ThirdwebProvider client={storybookThirdwebClient}> <div className="container max-w-7xl py-10"> <Story /> </div> </ThirdwebProvider>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (7)
apps/dashboard/src/@/constants/cookie.ts(1 hunks)apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.stories.tsx(8 hunks)apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.tsx(2 hunks)apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx(3 hunks)apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page-layout.tsx(2 hunks)apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page.tsx(2 hunks)apps/dashboard/src/app/(app)/team/components/last-visited-page/SaveLastVisitedPage.tsx(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
- apps/dashboard/src/@/constants/cookie.ts
- apps/dashboard/src/app/(app)/team/components/last-visited-page/SaveLastVisitedPage.tsx
- apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.tsx
- apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page.tsx
- apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/nft-page-layout.tsx
- apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from@/typesor localtypes.tsbarrels
Prefer type aliases over interface except for nominal shapes
Avoidanyandunknownunless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial,Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Files:
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.stories.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)
Files:
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.stories.tsx
apps/{dashboard,playground-web}/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
apps/{dashboard,playground-web}/**/*.{ts,tsx}: Import UI primitives from@/components/ui/*(Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
UseNavLinkfor internal navigation with automatic active states in dashboard and playground apps
Use Tailwind CSS only – no inline styles or CSS modules
Usecn()from@/lib/utilsfor conditional class logic
Use design system tokens (e.g.,bg-card,border-border,text-muted-foreground)
Server Components (Node edge): Start files withimport "server-only";
Client Components (browser): Begin files with'use client';
Always callgetAuthToken()to retrieve JWT from cookies on server side
UseAuthorization: Bearerheader – never embed tokens in URLs
Return typed results (e.g.,Project[],User[]) – avoidany
Wrap client-side data fetching calls in React Query (@tanstack/react-query)
Use descriptive, stablequeryKeysfor React Query cache hits
ConfigurestaleTime/cacheTimein React Query based on freshness (default ≥ 60s)
Keep tokens secret via internal API routes or server actions
Never importposthog-jsin server components
Files:
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.stories.tsx
**/*.stories.tsx
📄 CodeRabbit inference engine (CLAUDE.md)
For new UI components, add Storybook stories (
*.stories.tsx) alongside the code
Files:
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.stories.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: Size
- GitHub Check: Build Packages
- GitHub Check: Unit Tests
- GitHub Check: Lint Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.stories.tsx (1)
6-6: ✅ ContractHeaderUI prop typing and usage verifiedContractHeaderUI correctly declares
isDashboardUser: boolean(non-optional) and uses it exclusively to guard the “Manage Contract” button. Both ERC20 and NFT public pages compute and pass this prop as intended.• In
apps/dashboard/src/app/(…)/public-pages/erc20/_components/ContractHeader.tsx
– Prop signature includesisDashboardUser: boolean(line 53)
– Conditional rendering{props.isDashboardUser && (…)}wraps the Manage Contract affordance (lines 174–184)
• Inapps/dashboard/src/app/(…)/public-pages/erc20/erc20.tsx
–const isDashboardUser = cookieStore.has(HAS_USED_DASHBOARD)and passed viaisDashboardUser={isDashboardUser}(around line 104)
• Inapps/dashboard/src/app/(…)/public-pages/nft/nft-page-layout.tsx
– Layout props includeisDashboardUser: boolean(line 17) and passed into<ContractHeaderUI … isDashboardUser={props.isDashboardUser} />(line 42)No further changes required.

PR-Codex overview
This PR introduces a new constant for tracking dashboard usage and integrates it across various components, enhancing user experience by determining if the user has interacted with the dashboard.
Detailed summary
HAS_USED_DASHBOARDconstant incookie.ts.NFTPublicPageLayoutto acceptisDashboardUserprop.isDashboardUserbased on cookie presence innft-page.tsxanderc20.tsx.ContractHeaderUIto conditionally render elements based onisDashboardUser.isDashboardUserprop.Summary by CodeRabbit
New Features
Bug Fixes