Skip to content

Commit

Permalink
feat: now pay as you go billing banner has link (#8761)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
sjaanus authored Nov 15, 2024
1 parent c9b674f commit 1af204e
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 1af204e

Please sign in to comment.