diff --git a/src/components/LayoutSidebar.tsx b/src/components/LayoutSidebar.tsx index 69149c9f4..9ca7c4cc4 100644 --- a/src/components/LayoutSidebar.tsx +++ b/src/components/LayoutSidebar.tsx @@ -129,9 +129,7 @@ export function LayoutSidebar({ user.serverAdmin || Boolean(currentOrg?.isOwner || currentOrg?.isAdmin); const showTrial = - build === "saas" && - Boolean(orgId) && - subscriptionContext?.isTrial; + build === "saas" && Boolean(orgId) && subscriptionContext?.isTrial; return (
- ) :
} + ) : ( +
+ )} {showTrial && (
- +
)} diff --git a/src/components/ShowTrialCard.tsx b/src/components/ShowTrialCard.tsx index e0d05d392..a8133de19 100644 --- a/src/components/ShowTrialCard.tsx +++ b/src/components/ShowTrialCard.tsx @@ -17,9 +17,11 @@ import { useTranslations } from "next-intl"; const TRIAL_DURATION_DAYS = 10; export default function ShowTrialCard({ - isCollapsed + isCollapsed, + isOwner = false }: { isCollapsed?: boolean; + isOwner?: boolean; }) { const context = useSubscriptionStatusContext(); const params = useParams(); @@ -47,16 +49,13 @@ export default function ShowTrialCard({ const billingHref = orgId ? `/${orgId}/settings/billing` : "/"; if (isCollapsed) { - return ( + const icon = ( - + - +

@@ -70,16 +69,16 @@ export default function ShowTrialCard({ ); + + if (isOwner) { + return {icon}; + } + + return icon; } - return ( - + const cardContent = ( + <>

@@ -93,11 +92,37 @@ export default function ShowTrialCard({ ? t("trialHasEnded") : t("trialDaysRemaining", { count: remainingDays })} -

- {t("trialGoToBilling")} - -
+ {isOwner && ( +
+ {t("trialGoToBilling")} + +
+ )}
- + + ); + + if (isOwner) { + return ( + + {cardContent} + + ); + } + + return ( +
+ {cardContent} +
); }