fix: hide "upgrade org banner" for isPlatform (#14522)

* not great but does the job

* comments

---------

Co-authored-by: Alex van Andel <me@alexvanandel.com>
This commit is contained in:
Peer RichelsenandAlex van Andel authored and GitHub committed 2024-04-16 02:41:07 +01:00
1 parent 39aa848e9e
commit 4c50b6a8af
1 file changed
+6
@@ -1,5 +1,6 @@
import { useRouter } from "next/navigation";
import { useIsPlatform } from "@calcom/atoms/monorepo";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import type { RouterOutputs } from "@calcom/trpc/react";
import { trpc } from "@calcom/trpc/react";
@@ -12,6 +13,8 @@ export type OrgUpgradeBannerProps = {
export function OrgUpgradeBanner({ data }: OrgUpgradeBannerProps) {
const { t } = useLocale();
const router = useRouter();
const isPlatform = useIsPlatform();
const publishOrgMutation = trpc.viewer.organizations.publish.useMutation({
onSuccess(data) {
router.push(data.url);
@@ -25,6 +28,9 @@ export function OrgUpgradeBanner({ data }: OrgUpgradeBannerProps) {
const [membership] = data;
if (!membership) return null;
// TODO: later figure out how to not show this banner on platform since platform is different to orgs (it just uses the same code)
if (isPlatform) return null;
return (
<TopBanner
text={t("org_upgrade_banner_description", { teamName: membership.team.name })}