mirror of
https://github.com/makeplane/plane.git
synced 2026-07-13 05:49:40 +02:00
Merge branch 'preview' of github.com:makeplane/plane-ee into develop
This commit is contained in:
@@ -23,7 +23,7 @@ export const WorkspaceActiveCycleHeader = observer(() => (
|
||||
}
|
||||
/>
|
||||
</Breadcrumbs>
|
||||
<UpgradeBadge size="md" />
|
||||
<UpgradeBadge size="md" flag="WORKSPACE_ACTIVE_CYCLES" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -126,7 +126,7 @@ export const SidebarWorkspaceMenu = observer(() => {
|
||||
</div>
|
||||
{!sidebarCollapsed && link.key === "active-cycles" && (
|
||||
<div className="flex-shrink-0">
|
||||
<UpgradeBadge />
|
||||
<UpgradeBadge flag="WORKSPACE_ACTIVE_CYCLES" />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -4,20 +4,24 @@ import { observer } from "mobx-react";
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
// store
|
||||
import { useWorkspaceSubscription } from "@/plane-web/hooks/store";
|
||||
// plane web hooks
|
||||
import { E_FEATURE_FLAGS, useFlag } from "@/plane-web/hooks/store/use-flag";
|
||||
|
||||
type TUpgradeBadge = {
|
||||
className?: string;
|
||||
size?: "sm" | "md";
|
||||
flag?: keyof typeof E_FEATURE_FLAGS;
|
||||
};
|
||||
|
||||
export const UpgradeBadge: FC<TUpgradeBadge> = observer((props) => {
|
||||
const { className, size = "sm" } = props;
|
||||
const { className, size = "sm", flag } = props;
|
||||
// store hooks
|
||||
const { currentWorkspaceSubscribedPlanDetail } = useWorkspaceSubscription();
|
||||
// derived values
|
||||
const isFeatureEnabled = flag ? useFlag(flag) : false;
|
||||
const isSubscribedToPro = currentWorkspaceSubscribedPlanDetail?.product === "PRO";
|
||||
|
||||
if (!currentWorkspaceSubscribedPlanDetail || isSubscribedToPro) {
|
||||
if (!currentWorkspaceSubscribedPlanDetail || isFeatureEnabled || isSubscribedToPro) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user