From bc9b958dafb0263b0af2e50e1852017db15d2872 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Thu, 7 Aug 2025 00:05:18 +0530 Subject: [PATCH] [WEB-4551] fix: disabled workspace layout (#3854) * fix: disabled workspace layout * chore: code refactor --- .../components/license/workspace-disabled.tsx | 69 +++++++------------ 1 file changed, 24 insertions(+), 45 deletions(-) diff --git a/apps/web/ee/components/license/workspace-disabled.tsx b/apps/web/ee/components/license/workspace-disabled.tsx index 93c349b933..706fe778e9 100644 --- a/apps/web/ee/components/license/workspace-disabled.tsx +++ b/apps/web/ee/components/license/workspace-disabled.tsx @@ -1,24 +1,17 @@ "use client"; import { useState } from "react"; -import { AppSidebar } from "app/(all)/[workspaceSlug]/(projects)/sidebar"; +import { ProjectAppSidebar } from "app/(all)/[workspaceSlug]/(projects)/_sidebar"; import { observer } from "mobx-react"; -import Image from "next/image"; import { useParams } from "next/navigation"; -import { useTheme } from "next-themes"; -import { CircleAlert } from "lucide-react"; // hooks import { EUserPermissionsLevel } from "@plane/constants"; import { EUserWorkspaceRoles } from "@plane/types"; -import { AlertModalCore, Button } from "@plane/ui"; -import { useUserPermissions } from "@/hooks/store"; +import { AlertModalCore, Button, PlaneLockup } from "@plane/ui"; +import { useUserPermissions, useWorkspace } from "@/hooks/store"; import { useAppRouter } from "@/hooks/use-app-router"; // plane web components import { PaidPlanUpgradeModal } from "@/plane-web/components/license"; -// plane web constants -// assets -import PlaneBackgroundPatternDark from "@/public/auth/background-pattern-dark.svg"; -import PlaneBackgroundPattern from "@/public/auth/background-pattern.svg"; export const WorkspaceDisabledPage: React.FC = observer(() => { // router @@ -28,10 +21,11 @@ export const WorkspaceDisabledPage: React.FC = observer(() => { const [isPaidPlanModalOpen, togglePaidPlanModal] = useState(false); const [isDowngradeModalOpen, toggleDowngradeModal] = useState(false); // hooks - const { resolvedTheme } = useTheme(); const { allowPermissions } = useUserPermissions(); + const { getWorkspaceBySlug } = useWorkspace(); // derived values const workspaceSlug = routerWorkspaceSlug?.toString(); + const workspace = getWorkspaceBySlug(workspaceSlug); const isWorkspaceAdmin = allowPermissions( [EUserWorkspaceRoles.ADMIN], EUserPermissionsLevel.WORKSPACE, @@ -60,41 +54,26 @@ export const WorkspaceDisabledPage: React.FC = observer(() => { /> togglePaidPlanModal(false)} />
- -
-
- Plane background pattern -
-
-
-
- -
-
-

- {isWorkspaceAdmin ? "We couldn't collect your last invoiced payment." : "A payment is overdue."} -

-

- {isWorkspaceAdmin - ? "You have a payment due for your Pro workspace. Please clear it to continue using Pro features or downgrade to Free." - : "Your have a payment due for your Pro workspace. Get in touch with one of your admins to fix this."} -

-
- {isWorkspaceAdmin && ( -
- - -
- )} + +
+
+ +
+ Your payment needs attention +

+ {`Your payment for ${workspace?.name} couldn't be processed. Update your payment method to keep all your Business features.`} +

+ {isWorkspaceAdmin && ( +
+ + +
+ )}