aboutsummaryrefslogtreecommitdiff
path: root/src/components/quotes_timeline
diff options
context:
space:
mode:
authormarcin mikołajczak <git@mkljczk.pl>2024-01-04 22:46:04 +0100
committermarcin mikołajczak <git@mkljczk.pl>2024-01-04 22:47:41 +0100
commit6c4c8fe51f0e2c4ce55f5915a2bc5434aef5e5e7 (patch)
treef2d7ec37fa08d80cb40c842abdbaab94a4c16728 /src/components/quotes_timeline
parentbdf46eca5ae73b0f12b755774cd901854c814522 (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.js26
-rw-r--r--src/components/quotes_timeline/quotes_timeline.vue10
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>