mirror of
https://github.com/beestat/app.git
synced 2025-07-09 03:04:07 -04:00
Removed Stripe "Manage Support" button unless you have at least one stripe_event
This commit is contained in:
parent
19010d6925
commit
a8dd057c2f
@ -61,9 +61,6 @@ beestat.component.card.contribute_status.prototype.decorate_direct_ = function(p
|
|||||||
const status_tile = new beestat.component.tile()
|
const status_tile = new beestat.component.tile()
|
||||||
.set_shadow(false);
|
.set_shadow(false);
|
||||||
|
|
||||||
const button_container = document.createElement('div');
|
|
||||||
container.appendChild(button_container);
|
|
||||||
|
|
||||||
if (beestat.user.stripe_is_active() === true) {
|
if (beestat.user.stripe_is_active() === true) {
|
||||||
status_tile
|
status_tile
|
||||||
.set_icon('check')
|
.set_icon('check')
|
||||||
@ -77,20 +74,26 @@ beestat.component.card.contribute_status.prototype.decorate_direct_ = function(p
|
|||||||
}
|
}
|
||||||
status_tile.render($(status_container));
|
status_tile.render($(status_container));
|
||||||
|
|
||||||
const manage_tile = new beestat.component.tile()
|
// If you have at least one Stripe event, show the Manage Support button.
|
||||||
.set_text('Manage Support')
|
if (Object.keys(beestat.cache.stripe_event).length > 0) {
|
||||||
.set_icon('credit_card_settings')
|
const button_container = document.createElement('div');
|
||||||
.set_background_color(beestat.style.color.red.base)
|
container.appendChild(button_container);
|
||||||
.set_background_hover_color(beestat.style.color.red.light)
|
|
||||||
.set_text_color('#fff')
|
const manage_tile = new beestat.component.tile()
|
||||||
.addEventListener('click', function() {
|
.set_text('Manage Support')
|
||||||
window.open(
|
.set_icon('credit_card_settings')
|
||||||
window.environment === 'dev'
|
.set_background_color(beestat.style.color.red.base)
|
||||||
? 'https://billing.stripe.com/p/login/test_14k8zD2vwb8g6ZO8ww'
|
.set_background_hover_color(beestat.style.color.red.light)
|
||||||
: 'https://billing.stripe.com/p/login/7sI5kEetRfHP6g8fYY'
|
.set_text_color('#fff')
|
||||||
);
|
.addEventListener('click', function() {
|
||||||
});
|
window.open(
|
||||||
manage_tile.render($(button_container));
|
window.environment === 'dev'
|
||||||
|
? 'https://billing.stripe.com/p/login/test_14k8zD2vwb8g6ZO8ww'
|
||||||
|
: 'https://billing.stripe.com/p/login/7sI5kEetRfHP6g8fYY'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
manage_tile.render($(button_container));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user