|
28 | 28 | </div> |
29 | 29 | </div> |
30 | 30 | <div |
31 | | - v-show="showCommentBox" |
32 | | - @keydown.ctrl.enter.capture.stop="submitComment" |
33 | | - @keydown.meta.enter.capture.stop="submitComment" |
| 31 | + v-show="showEmailBox" |
| 32 | + class="flex gap-1.5 flex-1" |
| 33 | + @keydown.ctrl.enter.capture.stop="submitEmail" |
| 34 | + @keydown.meta.enter.capture.stop="submitEmail" |
34 | 35 | > |
35 | | - <CommentTextEditor |
36 | | - ref="commentTextEditorRef" |
37 | | - :label="isMac ? 'Comment (⌘ + ⏎)' : 'Comment (Ctrl + ⏎)'" |
| 36 | + <EmailEditor |
| 37 | + ref="emailEditorRef" |
| 38 | + :label=" |
| 39 | + isMobileView ? 'Send' : isMac ? 'Send (⌘ + ⏎)' : 'Send (Ctrl + ⏎)' |
| 40 | + " |
38 | 41 | v-model="doc" |
39 | | - :editable="showCommentBox" |
40 | | - :doctype="doctype" |
41 | | - placeholder="@John could you please look into this?" |
| 42 | + v-model:content="content" |
| 43 | + placeholder="Hi John, we are looking into this issue." |
| 44 | + :to-emails="toEmails" |
| 45 | + :cc-emails="ccEmails" |
| 46 | + :bcc-emails="bccEmails" |
42 | 47 | @submit=" |
43 | 48 | () => { |
44 | | - showCommentBox = false; |
| 49 | + showEmailBox = false; |
45 | 50 | emit('update'); |
46 | 51 | } |
47 | 52 | " |
48 | 53 | @discard=" |
49 | 54 | () => { |
50 | | - showCommentBox = false; |
| 55 | + showEmailBox = false; |
51 | 56 | } |
52 | 57 | " |
53 | 58 | /> |
54 | 59 | </div> |
55 | 60 | <div |
56 | | - v-show="showEmailBox" |
57 | | - class="flex gap-1.5" |
58 | | - @keydown.ctrl.enter.capture.stop="submitEmail" |
59 | | - @keydown.meta.enter.capture.stop="submitEmail" |
| 61 | + v-show="showCommentBox" |
| 62 | + @keydown.ctrl.enter.capture.stop="submitComment" |
| 63 | + @keydown.meta.enter.capture.stop="submitComment" |
60 | 64 | > |
61 | | - <EmailEditor |
62 | | - ref="emailEditorRef" |
63 | | - :label="isMac ? 'Send (⌘ + ⏎)' : 'Send (Ctrl + ⏎)'" |
| 65 | + <CommentTextEditor |
| 66 | + ref="commentTextEditorRef" |
| 67 | + :label=" |
| 68 | + isMobileView |
| 69 | + ? 'Comment' |
| 70 | + : isMac |
| 71 | + ? 'Comment (⌘ + ⏎)' |
| 72 | + : 'Comment (Ctrl + ⏎)' |
| 73 | + " |
64 | 74 | v-model="doc" |
65 | | - v-model:content="content" |
66 | | - placeholder="Hi John, we are looking into this issue." |
67 | | - :to-emails="toEmails" |
68 | | - :cc-emails="ccEmails" |
69 | | - :bcc-emails="bccEmails" |
| 75 | + :editable="showCommentBox" |
| 76 | + :doctype="doctype" |
| 77 | + placeholder="@John could you please look into this?" |
70 | 78 | @submit=" |
71 | 79 | () => { |
72 | | - showEmailBox = false; |
| 80 | + showCommentBox = false; |
73 | 81 | emit('update'); |
74 | 82 | } |
75 | 83 | " |
76 | 84 | @discard=" |
77 | 85 | () => { |
78 | | - showEmailBox = false; |
| 86 | + showCommentBox = false; |
79 | 87 | } |
80 | 88 | " |
81 | 89 | /> |
|
87 | 95 | import { CommentTextEditor, EmailEditor } from "@/components"; |
88 | 96 | import { CommentIcon, EmailIcon } from "@/components/icons/"; |
89 | 97 | import { useDevice } from "@/composables"; |
| 98 | +import { useScreenSize } from "@/composables/screen"; |
90 | 99 | import { showCommentBox, showEmailBox } from "@/pages/ticket/modalStates"; |
91 | 100 | import { ref, watch } from "vue"; |
92 | 101 |
|
93 | 102 | const emit = defineEmits(["update"]); |
94 | 103 | const content = defineModel("content"); |
95 | 104 | const doc = defineModel(); |
96 | 105 | const { isMac } = useDevice(); |
| 106 | +const { isMobileView } = useScreenSize(); |
97 | 107 |
|
98 | 108 | const emailEditorRef = ref(null); |
99 | 109 | const commentTextEditorRef = ref(null); |
@@ -185,4 +195,7 @@ defineExpose({ |
185 | 195 | width: 100vw; |
186 | 196 | } |
187 | 197 | } |
| 198 | +.comm-area { |
| 199 | + width: 100%; |
| 200 | +} |
188 | 201 | </style> |
0 commit comments