Files
habitica/website/client/components/snackbars/notifications.vue
Sabe Jones 8220199e49 Gift 1 Get 1 Promo 2018-19! (#10915)
* feat(subscription): promo banner in modal

* feat(subscription): promo banner on main page

* fix(banners): remove extraneous margin adjustment

* fix(banners): various

* feat(promotion): gift 1, get 1

* fix(promo): various

* chore(promo): add Bailey

* fix(promo): use different email template for promo beneficiary

* fix(promo): turns out Winter is meaningful
2018-12-18 15:28:53 -06:00

64 lines
1.4 KiB
Vue

<template lang="pug">
.notifications(:class="notificationsTopPos")
div(v-for='notification in notificationStore', :key='notification.uuid')
notification(:notification='notification')
</template>
<style lang="scss" scoped>
.notifications {
position: fixed;
right: 10px;
width: 350px;
z-index: 1400; // 1400 is above modal backgrounds
&-top-pos {
&-double {
top: 145px;
}
&-normal {
top: 65px;
}
&-sleeping {
top: 105px;
}
}
}
</style>
<script>
import { mapState } from 'client/libs/store';
import notification from './notification';
import { CONSTANTS, getLocalSetting } from 'client/libs/userlocalManager';
export default {
components: {
notification,
},
computed: {
...mapState({
notificationStore: 'notificationStore',
userSleeping: 'user.data.preferences.sleep',
}),
notificationsTopPos () {
const base = 'notifications-top-pos-';
let modifier = '';
if (this.userSleeping && this.giftingShown) {
modifier = 'double';
} else if (this.userSleeping || this.giftingShown) {
modifier = 'sleeping';
} else {
modifier = 'normal';
}
return `${base}${modifier}`;
},
},
data () {
return {
giftingShown: getLocalSetting(CONSTANTS.keyConstants.GIFTING_BANNER_DISPLAY) !== 'dismissed',
};
},
};
</script>