2020-01-29 20:37:25 +01:00
|
|
|
<template>
|
2021-04-13 20:23:29 +02:00
|
|
|
<div class="yrzkoczt" v-sticky-container>
|
2021-10-16 11:18:41 +02:00
|
|
|
<MkTab v-model="with_" class="tab">
|
2020-12-26 02:47:36 +01:00
|
|
|
<option :value="null">{{ $ts.notes }}</option>
|
|
|
|
<option value="replies">{{ $ts.notesAndReplies }}</option>
|
|
|
|
<option value="files">{{ $ts.withFiles }}</option>
|
2020-11-28 16:18:54 +01:00
|
|
|
</MkTab>
|
2021-04-16 17:12:50 +02:00
|
|
|
<XNotes ref="timeline" :no-gap="true" :pagination="pagination" @before="$emit('before')" @after="e => $emit('after', e)"/>
|
2020-01-29 20:37:25 +01:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-10-17 13:12:00 +02:00
|
|
|
import { defineComponent } from 'vue';
|
2021-03-23 09:30:14 +01:00
|
|
|
import XNotes from '@client/components/notes.vue';
|
|
|
|
import MkTab from '@client/components/tab.vue';
|
|
|
|
import * as os from '@client/os';
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2020-10-17 13:12:00 +02:00
|
|
|
export default defineComponent({
|
2020-01-29 20:37:25 +01:00
|
|
|
components: {
|
2020-11-28 16:18:54 +01:00
|
|
|
XNotes,
|
|
|
|
MkTab,
|
2020-01-29 20:37:25 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
props: {
|
|
|
|
user: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
watch: {
|
|
|
|
user() {
|
|
|
|
this.$refs.timeline.reload();
|
|
|
|
},
|
|
|
|
|
|
|
|
with_() {
|
|
|
|
this.$refs.timeline.reload();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
date: null,
|
|
|
|
with_: null,
|
|
|
|
pagination: {
|
|
|
|
endpoint: 'users/notes',
|
|
|
|
limit: 10,
|
|
|
|
params: init => ({
|
|
|
|
userId: this.user.id,
|
|
|
|
includeReplies: this.with_ === 'replies',
|
|
|
|
withFiles: this.with_ === 'files',
|
|
|
|
untilDate: init ? undefined : (this.date ? this.date.getTime() : undefined),
|
|
|
|
})
|
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|
2021-04-13 20:23:29 +02:00
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.yrzkoczt {
|
|
|
|
> .tab {
|
2021-10-16 11:18:41 +02:00
|
|
|
margin: calc(var(--margin) / 2) 0;
|
|
|
|
padding: calc(var(--margin) / 2) 0;
|
2021-04-13 20:23:29 +02:00
|
|
|
background: var(--bg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|