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

71 lines
2.0 KiB
Vue
Raw Normal View History

2016-11-27 19:44:56 +01:00
<template>
2019-07-05 09:17:44 +02:00
<div
:class="{ minimal: minimalMode }"
class="Notifications"
2019-07-05 09:17:44 +02:00
>
<div :class="mainClass">
2019-07-05 09:17:44 +02:00
<div
v-if="!noHeading"
class="notifications-heading panel-heading -sticky"
2019-07-05 09:17:44 +02:00
>
2018-08-28 15:14:32 +02:00
<div class="title">
2019-07-05 09:17:44 +02:00
{{ $t('notifications.notifications') }}
<span
v-if="unseenCount"
class="badge badge-notification unseen-count"
>{{ unseenCount }}</span>
2018-08-28 15:14:32 +02:00
</div>
2019-07-05 09:17:44 +02:00
<button
v-if="unseenCount"
class="button-default read-button"
2019-07-05 09:17:44 +02:00
@click.prevent="markAsSeen"
>
{{ $t('notifications.read') }}
</button>
2021-03-01 15:21:35 +01:00
<NotificationFilters />
</div>
<div class="panel-body">
2019-07-05 09:17:44 +02:00
<div
2020-01-14 14:28:57 +01:00
v-for="notification in notificationsToDisplay"
2019-07-05 09:17:44 +02:00
:key="notification.id"
class="notification"
:class="{&quot;unseen&quot;: !minimalMode && !notification.seen}"
>
<div class="notification-overlay" />
<notification :notification="notification" />
2016-11-27 19:44:56 +01:00
</div>
</div>
<div class="panel-footer notifications-footer">
2019-07-05 09:17:44 +02:00
<div
v-if="bottomedOut"
class="new-status-notification text-center faint"
2019-07-05 09:17:44 +02:00
>
{{ $t('notifications.no_more_notifications') }}
</div>
<button
2019-07-05 09:17:44 +02:00
v-else-if="!loading"
2020-11-26 17:25:21 +01:00
class="button-unstyled -link -fullwidth"
2019-07-05 09:17:44 +02:00
@click.prevent="fetchOlderNotifications()"
>
<div class="new-status-notification text-center">
2019-07-05 09:17:44 +02:00
{{ minimalMode ? $t('interactions.load_older') : $t('notifications.load_older') }}
</div>
</button>
2019-07-05 09:17:44 +02:00
<div
v-else
class="new-status-notification text-center"
2019-07-05 09:17:44 +02:00
>
2020-10-20 23:31:16 +02:00
<FAIcon
icon="circle-notch"
spin
size="lg"
/>
</div>
</div>
2016-11-27 19:44:56 +01:00
</div>
</div>
</template>
<script src="./notifications.js"></script>
<style lang="scss" src="./notifications.scss"></style>