Skip to content

Commit 5eacf52

Browse files
Merge pull request #264 from lightningnetworkstores/feature/meme-bank
Feature/meme bank
2 parents c0ed8f3 + 9d1305f commit 5eacf52

File tree

4 files changed

+53
-3
lines changed

4 files changed

+53
-3
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<template>
2+
<v-dialog v-model="showDialog" max-width="500">
3+
<template v-slot:activator="{ on, attrs }">
4+
<v-btn @click="deleteCommentRequested" icon :attrs="attrs" v-on="on">
5+
<v-icon small color="primary">mdi-image-album</v-icon>
6+
</v-btn>
7+
</template>
8+
<v-card>
9+
<v-card-title>Confirm</v-card-title>
10+
<v-card-text>Please confirm this meme selection</v-card-text>
11+
<v-card-actions>
12+
<v-spacer></v-spacer>
13+
<v-btn color="secondary" @click="showDialog = false">Cancel</v-btn>
14+
<v-btn color="primary" @click="postMeme">Confirm</v-btn>
15+
</v-card-actions>
16+
</v-card>
17+
</v-dialog>
18+
</template>
19+
<script>
20+
export default {
21+
props: {
22+
commentId: {
23+
type: String,
24+
required: true
25+
}
26+
},
27+
data() {
28+
return {
29+
showDialog: false
30+
}
31+
},
32+
methods: {
33+
postMeme() {
34+
const payload = { commentId: this.commentId }
35+
this.$axios.$post('/api/meme', payload)
36+
.then(data => {
37+
console.log('post meme response: ', data)
38+
})
39+
.catch(err => console.error(err))
40+
.finally(() => this.showDialog = false)
41+
}
42+
}
43+
}
44+
</script>

nuxt/components/discussions/ChangeTopicModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<v-dialog v-model="showDialog" max-width="500">
33
<template v-slot:activator="{ attrs, on }">
44
<v-btn v-on="on" :attrs="attrs" icon color="secondary">
5-
<v-icon>mdi-tooltip-edit</v-icon>
5+
<v-icon small>mdi-tooltip-edit</v-icon>
66
</v-btn>
77
</template>
88
<v-card>

nuxt/components/discussions/DeleteCommentModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<v-dialog v-model="showDialog" max-width="500">
33
<template v-slot:activator="{ on, attrs }">
44
<v-btn @click="deleteCommentRequested" icon :attrs="attrs" v-on="on">
5-
<v-icon color="red">mdi-delete</v-icon>
5+
<v-icon small color="red">mdi-delete</v-icon>
66
</v-btn>
77
</template>
88
<v-card>

nuxt/components/discussions/DiscussionThreads.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@
6161
:threadIndex="threadIndex"
6262
:commentId="reply.id"
6363
/>
64+
<AddMemeModal
65+
v-if="isAdmin && reply.link"
66+
:commentId="reply.id"
67+
/>
6468
</div>
6569
<v-divider v-if="replyIndex < repliesCount(threadIndex) - 1"/>
6670
</v-sheet>
@@ -95,6 +99,7 @@ import DiscussionHeader from './DiscussionHeader.vue'
9599
import DeleteCommentModal from './DeleteCommentModal.vue'
96100
import DiscussionImage from '@/components/discussions/DiscussionImage'
97101
import ReplyBar from '@/components/discussions/ReplyBar'
102+
import AddMemeModal from '@/components/discussions/AddMemeModal'
98103
99104
export default {
100105
components: {
@@ -104,7 +109,8 @@ export default {
104109
DiscussionHeader,
105110
DeleteCommentModal,
106111
DiscussionImage,
107-
ReplyBar
112+
ReplyBar,
113+
AddMemeModal
108114
},
109115
props: {
110116
threads: {

0 commit comments

Comments
 (0)