diff --git a/apps/web/components/team/screens/Team.tsx b/apps/web/components/team/screens/Team.tsx index 0633bae939..4da45f819b 100644 --- a/apps/web/components/team/screens/Team.tsx +++ b/apps/web/components/team/screens/Team.tsx @@ -1,12 +1,12 @@ import Link from "next/link"; -import type { TeamPageProps } from "pages/team/[slug]"; import { WEBAPP_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { md } from "@calcom/lib/markdownIt"; +import type { TeamWithMembers } from "@calcom/lib/server/queries/teams"; import { Avatar } from "@calcom/ui"; -type TeamType = TeamPageProps["team"]; +type TeamType = NonNullable; type MembersType = TeamType["members"]; type MemberType = MembersType[number]; @@ -57,7 +57,7 @@ const Members = ({ members, teamName }: { members: MembersType; teamName: string ); }; -const Team = ({ team }: Omit) => { +const Team = ({ team }: { team: TeamType }) => { return (
diff --git a/apps/web/pages/team/[slug].tsx b/apps/web/pages/team/[slug].tsx index 057f996b26..0a9741b179 100644 --- a/apps/web/pages/team/[slug].tsx +++ b/apps/web/pages/team/[slug].tsx @@ -13,7 +13,8 @@ import useTheme from "@calcom/lib/hooks/useTheme"; import { md } from "@calcom/lib/markdownIt"; import { getTeamWithMembers } from "@calcom/lib/server/queries/teams"; import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@calcom/lib/telemetry"; -import { Avatar, Button, HeadSeo, AvatarGroup } from "@calcom/ui"; +import prisma from "@calcom/prisma"; +import { Avatar, AvatarGroup, Button, EmptyScreen, HeadSeo } from "@calcom/ui"; import { FiArrowRight } from "@calcom/ui/components/icon"; import { useToggleQuery } from "@lib/hooks/useToggleQuery"; @@ -24,13 +25,15 @@ import Team from "@components/team/screens/Team"; import { ssrInit } from "@server/lib/ssr"; export type TeamPageProps = inferSSRProps; -function TeamPage({ team }: TeamPageProps) { +function TeamPage({ team, isUnpublished }: TeamPageProps) { useTheme(team.theme); const showMembers = useToggleQuery("members"); const { t } = useLocale(); const isEmbed = useIsEmbed(); const telemetry = useTelemetry(); const router = useRouter(); + const teamName = team.name || "Nameless Team"; + const isBioEmpty = !team.bio || !team.bio.replace("


", "").length; useEffect(() => { telemetry.event( @@ -39,6 +42,18 @@ function TeamPage({ team }: TeamPageProps) { ); }, [telemetry, router.asPath]); + if (isUnpublished) { + return ( +
+ } + headline={t("team_is_unpublished", { team: teamName })} + description={t("team_is_unpublished_description")} + /> +
+ ); + } + const EventTypes = () => (
    {team.eventTypes.map((type, index) => ( @@ -78,12 +93,8 @@ function TeamPage({ team }: TeamPageProps) {
); - const teamName = team.name || "Nameless Team"; - - const isBioEmpty = !team.bio || !team.bio.replace("


", "").length; - return ( -
+ <>
-