From 0d33cbbbbb4711f3c47d2aa67d39035bcd60ac27 Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Thu, 16 Aug 2018 04:57:09 +0900 Subject: [PATCH] Make reactions in reactions-viewer clickable --- .../views/components/reactions-viewer.vue | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/src/client/app/common/views/components/reactions-viewer.vue b/src/client/app/common/views/components/reactions-viewer.vue index 23f4b59d6..c30fa2a1d 100644 --- a/src/client/app/common/views/components/reactions-viewer.vue +++ b/src/client/app/common/views/components/reactions-viewer.vue @@ -1,16 +1,16 @@ @@ -22,6 +22,17 @@ export default Vue.extend({ computed: { reactions(): number { return this.note.reactionCounts; + }, + notReacted(): boolean { + return this.note.myReaction == null; + } + }, + methods: { + react(reaction: string) { + (this as any).api('notes/reactions/create', { + noteId: this.note.id, + reaction: reaction + }); } } }); @@ -40,6 +51,9 @@ root(isDark) > span margin-right 8px + &.notReacted + cursor pointer + > .mk-reaction-icon font-size 1.4em