Skip to content

Commit 9dd0b17

Browse files
authored
Remove Chain Infrastructure section from team sidebar (#8275)
1 parent 12082fd commit 9dd0b17

File tree

3 files changed

+16
-71
lines changed

3 files changed

+16
-71
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const CHAIN_PLAN_TO_INFRA = {
8282
],
8383
};
8484

85-
export async function getChainSubscriptions(slug: string) {
85+
async function getChainSubscriptions(slug: string) {
8686
const allSubscriptions = await getTeamSubscriptions(slug);
8787
if (!allSubscriptions) {
8888
return null;

apps/dashboard/src/app/(app)/team/[team_slug]/(team)/TeamSidebarLayout.tsx

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,13 @@ import {
1010
HelpCircleIcon,
1111
HomeIcon,
1212
SettingsIcon,
13-
WalletCardsIcon,
1413
} from "lucide-react";
1514
import { FullWidthSidebarLayout } from "@/components/blocks/full-width-sidebar-layout";
1615

1716
export function TeamSidebarLayout(props: {
1817
layoutPath: string;
1918
children: React.ReactNode;
2019
ecosystems: Array<{ name: string; slug: string }>;
21-
chainSubscriptions: Array<{
22-
chainId: number;
23-
chainName: string;
24-
slug: string;
25-
}>;
2620
}) {
2721
const { layoutPath, children } = props;
2822

@@ -72,24 +66,6 @@ export function TeamSidebarLayout(props: {
7266
{
7367
separator: true,
7468
} as const,
75-
// infrastructure below here
76-
// TODO: make this one link to an overview page that has a list of all the chains currently deployed
77-
{
78-
links: [
79-
...props.chainSubscriptions.map((chainSubscription) => ({
80-
href: `${layoutPath}/~/infrastructure/${chainSubscription.slug}`,
81-
label: chainSubscription.chainName,
82-
})),
83-
{
84-
href: `${layoutPath}/~/infrastructure/deploy`,
85-
label: "Deploy Infrastructure",
86-
},
87-
],
88-
subMenu: {
89-
icon: WalletCardsIcon,
90-
label: "Chain Infrastucture",
91-
},
92-
},
9369
]}
9470
footerSidebarLinks={[
9571
{

apps/dashboard/src/app/(app)/team/[team_slug]/(team)/layout.tsx

Lines changed: 15 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ import { getAuthToken, getAuthTokenWalletAddress } from "@/api/auth-token";
44
import { getProjects } from "@/api/project/projects";
55
import { fetchEcosystemList } from "@/api/team/ecosystems";
66
import { getTeamBySlug, getTeams } from "@/api/team/get-team";
7-
import { getChainSubscriptions } from "@/api/team/team-subscription";
87
import { CustomChatButton } from "@/components/chat/CustomChatButton";
98
import { AnnouncementBanner } from "@/components/misc/AnnouncementBanner";
109
import { SidebarProvider } from "@/components/ui/sidebar";
1110
import { siwaExamplePrompts } from "@/constants/siwa-example-prompts";
1211
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
13-
import { getChain } from "../../../(dashboard)/(chain)/utils";
1412
import { TeamHeaderLoggedIn } from "../../components/TeamHeader/team-header-logged-in.client";
1513
import { StaffModeNotice } from "./_components/StaffModeNotice";
1614
import { TeamSidebarLayout } from "./TeamSidebarLayout";
@@ -21,52 +19,26 @@ export default async function TeamLayout(props: {
2119
}) {
2220
const params = await props.params;
2321

24-
const [
25-
accountAddress,
26-
account,
27-
teams,
28-
authToken,
29-
team,
30-
ecosystems,
31-
chainSubscriptions,
32-
] = await Promise.all([
33-
getAuthTokenWalletAddress(),
34-
getValidAccount(`/team/${params.team_slug}`),
35-
getTeams(),
36-
getAuthToken(),
37-
getTeamBySlug(params.team_slug),
38-
fetchEcosystemList(params.team_slug),
39-
getChainSubscriptions(params.team_slug),
40-
]);
22+
const [accountAddress, account, teams, authToken, team, ecosystems] =
23+
await Promise.all([
24+
getAuthTokenWalletAddress(),
25+
getValidAccount(`/team/${params.team_slug}`),
26+
getTeams(),
27+
getAuthToken(),
28+
getTeamBySlug(params.team_slug),
29+
fetchEcosystemList(params.team_slug),
30+
]);
4131

4232
if (!teams || !accountAddress || !authToken || !team) {
4333
redirect("/login");
4434
}
4535

46-
const [teamsAndProjects, chainSidebarLinks] = await Promise.all([
47-
Promise.all(
48-
teams.map(async (team) => ({
49-
projects: await getProjects(team.slug),
50-
team,
51-
})),
52-
),
53-
chainSubscriptions
54-
? await Promise.all(
55-
chainSubscriptions.map(async (chainSubscription) => {
56-
if (!chainSubscription.chainId) {
57-
throw new Error("Chain ID is required");
58-
}
59-
const chain = await getChain(chainSubscription.chainId);
60-
61-
return {
62-
chainId: chain.chainId,
63-
chainName: chain.name,
64-
slug: chain.slug,
65-
};
66-
}),
67-
).catch(() => [])
68-
: [],
69-
]);
36+
const teamsAndProjects = await Promise.all(
37+
teams.map(async (team) => ({
38+
projects: await getProjects(team.slug),
39+
team,
40+
})),
41+
);
7042

7143
const client = getClientThirdwebClient({
7244
jwt: authToken,
@@ -92,9 +64,6 @@ export default async function TeamLayout(props: {
9264
</div>
9365

9466
<TeamSidebarLayout
95-
chainSubscriptions={chainSidebarLinks.sort(
96-
(a, b) => a.chainId - b.chainId,
97-
)}
9867
ecosystems={ecosystems.map((ecosystem) => ({
9968
name: ecosystem.name,
10069
slug: ecosystem.slug,

0 commit comments

Comments
 (0)