1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

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)
This commit is contained in:
Jaanus Sellin 2024-11-15 09:26:49 +02:00 committed by GitHub
parent c9b674f7ab
commit 1af204e0f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
}