From ba10f2164168d7fcc459b7f0396a8d4ec86b2269 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Mon, 4 Mar 2024 17:08:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=BB=9A=E5=8A=A8;=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/msgUtils.js | 5 +- .../Conversations/Components/Input/Emoji.jsx | 2 +- .../Components/InputComposer.jsx | 10 ++- .../Conversations/Components/Messages.jsx | 66 ++++++++++++------- .../Components/MessagesHeader.jsx | 4 +- src/views/Conversations/Conversations.css | 12 ++++ 6 files changed, 69 insertions(+), 30 deletions(-) diff --git a/src/lib/msgUtils.js b/src/lib/msgUtils.js index fae2c67..de9f751 100644 --- a/src/lib/msgUtils.js +++ b/src/lib/msgUtils.js @@ -375,6 +375,7 @@ export const whatsappError = { * 系统弹窗通知 */ export const handleNotification = (title, _options) => { + var notification; const options = { requireInteraction: true, // 设置手动关闭 tag: 'global-sales-notification', // 通知ID,同类通知建议设置相同ID,避免通知过多遮挡桌面 @@ -384,11 +385,11 @@ export const handleNotification = (title, _options) => { // 检查用户是否同意接受通知 if (Notification.permission === 'granted') { - var notification = new Notification(title, options); + notification = new Notification(title, options); } else if (Notification.permission !== 'denied') { Notification.requestPermission().then(function (permission) { if (permission === 'granted') { - var notification = new Notification(title, options); + notification = new Notification(title, options); } }); } else { diff --git a/src/views/Conversations/Components/Input/Emoji.jsx b/src/views/Conversations/Components/Input/Emoji.jsx index 76bd564..734bba8 100644 --- a/src/views/Conversations/Components/Input/Emoji.jsx +++ b/src/views/Conversations/Components/Input/Emoji.jsx @@ -16,7 +16,7 @@ const InputTemplate = ({ disabled = false, inputEmoji }) => { placement={'right'} overlayInnerStyle={{ padding: 0, borderRadius: '8px' }} // fresh - content={} + content={} // title='😀' trigger='click' open={openPopup} diff --git a/src/views/Conversations/Components/InputComposer.jsx b/src/views/Conversations/Components/InputComposer.jsx index 40c3a2d..08d853b 100644 --- a/src/views/Conversations/Components/InputComposer.jsx +++ b/src/views/Conversations/Components/InputComposer.jsx @@ -67,7 +67,13 @@ const InputComposer = () => { }; const focusInput = () => { - textInputRef.current.focus({ cursor: 'end' }); + textInputRef.current.focus({ cursor: 'end', preventScroll: true, }); + }; + + const addEmoji = emoji => { + setTextContent(prevValue => { + return prevValue + emoji; + }); }; const handleSendText = () => { @@ -129,7 +135,7 @@ const InputComposer = () => { - setTextContent(`${textContent}${s}`)} /> + {/* */} {/*