mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
old client structure
This commit is contained in:
51
website/client/src/components/snackbars/notifications.vue
Normal file
51
website/client/src/components/snackbars/notifications.vue
Normal file
@@ -0,0 +1,51 @@
|
||||
<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 {
|
||||
&-normal {
|
||||
top: 65px;
|
||||
}
|
||||
|
||||
&-sleeping {
|
||||
top: 105px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'client/libs/store';
|
||||
import notification from './notification';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
notification,
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
notificationStore: 'notificationStore',
|
||||
userSleeping: 'user.data.preferences.sleep',
|
||||
}),
|
||||
notificationsTopPos () {
|
||||
const base = 'notifications-top-pos-';
|
||||
let modifier = '';
|
||||
if (this.userSleeping) {
|
||||
modifier = 'sleeping';
|
||||
} else {
|
||||
modifier = 'normal';
|
||||
}
|
||||
return `${base}${modifier}`;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user