2020-01-29 19:37:25 +00:00
|
|
|
<template>
|
2020-08-09 06:51:02 +00:00
|
|
|
<div class="kjeftjfm" v-size="{ max: [500] }">
|
2020-01-29 19:37:25 +00:00
|
|
|
<div class="with">
|
2020-07-24 16:56:52 +00:00
|
|
|
<button class="_button" @click="with_ = null" :class="{ active: with_ === null }">{{ $t('notes') }}</button>
|
|
|
|
<button class="_button" @click="with_ = 'replies'" :class="{ active: with_ === 'replies' }">{{ $t('notesAndReplies') }}</button>
|
|
|
|
<button class="_button" @click="with_ = 'files'" :class="{ active: with_ === 'files' }">{{ $t('withFiles') }}</button>
|
2020-01-29 19:37:25 +00:00
|
|
|
</div>
|
2020-10-17 11:12:00 +00:00
|
|
|
<XNotes ref="timeline" :pagination="pagination" @before="$emit('before')" @after="e => $emit('after', e)"/>
|
2020-01-29 19:37:25 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-10-17 11:12:00 +00:00
|
|
|
import { defineComponent } from 'vue';
|
|
|
|
import XNotes from '@/components/notes.vue';
|
|
|
|
import * as os from '@/os';
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2020-10-17 11:12:00 +00:00
|
|
|
export default defineComponent({
|
2020-01-29 19:37:25 +00:00
|
|
|
components: {
|
|
|
|
XNotes
|
|
|
|
},
|
|
|
|
|
|
|
|
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>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.kjeftjfm {
|
|
|
|
> .with {
|
|
|
|
display: flex;
|
|
|
|
margin-bottom: var(--margin);
|
|
|
|
|
|
|
|
> button {
|
|
|
|
flex: 1;
|
|
|
|
padding: 11px 8px 8px 8px;
|
|
|
|
border-bottom: solid 3px transparent;
|
|
|
|
|
|
|
|
&.active {
|
|
|
|
color: var(--accent);
|
|
|
|
border-bottom-color: var(--accent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-07-11 01:13:11 +00:00
|
|
|
|
|
|
|
&.max-width_500px {
|
|
|
|
> .with {
|
|
|
|
font-size: 80%;
|
|
|
|
}
|
|
|
|
}
|
2020-01-29 19:37:25 +00:00
|
|
|
}
|
|
|
|
</style>
|