Skip to content

Commit 764162b

Browse files
committed
Merge remote-tracking branch 'origin/main' into ph/engineWallets
2 parents 94ab454 + 982219a commit 764162b

File tree

70 files changed

+819
-269
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+819
-269
lines changed

.changeset/nervous-tips-pay.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

apps/dashboard/src/@/api/team-members.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import "server-only";
2-
import { COOKIE_ACTIVE_ACCOUNT, COOKIE_PREFIX_TOKEN } from "@/constants/cookie";
32
import { API_SERVER_URL } from "@/constants/env";
4-
import { cookies } from "next/headers";
3+
import { getAuthToken } from "../../app/api/lib/getAuthToken";
54

65
const TeamAccountRole = {
76
OWNER: "OWNER",
@@ -26,14 +25,10 @@ export type TeamMember = {
2625
};
2726

2827
export async function getMembers(teamSlug: string) {
29-
const cookiesManager = cookies();
30-
const activeAccount = cookiesManager.get(COOKIE_ACTIVE_ACCOUNT)?.value;
31-
const token = activeAccount
32-
? cookiesManager.get(COOKIE_PREFIX_TOKEN + activeAccount)?.value
33-
: null;
28+
const token = getAuthToken();
3429

3530
if (!token) {
36-
return [];
31+
return undefined;
3732
}
3833

3934
const teamsRes = await fetch(
@@ -44,8 +39,10 @@ export async function getMembers(teamSlug: string) {
4439
},
4540
},
4641
);
42+
4743
if (teamsRes.ok) {
4844
return (await teamsRes.json())?.result as TeamMember[];
4945
}
50-
return [];
46+
47+
return undefined;
5148
}

apps/dashboard/src/app/(dashboard)/(chain)/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export async function getChain(
8686
).then((res) => res.json()) as Promise<{ data: ChainServices }>,
8787
]);
8888

89-
if (!chain.data) {
89+
if (!chain.data || !chainServices.data) {
9090
notFound();
9191
}
9292
return {

apps/dashboard/src/app/(dashboard)/layout.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import { AppFooter } from "@/components/blocks/app-footer";
22
import { ErrorProvider } from "../../contexts/error-handler";
3-
import { TryTeamsUIBanner } from "../components/DashboardTypeBanner";
43
import { DashboardHeader } from "../components/Header/DashboardHeader";
54

65
export default function DashboardLayout(props: { children: React.ReactNode }) {
76
return (
87
<ErrorProvider>
98
<div className="flex min-h-screen flex-col bg-background">
10-
<TryTeamsUIBanner />
119
<DashboardHeader />
1210
<main className="grow">{props.children}</main>
1311
<AppFooter />

apps/dashboard/src/app/account/layout.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { DashboardTypeCookieSetter } from "@/components/DashboardTypeCookieSette
44
import { SidebarLayout } from "@/components/blocks/SidebarLayout";
55
import { AppFooter } from "@/components/blocks/app-footer";
66
import type React from "react";
7-
import { TeamsUIBanner } from "../components/DashboardTypeBanner";
87
import { TWAutoConnect } from "../components/autoconnect";
98
import { AccountHeader } from "./components/AccountHeader";
109

@@ -13,7 +12,6 @@ export default async function AccountLayout(props: {
1312
}) {
1413
return (
1514
<div className="flex min-h-screen flex-col bg-background">
16-
<TeamsUIBanner />
1715
<div className="flex grow flex-col">
1816
<HeaderAndNav />
1917
<div className="border-border border-b py-10">

apps/dashboard/src/app/components/DashboardTypeBanner.tsx

Lines changed: 0 additions & 21 deletions
This file was deleted.

apps/dashboard/src/app/components/Header/DashboardHeader.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { NavLink } from "@/components/ui/NavLink";
2+
import { Badge } from "@/components/ui/badge";
23
import { Button } from "@/components/ui/button";
34
import { CustomConnectWallet } from "@3rdweb-sdk/react/components/connect-wallet";
45
import { CmdKSearch } from "components/cmd-k-search";
@@ -25,6 +26,19 @@ export const DashboardHeader: React.FC = () => {
2526

2627
{/* Right */}
2728
<div className="flex items-center gap-2">
29+
<NavLink
30+
href="/team"
31+
tracking={{
32+
category: "header",
33+
action: "click",
34+
label: "team-dashboard",
35+
}}
36+
className="hidden items-center gap-1.5 px-2.5 text-muted-foreground text-sm hover:text-foreground md:inline-flex"
37+
activeClassName="text-foreground"
38+
>
39+
Team Dashboard <Badge className="px-1.5"> BETA </Badge>
40+
</NavLink>
41+
2842
<div className="hidden gap-2 md:flex">
2943
<Suspense fallback={null}>
3044
<CreditsButton />

apps/dashboard/src/app/components/Header/SecondaryNav/SecondaryNav.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import { ToolTipLabel } from "@/components/ui/tooltip";
12
import type { Account } from "@3rdweb-sdk/react/hooks/useApi";
3+
import { ArrowUpDownIcon } from "lucide-react";
24
import Link from "next/link";
35
import type React from "react";
46
import { ResourcesDropdownButton } from "./ResourcesDropdownButton";
@@ -11,6 +13,23 @@ export function SecondaryNav(props: {
1113
}) {
1214
return (
1315
<div className="flex items-center gap-6">
16+
<ToolTipLabel
17+
label={
18+
<span>
19+
You are exploring the new dashboard. <br /> Click here to go back to
20+
the legacy dashboard.
21+
</span>
22+
}
23+
>
24+
<Link
25+
href="/dashboard"
26+
className="inline-flex items-center gap-1.5 text-muted-foreground text-sm hover:text-foreground"
27+
>
28+
<ArrowUpDownIcon className="size-4" />
29+
Switch To Legacy Dashboard
30+
</Link>
31+
</ToolTipLabel>
32+
1433
<ResourcesDropdownButton />
1534

1635
<Link

apps/dashboard/src/app/layout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import PlausibleProvider from "next-plausible";
77
import dynamic from "next/dynamic";
88
import { Inter } from "next/font/google";
99
import NextTopLoader from "nextjs-toploader";
10+
import { UnlimitedWalletsBanner } from "../components/notices/AnnouncementBanner";
1011
import { PostHogProvider } from "./components/root-providers";
1112
import { AppRouterProviders } from "./providers";
1213

@@ -70,6 +71,7 @@ export default function RootLayout({
7071
)}
7172
>
7273
<PostHogPageView />
74+
<UnlimitedWalletsBanner />
7375
<AppRouterProviders>{children}</AppRouterProviders>
7476
<Toaster richColors />
7577
<DashboardRouterTopProgressBar />

apps/dashboard/src/app/login/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { doLogin, doLogout, getLoginPayload, isLoggedIn } from "./auth-actions";
1515
export default function LoginPage() {
1616
return (
1717
<div className="relative grid h-screen place-items-center bg-muted/30">
18-
<nav className="fixed top-0 z-20 flex w-full flex-row items-center justify-between px-6 py-4">
18+
<nav className="absolute top-0 z-20 flex w-full flex-row items-center justify-between px-6 py-4">
1919
<ThirdwebMiniLogo className="max-h-7" />
2020
<ColorModeToggle />
2121
</nav>

0 commit comments

Comments
 (0)