From 1af204e0f0065f4959bdaf45e22434ef0f894d25 Mon Sep 17 00:00:00 2001 From: Jaanus Sellin Date: Fri, 15 Nov 2024 09:26:49 +0200 Subject: [PATCH] feat: now pay as you go billing banner has link (#8761) My intuition wanted to click on it to start paying, but it did not work. Changed condition to show it for pay as you go. ![image](https://github.com/user-attachments/assets/d14ad947-ce4a-48cb-8bbd-c1d6dfb84a0a) --- .../component/common/InstanceStatus/InstanceStatusBar.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/component/common/InstanceStatus/InstanceStatusBar.tsx b/frontend/src/component/common/InstanceStatus/InstanceStatusBar.tsx index 5a58297086ad..27c950139dac 100644 --- a/frontend/src/component/common/InstanceStatus/InstanceStatusBar.tsx +++ b/frontend/src/component/common/InstanceStatus/InstanceStatusBar.tsx @@ -13,6 +13,7 @@ import { isTrialInstance, } from 'utils/instanceTrial'; import { formatDistanceToNowStrict, parseISO } from 'date-fns'; +import useUiConfig from '../../../hooks/api/getters/useUiConfig/useUiConfig'; const StyledWarningBar = styled('aside')(({ theme }) => ({ position: 'relative', @@ -132,13 +133,17 @@ const StatusBarExpiresLater = ({ instanceStatus }: IInstanceStatusBarProps) => { const BillingLink = ({ instanceStatus }: IInstanceStatusBarProps) => { const { hasAccess } = useContext(AccessContext); + const { uiConfig } = useUiConfig(); const navigate = useNavigate(); if (!hasAccess(ADMIN)) { return null; } - if (instanceStatus.plan === InstancePlan.ENTERPRISE) { + if ( + instanceStatus.plan === InstancePlan.ENTERPRISE && + uiConfig.billing !== 'pay-as-you-go' + ) { return null; }