Browse Source

fix bugs

q-apps
Phillip 2 years ago
parent
commit
efcfe649ca
  1. 18
      qortal-ui-plugins/plugins/core/components/ChatPage.js
  2. 1
      qortal-ui-plugins/plugins/core/components/ChatScroller-css.js
  3. 14
      qortal-ui-plugins/plugins/core/components/ChatScroller.js
  4. 11
      qortal-ui-plugins/plugins/core/components/ChatTextEditor.js

18
qortal-ui-plugins/plugins/core/components/ChatPage.js

@ -162,6 +162,7 @@ class ChatPage extends LitElement {
align-items: center; align-items: center;
height: auto; height: auto;
padding: 5px 5px 5px 7px; padding: 5px 5px 5px 7px;
overflow: hidden;
} }
.chat-text-area .typing-area .emoji-button { .chat-text-area .typing-area .emoji-button {
@ -353,12 +354,20 @@ class ChatPage extends LitElement {
flex-direction: column; flex-direction: column;
gap: 5px; gap: 5px;
width: 100%; width: 100%;
word-break: break-all;
text-overflow: ellipsis;
overflow: hidden;
max-height: 60px;
} }
.repliedTo-message p { .repliedTo-message p {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
} }
.repliedTo-message pre {
white-space: pre-wrap;
}
.repliedTo-message p mark { .repliedTo-message p mark {
background-color: #ffe066; background-color: #ffe066;
border-radius: 0.25em; border-radius: 0.25em;
@ -937,12 +946,17 @@ class ChatPage extends LitElement {
<vaadin-icon class="reply-icon" icon="vaadin:reply" slot="icon"></vaadin-icon> <vaadin-icon class="reply-icon" icon="vaadin:reply" slot="icon"></vaadin-icon>
<div class="repliedTo-message"> <div class="repliedTo-message">
<p class="senderName">${this.repliedToMessageObj.senderName ? this.repliedToMessageObj.senderName : this.repliedToMessageObj.sender}</p> <p class="senderName">${this.repliedToMessageObj.senderName ? this.repliedToMessageObj.senderName : this.repliedToMessageObj.sender}</p>
${unsafeHTML(generateHTML(this.repliedToMessageObj.message, [ ${this.repliedToMessageObj.toString() === '1' ? html`
${this.repliedToMessageObj.message}
` : ''}
${this.repliedToMessageObj.toString() === '2' ? html`
${unsafeHTML(generateHTML(this.repliedToMessageObj.message, [
StarterKit, StarterKit,
Underline, Underline,
Highlight Highlight
// other extensions … // other extensions …
]))} ]))} ` : ''}
</div> </div>
<vaadin-icon <vaadin-icon
class="close-icon" class="close-icon"

1
qortal-ui-plugins/plugins/core/components/ChatScroller-css.js

@ -519,7 +519,6 @@ export const chatStyles = css`
} }
#messageContent > * + * { #messageContent > * + * {
margin-top: 0.75em;
outline: none; outline: none;
} }

14
qortal-ui-plugins/plugins/core/components/ChatScroller.js

@ -576,12 +576,20 @@ class MessageTemplate extends LitElement {
${repliedToData.senderName ?? cropAddress(repliedToData.sender)} ${repliedToData.senderName ?? cropAddress(repliedToData.sender)}
</p> </p>
<p class="replied-message"> <p class="replied-message">
${version.toString() === '1' ? html`
${repliedToData.decodedMessage.messageText}
` : ''}
${version.toString() === '2' ? html`
${unsafeHTML(generateHTML(repliedToData.decodedMessage.messageText, [ ${unsafeHTML(generateHTML(repliedToData.decodedMessage.messageText, [
StarterKit, StarterKit,
Underline, Underline,
Highlight Highlight
// other extensions … // other extensions …
]))} ]))}
` : ''}
<!-- ${repliedToData.decodedMessage.messageText} --> <!-- ${repliedToData.decodedMessage.messageText} -->
</p> </p>
</div> </div>
@ -617,8 +625,12 @@ class MessageTemplate extends LitElement {
id="messageContent" id="messageContent"
class="message" class="message"
style=${(image && replacedMessage !== "") &&"margin-top: 15px;"}> style=${(image && replacedMessage !== "") &&"margin-top: 15px;"}>
${version.toString() === '2' ? html`
${unsafeHTML(messageVersion2)} ${unsafeHTML(messageVersion2)}
` : ''}
${version.toString() === '1' ? html`
${unsafeHTML(this.emojiPicker.parse(replacedMessage))}
` : ''}
<div class="${((this.isFirstMessage === false && <div class="${((this.isFirstMessage === false &&
this.isSingleMessageInGroup === true && this.isSingleMessageInGroup === true &&
this.isLastMessageInGroup === true) || this.isLastMessageInGroup === true) ||

11
qortal-ui-plugins/plugins/core/components/ChatTextEditor.js

@ -46,12 +46,14 @@ class ChatTextEditor extends LitElement {
align-items: center; align-items: center;
height: auto; height: auto;
width: 100%; width: 100%;
overflow: hidden;
} }
.chatbar-container { .chatbar-container {
width: 100%; width: 100%;
display: flex; display: flex;
height: auto; height: auto;
overflow: hidden;
} }
.chatbar-caption { .chatbar-caption {
@ -265,6 +267,11 @@ class ChatTextEditor extends LitElement {
} }
.chatbar-buttons {
margin-bottom: 5px;
flex-shrink: 0;
}
.show-chatbar-buttons { .show-chatbar-buttons {
display: flex; display: flex;
align-items: center; align-items: center;
@ -293,6 +300,8 @@ class ChatTextEditor extends LitElement {
.ProseMirror { .ProseMirror {
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
word-break: break-all;
display: flex;
} }
.ProseMirror mark { .ProseMirror mark {
@ -322,7 +331,7 @@ class ChatTextEditor extends LitElement {
font-family: 'Material Symbols Outlined'; font-family: 'Material Symbols Outlined';
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
font-size: 24px; /* Preferred icon size */ font-size: 18px; /* Preferred icon size */
display: inline-block; display: inline-block;
line-height: 1; line-height: 1;
text-transform: none; text-transform: none;

Loading…
Cancel
Save