diff --git a/qortal-ui-core/language/us.json b/qortal-ui-core/language/us.json index 3e32d857..37e80f84 100644 --- a/qortal-ui-core/language/us.json +++ b/qortal-ui-core/language/us.json @@ -91,42 +91,42 @@ "selectfile": "Select file", "dragfile": "Drag and drop backup here" }, - "settings":{ - "generalinfo":"General Account Info", - "address":"Address", - "publickey":"Public Key", - "settings":"Settings", - "account":"Account", - "security":"Security", - "qr_login_menu_item":"QR Login", - "qr_login_description_1":"Scan this code to unlock your wallet on other device using the same password which you logged in with.", - "qr_login_description_2":"Choose a password which you will use to unlock your wallet on other device after scanning the QR code.", - "qr_login_button_1":"Show login QR code", - "qr_login_button_2":"Generate login QR code", - "notifications":"Notifications", - "accountsecurity":"Account Security", - "password":"Password", - "download":"Download Backup File", - "choose":"Please choose a password to encrypt your backup with. (This can be the same as the one you logged in with, or different)", - "block":"Block Notifications (Coming Soon...)", - "playsound":"Play Sound", - "shownotifications":"Show Notifications", - "nodeurl":"Node Url", - "nodehint":"Select a node from the default list of nodes above or add a custom node to the list above by clicking on the button below", - "addcustomnode":"Add Custom Node", - "addandsave":"Add And Save", - "protocol":"Protocol", - "domain":"Domain", - "port":"Port", - "import":"Import Nodes", - "export":"Export Nodes", - "deletecustomnode":"Remove All Custom Nodes", - "warning":"Your existing nodes will be deleted and from backup new created.", - "snack1":"Successfully deleted and added standard nodes", - "snack2":"UI conected to node", - "snack3":"Successfully added and saved custom node", - "snack4":"Nodes successfully saved as", - "snack5":"Nodes successfully imported" + "settings": { + "generalinfo": "General Account Info", + "address": "Address", + "publickey": "Public Key", + "settings": "Settings", + "account": "Account", + "security": "Security", + "qr_login_menu_item": "QR Login", + "qr_login_description_1": "Scan this code to unlock your wallet on other device using the same password which you logged in with.", + "qr_login_description_2": "Choose a password which you will use to unlock your wallet on other device after scanning the QR code.", + "qr_login_button_1": "Show login QR code", + "qr_login_button_2": "Generate login QR code", + "notifications": "Notifications", + "accountsecurity": "Account Security", + "password": "Password", + "download": "Download Backup File", + "choose": "Please choose a password to encrypt your backup with. (This can be the same as the one you logged in with, or different)", + "block": "Block Notifications (Coming Soon...)", + "playsound": "Play Sound", + "shownotifications": "Show Notifications", + "nodeurl": "Node Url", + "nodehint": "Select a node from the default list of nodes above or add a custom node to the list above by clicking on the button below", + "addcustomnode": "Add Custom Node", + "addandsave": "Add And Save", + "protocol": "Protocol", + "domain": "Domain", + "port": "Port", + "import": "Import Nodes", + "export": "Export Nodes", + "deletecustomnode": "Remove All Custom Nodes", + "warning": "Your existing nodes will be deleted and from backup new created.", + "snack1": "Successfully deleted and added standard nodes", + "snack2": "UI conected to node", + "snack3": "Successfully added and saved custom node", + "snack4": "Nodes successfully saved as", + "snack5": "Nodes successfully imported" }, "appinfo": { "blockheight": "Block Height", @@ -487,7 +487,8 @@ "cchange25": "Edit Message", "cchange26": "File size exceeds 5 MB", "cchange27": "A registered name is required to send images", - "cchange28": "This file is not an image" + "cchange28": "This file is not an image", + "cchange29": "Cancel" }, "welcomepage": { "wcchange1": "Welcome to Q-Chat", diff --git a/qortal-ui-plugins/plugins/core/components/ChatPage.js b/qortal-ui-plugins/plugins/core/components/ChatPage.js index 37d522b6..7e12adac 100644 --- a/qortal-ui-plugins/plugins/core/components/ChatPage.js +++ b/qortal-ui-plugins/plugins/core/components/ChatPage.js @@ -55,13 +55,20 @@ class ChatPage extends LitElement { repliedToMessageObj: { type: Object }, editedMessageObj: { type: Object }, iframeHeight: { type: Number }, - chatMessageSize: { type: Number}, - imageFile: {type: Object} + chatMessageSize: { type: Number }, + imageFile: { type: Object }, + caption: { type: String } } } static get styles() { return css` + * { + /* Styling mdc dialog native props */ + --mdc-dialog-min-width: 300px; + --mdc-dialog-box-shadow:rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px; + } + html { scroll-behavior: smooth; } @@ -194,6 +201,41 @@ class ChatPage extends LitElement { color: var(--black); } + .emoji-button-caption { + width: 45px; + height: 40px; + padding-top: 4px; + border: none; + outline: none; + background: transparent; + cursor: pointer; + max-height: 40px; + color: var(--black); + } + + .caption-container { + width: 100%; + display: flex; + height: auto; + overflow: hidden; + justify-content: center; + } + + .chatbar-caption { + font-family: Roboto, sans-serif; + width: 70%; + margin-right: 10px; + outline: none; + align-items: center; + font-size: 18px; + resize: none; + border-top: 0; + border-right: 0; + border-left: 0; + border-bottom: 1px solid #cac8c8; + padding: 3px; + } + .message-size-container { display: flex; justify-content: flex-end; @@ -334,13 +376,46 @@ class ChatPage extends LitElement { input[type=file]::-webkit-file-upload-button { cursor: pointer; } - + + .mdc-dialog .mdc-dialog__surface { + border-radius: 10px; + } + + /* Add Image Modal Dialog Styling */ + + .dialog-container { + position: relative; + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + height: 100%; + padding: 18px 18px 0 18px; + gap: 15px; + } + + .dialog-container:after { + position: absolute; + content: ""; + bottom: -15px; + height: 1px; + width: 95%; + background: #dddddd; + } + + .dialog-image { + width: 100%; + border-radius: 0; + } + + .red { + --mdc-theme-primary: #F44336; + } ` } constructor() { super() - this.getMessageConfig = this.getMessageConfig.bind(this) this.getOldMessage = this.getOldMessage.bind(this) this._sendMessage = this._sendMessage.bind(this) this.insertImage = this.insertImage.bind(this) @@ -371,6 +446,7 @@ class ChatPage extends LitElement { this.chatMessageSize = 0 this.imageFile = null this.uid = new ShortUniqueId() + this.caption = "" } render() { @@ -392,40 +468,70 @@ class ChatPage extends LitElement { ` : this.renderChatScroller(this._initialMessages)} - { - this.imageFile = null + { + this.chatEditor.enable(); + this.caption = ""; + this.imageFile = null; }}>
-
+
${this.imageFile && html` - + dialog-img `} -
+ +
+ +
+ ${this.isLoading === false ? html` + send-icon this._sendMessage()} /> + ` : + html` + + `} +
+
+ ${this.chatMessageSize >= 750 ? + html` +
+
+ ${`Your message size is of ${this.chatMessageSize} bytes out of a maximum of 1000`} +
+
+ ` : + html``} +
{ - this._sendMessage({ - type: 'image', - imageFile: this.imageFile, - caption: 'This is a caption' - }) + @click=${()=>{ + + this.imageFile = null }} > - send + ${translate("chatpage.cchange29")} { - - this.imageFile = null + @click=${()=> { + // this._sendMessage({ + // type: 'image', + // imageFile: this.imageFile, + // caption: 'This is a caption' + // }) + console.log(this.caption); }} > - ${translate("general.close")} - + ${translate("chatpage.cchange9")} +
@@ -483,7 +589,7 @@ class ChatPage extends LitElement {
-