diff options
| author | marcin mikołajczak <git@mkljczk.pl> | 2024-01-04 22:46:04 +0100 |
|---|---|---|
| committer | marcin mikołajczak <git@mkljczk.pl> | 2024-01-04 22:47:41 +0100 |
| commit | 6c4c8fe51f0e2c4ce55f5915a2bc5434aef5e5e7 (patch) | |
| tree | f2d7ec37fa08d80cb40c842abdbaab94a4c16728 /src/components/quotes_timeline | |
| parent | bdf46eca5ae73b0f12b755774cd901854c814522 (diff) | |
Display quotes count on posts and add quotes list page
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Diffstat (limited to 'src/components/quotes_timeline')
| -rw-r--r-- | src/components/quotes_timeline/quotes_timeline.js | 26 | ||||
| -rw-r--r-- | src/components/quotes_timeline/quotes_timeline.vue | 10 |
2 files changed, 36 insertions, 0 deletions
diff --git a/src/components/quotes_timeline/quotes_timeline.js b/src/components/quotes_timeline/quotes_timeline.js new file mode 100644 index 00000000..a5f42da5 --- /dev/null +++ b/src/components/quotes_timeline/quotes_timeline.js @@ -0,0 +1,26 @@ +import Timeline from '../timeline/timeline.vue' + +const QuotesTimeline = { + created () { + this.$store.commit('clearTimeline', { timeline: 'quotes' }) + this.$store.dispatch('startFetchingTimeline', { timeline: 'quotes', statusId: this.statusId }) + }, + components: { + Timeline + }, + computed: { + statusId () { return this.$route.params.id }, + timeline () { return this.$store.state.statuses.timelines.quotes } + }, + watch: { + statusId () { + this.$store.commit('clearTimeline', { timeline: 'quotes' }) + this.$store.dispatch('startFetchingTimeline', { timeline: 'quotes', statusId: this.statusId }) + } + }, + unmounted () { + this.$store.dispatch('stopFetchingTimeline', 'quotes') + } +} + +export default QuotesTimeline diff --git a/src/components/quotes_timeline/quotes_timeline.vue b/src/components/quotes_timeline/quotes_timeline.vue new file mode 100644 index 00000000..835abd12 --- /dev/null +++ b/src/components/quotes_timeline/quotes_timeline.vue @@ -0,0 +1,10 @@ +<template> + <Timeline + :title="$t('nav.quotes')" + :timeline="timeline" + :timeline-name="'quotes'" + :status-id="statusId" + /> +</template> + +<script src='./quotes_timeline.js'></script> |
