akkoma-fe/src/components/notifications/notifications.vue

73 lines
2.2 KiB
Vue
Raw Normal View History

2016-11-27 18:44:56 +00:00
<template>
2022-04-07 11:37:16 +00:00
<teleport :disabled="minimalMode" :to="teleportTarget">
2022-04-05 16:22:15 +00:00
<div
:class="{ minimal: minimalMode }"
class="Notifications"
>
<div :class="mainClass">
2019-07-05 07:17:44 +00:00
<div
2022-04-05 16:22:15 +00:00
v-if="!noHeading"
class="notifications-heading panel-heading -sticky"
2019-07-05 07:17:44 +00:00
>
2022-04-05 16:22:15 +00:00
<div class="title">
{{ $t('notifications.notifications') }}
<span
v-if="unseenCount"
class="badge badge-notification unseen-count"
>{{ unseenCount }}</span>
</div>
<button
v-if="unseenCount"
class="button-default read-button"
@click.prevent="markAsSeen"
>
{{ $t('notifications.read') }}
</button>
<NotificationFilters />
2016-11-27 18:44:56 +00:00
</div>
2022-04-05 16:22:15 +00:00
<div class="panel-body">
<div
v-for="notification in notificationsToDisplay"
:key="notification.id"
class="notification"
:class="{&quot;unseen&quot;: !minimalMode && !notification.seen}"
>
<div class="notification-overlay" />
<notification :notification="notification" />
</div>
</div>
<div class="panel-footer">
2022-04-05 16:22:15 +00:00
<div
v-if="bottomedOut"
class="new-status-notification text-center faint"
>
{{ $t('notifications.no_more_notifications') }}
</div>
<button
v-else-if="!loading"
class="button-unstyled -link -fullwidth"
@click.prevent="fetchOlderNotifications()"
>
<div class="new-status-notification text-center">
{{ minimalMode ? $t('interactions.load_older') : $t('notifications.load_older') }}
</div>
</button>
<div
v-else
class="new-status-notification text-center"
>
<FAIcon
icon="circle-notch"
spin
size="lg"
/>
</div>
</div>
</div>
2016-11-27 18:44:56 +00:00
</div>
2022-04-05 16:22:15 +00:00
</teleport>
2016-11-27 18:44:56 +00:00
</template>
<script src="./notifications.js"></script>
<style lang="scss" src="./notifications.scss"></style>