add trial banners and unblock member invite modal during trial

This commit is contained in:
Gregor Vostrak
2024-09-04 15:24:31 +02:00
committed by Constantin Graf
parent 2bad9eaa3c
commit 30ed47d3fb
5 changed files with 166 additions and 23 deletions

View File

@@ -8,6 +8,29 @@ export function isBillingActivated() {
return page.props.has_billing_extension;
}
export function isInTrial() {
const page = usePage<{
billing: {
has_trial: boolean;
};
}>();
return page.props.billing.has_trial;
}
export function isBlocked() {
const page = usePage<{
billing: {
is_blocked: boolean;
};
}>();
return page.props.billing.is_blocked;
}
export function isFreePlan() {
return !hasActiveSubscription() && !isInTrial();
}
export function hasActiveSubscription() {
const page = usePage<{
billing: {