+
this.closeFunc()}
+ icon="vaadin:close-small"
+ slot="icon"
+ class="close-icon"
+ >
+
${this.loading ? (
html`
@@ -25,19 +34,30 @@ export class ChatSearchResults extends LitElement {
`
) : (
html`
- ${this.searchResults.map((result) => {
- return (
+
+
+
+ ${this.searchResults.length === 0 ? (
+ html`
${translate("chatpage.cchange37")}
`
+ ) : (
html`
-
{
- this.onClickFunc();
- }}>
-
- ${result}
-
-
- `
- )}
- )}
+ ${this.searchResults.map((result) => {
+ return (
+ html`
+
{
+ this.shadowRoot.querySelector(".chat-result-card").classList.add("active");
+ this.onClickFunc(result);
+ }}>
+
+ ${result}
+
+
+ `
+ )}
+ )}
+ `
+ )}
+
`
)}
diff --git a/qortal-ui-plugins/plugins/core/components/ChatSearchResults-css.js b/qortal-ui-plugins/plugins/core/components/ChatSearchResults-css.js
index 53b0fe14..4cff99f5 100644
--- a/qortal-ui-plugins/plugins/core/components/ChatSearchResults-css.js
+++ b/qortal-ui-plugins/plugins/core/components/ChatSearchResults-css.js
@@ -2,7 +2,8 @@ import { css } from 'lit'
export const chatSearchResultsStyles = css`
.chat-results-card {
- padding: 10px 20px;
+ position: relative;
+ padding: 25px 20px;
box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
width: 300px;
min-height: 200px;
@@ -11,28 +12,90 @@ export const chatSearchResultsStyles = css`
background-color: var(--white);
}
+ .chat-result-header {
+ color: var(--chat-bubble-msg-color);
+ font-size: 18px;
+ font-family: Montserrat, sans-serif;
+ text-align: center;
+ margin: 0 0 10px 0;
+ user-select: none;
+ }
+
+ .divider {
+ height: 1px;
+ background: var(--chat-bubble-msg-color);
+ margin: 0 40px;
+ user-select: none;
+ }
+
+ .no-results {
+ font-family: Roboto, sans-serif;
+ font-weight: 300;
+ letter-spacing: 0.3px;
+ font-size: 16px;
+ color: var(--chat-bubble-msg-color);
+ text-align: center;
+ margin: 20px 0 0 0;
+ user-select: none;
+ }
+
.chat-result-container {
- padding: 5px;
- margin-bottom: 5px;
- transition: box-shadow 0.1s ease-in-out;
+ height: 200px;
+ overflow-y: auto;
+ padding: 0 10px;
+ }
+
+ .chat-result-container::-webkit-scrollbar-track {
+ background-color: whitesmoke;
+ border-radius: 7px;
+ }
+
+ .chat-result-container::-webkit-scrollbar {
+ width: 6px;
+ border-radius: 7px;
+ background-color: whitesmoke;
+ }
+
+ .chat-result-container::-webkit-scrollbar-thumb {
+ background-color: rgb(180, 176, 176);
+ border-radius: 7px;
+ transition: all 0.3s ease-in-out;
+ }
+
+ .chat-result-container::-webkit-scrollbar-thumb:hover {
+ background-color: rgb(148, 146, 146);
+ cursor: pointer;
+ }
+
+ .chat-result-card {
+ padding: 12px;
+ margin-bottom: 15px;
+ margin-top: 15px;
+ transition: all 0.2s ease-in-out;
box-shadow: none;
}
- .chat-result-container:hover {
+ .chat-result-card:active {
+ background-color: #09b814;
+ }
+
+ .chat-result-card:hover {
cursor: pointer;
border: none;
border-radius: 4px;
box-sizing: border-box;
- -webkit-box-shadow: 0px 0px 6px -1px rgba(0, 0, 0, 0.397);
- box-shadow: 0px 0px 6px -1px rgba(0, 0, 0, 0.397);
+ -webkit-box-shadow: rgba(132, 132, 132, 40%) 0px 0px 6px -1px;
+ box-shadow: rgba(132, 132, 132, 40%) 0px 0px 6px -1px;
}
.chat-result {
font-family: Roboto, sans-serif;
font-weight: 300;
letter-spacing: 0.3px;
- font-size: 14px;
+ font-size: 15px;
color: var(--chat-bubble-msg-color);
+ margin: 0;
+ user-select: none;
}
.spinner-container {
@@ -40,4 +103,18 @@ export const chatSearchResultsStyles = css`
width: 100%;
justify-content: center
}
+
+ .close-icon {
+ position: absolute;
+ top: 5px;
+ right: 5px;
+ color: var(--chat-bubble-msg-color);
+ font-size: 14px;
+ transition: all 0.1s ease-in-out;
+ }
+
+ .close-icon:hover {
+ cursor: pointer;
+ font-size: 15px;
+ }
`
\ No newline at end of file
diff --git a/qortal-ui-plugins/plugins/core/components/WrapperModal.js b/qortal-ui-plugins/plugins/core/components/WrapperModal.js
index 96b22142..416e8a60 100644
--- a/qortal-ui-plugins/plugins/core/components/WrapperModal.js
+++ b/qortal-ui-plugins/plugins/core/components/WrapperModal.js
@@ -6,7 +6,6 @@ export class WrapperModal extends LitElement {
static get properties() {
return {
onClickFunc: { attribute: false },
- closePrivateMessage: { attribute: false },
}
}
diff --git a/qortal-ui-plugins/plugins/core/messaging/q-chat/q-chat-css.src.js b/qortal-ui-plugins/plugins/core/messaging/q-chat/q-chat-css.src.js
index 40820d11..bab60e1d 100644
--- a/qortal-ui-plugins/plugins/core/messaging/q-chat/q-chat-css.src.js
+++ b/qortal-ui-plugins/plugins/core/messaging/q-chat/q-chat-css.src.js
@@ -341,7 +341,7 @@ export const qchatStyles = css`
background: none;
border-radius: 50%;
padding: 6px 3px;
- font-size: 19px;
+ font-size: 21px;
}
.search-icon:hover {
@@ -354,4 +354,15 @@ export const qchatStyles = css`
top: 25px;
right: 25px;
}
+
+ .user-verified {
+ position: absolute;
+ top: 0;
+ right: 5px;
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ color: #04aa2e;
+ font-size: 13px;
+ }
`
\ No newline at end of file
diff --git a/qortal-ui-plugins/plugins/core/messaging/q-chat/q-chat.src.js b/qortal-ui-plugins/plugins/core/messaging/q-chat/q-chat.src.js
index b54bc166..30f58e94 100644
--- a/qortal-ui-plugins/plugins/core/messaging/q-chat/q-chat.src.js
+++ b/qortal-ui-plugins/plugins/core/messaging/q-chat/q-chat.src.js
@@ -44,7 +44,9 @@ class Chat extends LitElement {
imageFile: { type: Object },
activeChatHeadUrl: {type: String},
openPrivateMessage: { type: Boolean },
- userFound: { type: Array}
+ userFound: { type: Array},
+ userFoundModalOpen: { type: Boolean },
+ userSelected: { type: String}
}
}
@@ -81,6 +83,8 @@ class Chat extends LitElement {
this.activeChatHeadUrl = ''
this.openPrivateMessage = false
this.userFound = []
+ this.userFoundModalOpen = false
+ this.userSelected = ''
}
async setActiveChatHeadUrl(url) {
@@ -90,7 +94,7 @@ class Chat extends LitElement {
}
render() {
- console.log(6, "here");
+ console.log(22, "here");
return html`
@@ -126,6 +130,9 @@ class Chat extends LitElement {
.onClickFunc=${() => {
this.chatEditor.resetValue();
this.openPrivateMessage = false;
+ this.shadowRoot.getElementById('sendTo').value = "";
+ this.userFoundModalOpen = false;
+ this.userFound = [];
} }
style=${this.openPrivateMessage ? "display: block" : "display: none"}>
@@ -142,13 +149,26 @@ class Chat extends LitElement {
?disabled=${this.isLoading}
id="sendTo"
placeholder="${translate("chatpage.cchange7")}"
+ value=${this.userSelected}
+ @keypress=${() => this.userSelected = ""}
/>
-
-
+ ${this.userSelected ? (
+ html`
+
+ `
+ ) : (
+ html`
+
+
+ `
+ )}
- ${this.userFound.length > 0 ? (
- html`
- console.log('user selected')}
- .searchResults=${this.userFound}
- ?loading=${this.isLoading}>
-
- `
- ) : null}
+ {
+ this.userSelected = result;
+ this.userFound = [];
+ this.userFoundModalOpen = false;
+ }}
+ .closeFunc=${() => {
+ this.userFoundModalOpen = false;
+ this.userFound = [];
+ }}
+ .searchResults=${this.userFound}
+ ?isOpen=${this.userFoundModalOpen}
+ ?loading=${this.isLoading}>
+
@@ -255,6 +280,7 @@ class Chat extends LitElement {
const nameInput = this.shadowRoot.getElementById('sendTo');
nameInput.addEventListener('keydown', stopKeyEventPropagation);
+
this.shadowRoot.getElementById('messageBox').addEventListener('keydown', stopKeyEventPropagation);
// let typingTimer;
@@ -372,21 +398,36 @@ class Chat extends LitElement {
if (changedProperties && changedProperties.has('userFound')) {
console.log(this.userFound, "user found array here");
}
+ if (changedProperties && changedProperties.has('userSelected')) {
+ console.log(this.userSelected, "user selected here");
+ }
}
async userSearch() {
+ const nameValue = this.shadowRoot.getElementById('sendTo').value;
+ if(!nameValue) {
+ this.userFound = [];
+ this.userFoundModalOpen = true;
+ return;
+ }
try {
- let result = await parentEpml.request('apiCall', {
+ const result = await parentEpml.request('apiCall', {
type: 'api',
- url: `/names/${this.shadowRoot.getElementById('sendTo').value}`
+ url: `/names/${nameValue}`
})
- console.log({result});
- this.userFound = [
- ...this.userFound,
- result.owner,
- ];
+ if (result.error === 401) {
+ this.userFound = [];
+ } else {
+ this.userFound = [
+ ...this.userFound,
+ result.name,
+ ];
+ }
+ this.userFoundModalOpen = true;
} catch (error) {
console.error(error);
+ let err4string = get("chatpage.cchange35");
+ parentEpml.request('showSnackBar', `${err4string}`)
}
}