File tree Expand file tree Collapse file tree 4 files changed +53
-3
lines changed
nuxt/components/discussions Expand file tree Collapse file tree 4 files changed +53
-3
lines changed Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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'
9599import DeleteCommentModal from ' ./DeleteCommentModal.vue'
96100import DiscussionImage from ' @/components/discussions/DiscussionImage'
97101import ReplyBar from ' @/components/discussions/ReplyBar'
102+ import AddMemeModal from ' @/components/discussions/AddMemeModal'
98103
99104export 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: {
You can’t perform that action at this time.
0 commit comments