mirror of
https://github.com/beestat/app.git
synced 2025-07-09 03:04:07 -04:00
Allow hiding the contribute banner if you are a supporter or have given.
This commit is contained in:
parent
a8dd057c2f
commit
789c3437b4
@ -85,7 +85,9 @@ beestat.setting = function(argument_1, opt_value, opt_callback) {
|
|||||||
|
|
||||||
'date_format': 'M/D/YYYY',
|
'date_format': 'M/D/YYYY',
|
||||||
|
|
||||||
'units.currency': 'usd'
|
'units.currency': 'usd',
|
||||||
|
|
||||||
|
'hide_contribute_banner': false
|
||||||
};
|
};
|
||||||
|
|
||||||
// Figure out what we're trying to do.
|
// Figure out what we're trying to do.
|
||||||
|
@ -44,6 +44,23 @@ beestat.component.card.contribute_banner.prototype.decorate_contents_ = function
|
|||||||
});
|
});
|
||||||
tile_group.add_tile(watch_tile);
|
tile_group.add_tile(watch_tile);
|
||||||
|
|
||||||
|
// Allow dismiss if you are a supporter or if you have given via Stripe.
|
||||||
|
if (
|
||||||
|
beestat.user.contribution_is_active() === true ||
|
||||||
|
Object.keys(beestat.cache.stripe_event).length > 0
|
||||||
|
) {
|
||||||
|
const dismiss_tile = new beestat.component.tile()
|
||||||
|
.set_icon('close')
|
||||||
|
.set_shadow(false)
|
||||||
|
.set_text_color(beestat.style.color.purple.dark)
|
||||||
|
.set_text_hover_color(beestat.style.color.purple.light);
|
||||||
|
dismiss_tile.addEventListener('click', function() {
|
||||||
|
beestat.setting('hide_contribute_banner', true);
|
||||||
|
beestat.current_layer.render();
|
||||||
|
});
|
||||||
|
tile_group.add_tile(dismiss_tile);
|
||||||
|
}
|
||||||
|
|
||||||
tile_group.render($(center));
|
tile_group.render($(center));
|
||||||
|
|
||||||
container.appendChild(center);
|
container.appendChild(center);
|
||||||
|
@ -204,7 +204,9 @@ beestat.component.header.prototype.decorate_ = function(parent) {
|
|||||||
.send();
|
.send();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
if (beestat.setting('hide_contribute_banner') === false) {
|
||||||
const contribute_banner = new beestat.component.card.contribute_banner();
|
const contribute_banner = new beestat.component.card.contribute_banner();
|
||||||
contribute_banner.style({'margin-bottom': `${beestat.style.size.gutter}px`});
|
contribute_banner.style({'margin-bottom': `${beestat.style.size.gutter}px`});
|
||||||
contribute_banner.render(parent);
|
contribute_banner.render(parent);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user