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

102 lines
2.9 KiB
Vue
Raw Normal View History

2016-11-27 19:44:56 +01:00
<template>
2022-07-31 11:35:48 +02:00
<teleport
:disabled="minimalMode || disableTeleport"
:to="teleportTarget"
>
<component
:is="noHeading ? 'div' : 'aside'"
2022-08-24 21:46:41 +02:00
ref="root"
2022-04-05 18:22:15 +02:00
:class="{ minimal: minimalMode }"
class="Notifications"
>
<div :class="mainClass">
2019-07-05 09:17:44 +02:00
<div
2022-04-05 18:22:15 +02:00
v-if="!noHeading"
class="notifications-heading panel-heading -sticky"
2019-07-05 09:17:44 +02:00
>
2022-04-05 18:22:15 +02:00
<div class="title">
{{ $t('notifications.notifications') }}
<span
v-if="unseenCount"
class="badge badge-notification unseen-count"
>{{ unseenCount }}</span>
</div>
2022-09-28 20:34:53 +02:00
<div
v-if="showScrollTop"
2022-11-21 21:17:33 +01:00
class="rightside-button"
>
2022-09-28 20:34:53 +02:00
<button
class="button-unstyled scroll-to-top-button"
type="button"
2022-10-17 20:50:37 +02:00
:title="$t('general.scroll_to_top')"
2022-09-28 20:34:53 +02:00
@click="scrollToTop"
>
<FALayers class="fa-scale-110 fa-old-padding-layer">
<FAIcon icon="arrow-up" />
<FAIcon
icon="minus"
transform="up-7"
/>
</FALayers>
</button>
</div>
2022-04-05 18:22:15 +02:00
<button
v-if="unseenCount"
class="button-default read-button"
type="button"
2022-04-05 18:22:15 +02:00
@click.prevent="markAsSeen"
>
2022-08-17 20:34:56 +02:00
{{ $t('notifications.read') }}
2022-04-05 18:22:15 +02:00
</button>
<NotificationFilters class="rightside-button" />
2016-11-27 19:44:56 +01:00
</div>
<div
class="panel-body"
2022-11-08 16:34:38 +01:00
role="feed"
>
2022-04-05 18:22:15 +02:00
<div
v-for="notification in notificationsToDisplay"
:key="notification.id"
role="listitem"
2022-04-05 18:22:15 +02:00
class="notification"
2022-05-22 20:50:30 +02:00
:class="{unseen: !minimalMode && !notification.seen}"
2022-04-05 18:22:15 +02:00
>
<div class="notification-overlay" />
<notification :notification="notification" />
</div>
</div>
<div class="panel-footer">
2022-04-05 18:22:15 +02: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>
</component>
2022-04-05 18:22:15 +02:00
</teleport>
2016-11-27 19:44:56 +01:00
</template>
<script src="./notifications.js"></script>
<style lang="scss" src="./notifications.scss"></style>