diff options
| author | Roger Braun <roger@rogerbraun.net> | 2016-11-26 21:09:41 +0100 |
|---|---|---|
| committer | Roger Braun <roger@rogerbraun.net> | 2016-11-26 21:09:41 +0100 |
| commit | 6c2941dba04ca3454251c8ad04cafc40ff4900e8 (patch) | |
| tree | 714e2655e1005526ac5b23dc437f908c99c8a289 /src/components/mentions | |
| parent | 8cd1c690cae1b3c0cce15401e794fa8011816454 (diff) | |
Basic mention support.
I still have to think about how to integrate them in the state system...
Diffstat (limited to 'src/components/mentions')
| -rw-r--r-- | src/components/mentions/mentions.js | 28 | ||||
| -rw-r--r-- | src/components/mentions/mentions.vue | 12 |
2 files changed, 40 insertions, 0 deletions
diff --git a/src/components/mentions/mentions.js b/src/components/mentions/mentions.js new file mode 100644 index 00000000..3563101b --- /dev/null +++ b/src/components/mentions/mentions.js @@ -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 diff --git a/src/components/mentions/mentions.vue b/src/components/mentions/mentions.vue new file mode 100644 index 00000000..a760719c --- /dev/null +++ b/src/components/mentions/mentions.vue @@ -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> |
