Basic mention support.
I still have to think about how to integrate them in the state system...
This commit is contained in:
parent
8cd1c690ca
commit
6c2941dba0
8 changed files with 64 additions and 4 deletions
28
src/components/mentions/mentions.js
Normal file
28
src/components/mentions/mentions.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
import Status from '../status/status.vue'
|
||||
// Temporary
|
||||
import { prepareStatus, updateTimestampsInStatuses } from '../../modules/statuses.js'
|
||||
import { map } from 'lodash'
|
||||
|
||||
const Mentions = {
|
||||
data () {
|
||||
return {
|
||||
mentions: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
username () {
|
||||
return this.$route.params.username
|
||||
}
|
||||
},
|
||||
components: {
|
||||
Status
|
||||
},
|
||||
created () {
|
||||
this.$store.state.api.backendInteractor.fetchMentions({username: this.username})
|
||||
.then((mentions) => {
|
||||
this.mentions = updateTimestampsInStatuses(map(mentions, prepareStatus))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export default Mentions
|
12
src/components/mentions/mentions.vue
Normal file
12
src/components/mentions/mentions.vue
Normal file
|
@ -0,0 +1,12 @@
|
|||
<template>
|
||||
<div class="timeline panel panel-default">
|
||||
<div class="panel-heading">Mentions</div>
|
||||
<div class="panel-body">
|
||||
<div class="timeline">
|
||||
<status v-for="status in mentions" :key="status.id" v-bind:statusoid="status"></status>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script src="./mentions.js"></script>
|
Loading…
Add table
Add a link
Reference in a new issue