From 6c2941dba04ca3454251c8ad04cafc40ff4900e8 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sat, 26 Nov 2016 21:09:41 +0100 Subject: Basic mention support. I still have to think about how to integrate them in the state system... --- src/components/mentions/mentions.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/components/mentions/mentions.js (limited to 'src/components/mentions/mentions.js') 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 -- cgit v1.2.3-70-g09d2