diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/layout.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/layout.tsx index 4780484b081..d30dcdd5391 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/layout.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/layout.tsx @@ -1,9 +1,11 @@ import { getProjects } from "@/api/projects"; -import { getTeams } from "@/api/team"; +import { getTeamBySlug, getTeams } from "@/api/team"; import { AppFooter } from "@/components/blocks/app-footer"; +import { Button } from "@/components/ui/button"; import { TabPathLinks } from "@/components/ui/tabs"; import { getClientThirdwebClient } from "@/constants/thirdweb-client.client"; import { AnnouncementBanner } from "components/notices/AnnouncementBanner"; +import Link from "next/link"; import { redirect } from "next/navigation"; import { siwaExamplePrompts } from "../../../(dashboard)/support/page"; import { CustomChatButton } from "../../../../nebula-app/(app)/components/CustomChat/CustomChatButton"; @@ -20,25 +22,18 @@ export default async function TeamLayout(props: { }) { const params = await props.params; - const [accountAddress, account, teams, authToken] = await Promise.all([ + const [accountAddress, account, teams, authToken, team] = await Promise.all([ getAuthTokenWalletAddress(), getValidAccount(`/team/${params.team_slug}`), getTeams(), getAuthToken(), + getTeamBySlug(params.team_slug), ]); - if (!teams || !accountAddress || !authToken) { + if (!teams || !accountAddress || !authToken || !team) { redirect("/login"); } - const team = teams.find( - (t) => t.slug === decodeURIComponent(params.team_slug), - ); - - if (!team) { - redirect("/team"); - } - const teamsAndProjects = await Promise.all( teams.map(async (team) => ({ team, @@ -53,6 +48,21 @@ export default async function TeamLayout(props: { return (
👀 STAFF MODE 👀
++ You can only view this team, not take any actions. +
+👀 STAFF MODE 👀
++ You can only view this team, not take any actions. +
+