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

91 lines
2.5 KiB
Vue
Raw Normal View History

2016-10-26 17:03:55 +00:00
<template>
2020-10-28 06:53:23 +00:00
<div :class="[classes.root, 'Timeline']">
<div :class="classes.header">
<TimelineMenu v-if="!embedded" />
2019-07-05 07:17:44 +00:00
<button
2020-11-10 10:52:54 +00:00
v-if="showLoadButton"
class="button-default loadmore-button"
2019-07-05 07:17:44 +00:00
@click.prevent="showNewStatuses"
>
{{ loadButtonString }}
</button>
2019-07-05 07:17:44 +00:00
<div
2020-06-30 14:02:38 +00:00
v-else
2019-07-05 07:17:44 +00:00
class="loadmore-text faint"
@click.prevent
>
{{ $t('timeline.up_to_date') }}
</div>
<TimelineQuickSettings v-if="!embedded" />
</div>
<div :class="classes.body">
2020-09-29 10:18:37 +00:00
<div
ref="timeline"
class="timeline"
>
<template v-for="statusId in pinnedStatusIds">
<conversation
v-if="timeline.statusesObject[statusId]"
2019-07-20 02:46:11 +00:00
:key="statusId + '-pinned'"
class="status-fadein"
2019-09-03 17:19:14 +00:00
:status-id="statusId"
:collapsable="true"
2019-08-15 17:16:55 +00:00
:pinned-status-ids-object="pinnedStatusIdsObject"
2019-09-13 20:55:17 +00:00
:in-profile="inProfile"
:profile-user-id="userId"
/>
</template>
2019-07-20 20:54:30 +00:00
<template v-for="status in timeline.visibleStatuses">
<conversation
v-if="!excludedStatusIdsObject[status.id]"
:key="status.id"
class="status-fadein"
2019-09-03 17:19:14 +00:00
:status-id="status.id"
2019-07-20 20:54:30 +00:00
:collapsable="true"
2019-09-13 20:55:17 +00:00
:in-profile="inProfile"
:profile-user-id="userId"
2020-09-29 10:18:37 +00:00
:virtual-hidden="virtualScrollingEnabled && !statusesToDisplay.includes(status.id)"
2019-07-20 20:54:30 +00:00
/>
</template>
2016-11-06 16:44:05 +00:00
</div>
</div>
<div :class="classes.footer">
2019-07-05 07:17:44 +00:00
<div
v-if="count===0"
class="new-status-notification text-center faint"
2019-07-05 07:17:44 +00:00
>
{{ $t('timeline.no_statuses') }}
</div>
2019-07-05 07:17:44 +00:00
<div
v-else-if="bottomedOut"
class="new-status-notification text-center faint"
2019-07-05 07:17:44 +00:00
>
{{ $t('timeline.no_more_statuses') }}
</div>
<button
2020-11-10 10:52:54 +00:00
v-else-if="!timeline.loading"
2020-11-24 12:52:01 +00:00
class="button-unstyled -link -fullwidth"
2019-07-05 07:17:44 +00:00
@click.prevent="fetchOlderStatuses()"
>
<div class="new-status-notification text-center">
2020-11-24 14:10:03 +00:00
{{ $t('timeline.load_older') }}
</div>
</button>
2019-07-05 07:17:44 +00:00
<div
v-else
class="new-status-notification text-center"
2019-07-05 07:17:44 +00:00
>
2020-10-20 21:31:16 +00:00
<FAIcon
icon="circle-notch"
spin
size="lg"
/>
</div>
</div>
2016-10-26 17:03:55 +00:00
</div>
</template>
2016-10-26 17:03:55 +00:00
<script src="./timeline.js"></script>
<style src="./timeline.scss" lang="scss"> </style>