yandere_fe/src/components/notifications/notifications.vue

113 lines
3.3 KiB
Vue
Raw Normal View History

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