File tree Expand file tree Collapse file tree 4 files changed +58
-5
lines changed
apps/dashboard/src/app/(app)/team
[team_slug]/[project_slug]/contract/[chainIdOrSlug]/[contractAddress] Expand file tree Collapse file tree 4 files changed +58
-5
lines changed Original file line number Diff line number Diff line change 11import { redirect } from "next/navigation" ;
2+ import { getAuthToken , getAuthTokenWalletAddress } from "@/api/auth-token" ;
23import { getProjects } from "@/api/projects" ;
34import { getTeams } from "@/api/team" ;
45import { AppFooter } from "@/components/footers/app-footer" ;
56import { getClientThirdwebClient } from "@/constants/thirdweb-client.client" ;
6- import {
7- getAuthToken ,
8- getAuthTokenWalletAddress ,
9- } from "../../../../../../../../@/api/auth-token" ;
10- import { ErrorProvider } from "../../../../../../../../@/contexts/error-handler" ;
7+ import { ErrorProvider } from "@/contexts/error-handler" ;
8+ import { ContractIcon } from "@/icons/ContractIcon" ;
119import { SharedContractLayout } from "../../../../../../(dashboard)/(chain)/[chain_id]/[contractAddress]/shared-layout" ;
1210import { getValidAccount } from "../../../../../../account/settings/getAccount" ;
1311import { TeamHeaderLoggedIn } from "../../../../../components/TeamHeader/team-header-logged-in.client" ;
@@ -66,6 +64,11 @@ export default async function ContractLayout(props: {
6664 < TeamHeaderLoggedIn
6765 account = { account }
6866 accountAddress = { accountAddress }
67+ activeProjectSubpageLink = { {
68+ href : `/team/${ params . team_slug } /${ params . project_slug } /contracts` ,
69+ icon : < ContractIcon /> ,
70+ label : "Contracts" ,
71+ } }
6972 client = { client }
7073 currentProject = { project }
7174 currentTeam = { team }
Original file line number Diff line number Diff line change 11import type { Meta , StoryObj } from "@storybook/nextjs" ;
2+ import { BoxIcon } from "lucide-react" ;
23import { ThirdwebProvider } from "thirdweb/react" ;
34import type { Project } from "@/api/projects" ;
45import type { Team } from "@/api/team" ;
@@ -119,6 +120,19 @@ function Variants(props: { type: "mobile" | "desktop" }) {
119120 type = { props . type }
120121 />
121122 </ BadgeContainer >
123+
124+ < BadgeContainer label = "Pro Plan - active subpage" >
125+ < Variant
126+ activeProjectSubpageLink = { {
127+ href : "/team/project/foo" ,
128+ icon : < BoxIcon /> ,
129+ label : "Foo" ,
130+ } }
131+ currentProject = { proTeam . projects [ 0 ] }
132+ team = { proTeam . team }
133+ type = { props . type }
134+ />
135+ </ BadgeContainer >
122136 </ div >
123137 </ ThirdwebProvider >
124138 ) ;
@@ -132,6 +146,11 @@ function Variant(props: {
132146 team : Team ;
133147 type : "mobile" | "desktop" ;
134148 currentProject ?: Project ;
149+ activeProjectSubpageLink ?: {
150+ label : string ;
151+ href : string ;
152+ icon : React . ReactNode ;
153+ } ;
135154} ) {
136155 const Comp =
137156 props . type === "mobile" ? TeamHeaderMobileUI : TeamHeaderDesktopUI ;
@@ -144,6 +163,7 @@ function Variant(props: {
144163 id : "foo" ,
145164 } }
146165 accountAddress = { "0x1F846F6DAE38E1C88D71EAA191760B15f38B7A37" }
166+ activeProjectSubpageLink = { props . activeProjectSubpageLink }
147167 client = { storybookThirdwebClient }
148168 connectButton = { < ConnectButtonStub /> }
149169 createProject = { ( ) => { } }
Original file line number Diff line number Diff line change @@ -29,6 +29,13 @@ export type TeamHeaderCompProps = {
2929 createTeam : ( ) => void ;
3030 client : ThirdwebClient ;
3131 accountAddress : string ;
32+ activeProjectSubpageLink :
33+ | {
34+ label : string ;
35+ icon : React . ReactNode ;
36+ href : string ;
37+ }
38+ | undefined ;
3239} ;
3340
3441export function TeamHeaderDesktopUI ( props : TeamHeaderCompProps ) {
@@ -107,6 +114,23 @@ export function TeamHeaderDesktopUI(props: TeamHeaderCompProps) {
107114 teamsAndProjects = { props . teamsAndProjects }
108115 />
109116 </ div >
117+
118+ { props . activeProjectSubpageLink && (
119+ < >
120+ < SlashSeparator />
121+ < div className = "flex items-center gap-1.5" >
122+ < div className = "flex items-center justify-center rounded-full border size-6 [&>svg]:size-[50%] [&>svg]:text-muted-foreground" >
123+ { props . activeProjectSubpageLink . icon }
124+ </ div >
125+ < Link
126+ className = "flex flex-row items-center gap-2 font-semibold text-sm"
127+ href = { props . activeProjectSubpageLink . href }
128+ >
129+ { props . activeProjectSubpageLink . label }
130+ </ Link >
131+ </ div >
132+ </ >
133+ ) }
110134 </ >
111135 ) }
112136 </ div >
Original file line number Diff line number Diff line change @@ -28,6 +28,11 @@ export function TeamHeaderLoggedIn(props: {
2828 account : Pick < Account , "email" | "id" > ;
2929 accountAddress : string ;
3030 client : ThirdwebClient ;
31+ activeProjectSubpageLink ?: {
32+ label : string ;
33+ href : string ;
34+ icon : React . ReactNode ;
35+ } ;
3136} ) {
3237 // identify the account
3338 useIdentifyAccount ( {
@@ -63,6 +68,7 @@ export function TeamHeaderLoggedIn(props: {
6368 const headerProps : TeamHeaderCompProps = {
6469 account : props . account ,
6570 accountAddress : props . accountAddress ,
71+ activeProjectSubpageLink : props . activeProjectSubpageLink ,
6672 client : props . client ,
6773 connectButton : (
6874 < CustomConnectWallet client = { props . client } isLoggedIn = { true } />
You can’t perform that action at this time.
0 commit comments