mirror of
https://github.com/fosrl/pangolin.git
synced 2026-01-29 06:10:47 +00:00
♻️some refactor
This commit is contained in:
@@ -39,18 +39,15 @@ import {
|
||||
resourceWhitelistProxy,
|
||||
resourceAccessProxy
|
||||
} from "@app/actions/server";
|
||||
import { createApiClient } from "@app/lib/api";
|
||||
import { useEnvContext } from "@app/hooks/useEnvContext";
|
||||
import { toast } from "@app/hooks/useToast";
|
||||
import Link from "next/link";
|
||||
import Image from "next/image";
|
||||
import BrandingLogo from "@app/components/BrandingLogo";
|
||||
import { useSupporterStatusContext } from "@app/hooks/useSupporterStatusContext";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { build } from "@server/build";
|
||||
import { useLicenseStatusContext } from "@app/hooks/useLicenseStatusContext";
|
||||
import { useSubscriptionStatusContext } from "@app/hooks/useSubscriptionStatusContext";
|
||||
import { usePaidStatus } from "@app/hooks/usePaidStatus";
|
||||
import type { GetLoginPageBrandingResponse } from "@server/routers/loginPage/types";
|
||||
|
||||
const pinSchema = z.object({
|
||||
pin: z
|
||||
@@ -90,15 +87,7 @@ type ResourceAuthPortalProps = {
|
||||
redirect: string;
|
||||
idps?: LoginFormIDP[];
|
||||
orgId?: string;
|
||||
branding?: {
|
||||
title: string;
|
||||
logoUrl: string;
|
||||
logoWidth: number;
|
||||
logoHeight: number;
|
||||
subtitle: string | null;
|
||||
resourceTitle: string;
|
||||
resourceSubtitle: string | null;
|
||||
} | null;
|
||||
branding?: Omit<GetLoginPageBrandingResponse, "loginPageBrandingId"> | null;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,12 +7,13 @@ export function usePaidStatus() {
|
||||
const subscription = useSubscriptionStatusContext();
|
||||
|
||||
// Check if features are disabled due to licensing/subscription
|
||||
const isEnterpriseLicensed = build === "enterprise" && isUnlocked();
|
||||
const isSaasSubscribed = build === "saas" && subscription?.isSubscribed();
|
||||
const hasEnterpriseLicense = build === "enterprise" && isUnlocked();
|
||||
const hasSaasSubscription =
|
||||
build === "saas" && subscription?.isSubscribed();
|
||||
|
||||
return {
|
||||
isEnterpriseLicensed,
|
||||
isSaasSubscribed,
|
||||
isPaidUser: isEnterpriseLicensed || isSaasSubscribed
|
||||
hasEnterpriseLicense,
|
||||
hasSaasSubscription,
|
||||
isPaidUser: hasEnterpriseLicense || hasSaasSubscription
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user