Tip user completed

This commit is contained in:
Justin Ferrari 2023-01-06 14:13:13 -05:00
parent b71f7004c1
commit 631cffeb21
7 changed files with 670 additions and 581 deletions

View File

@ -21,22 +21,22 @@
"korean": "Korean" "korean": "Korean"
}, },
"sidemenu": { "sidemenu": {
"minting":"MINTING", "minting": "MINTING",
"mintingdetails":"MINTING DETAILS", "mintingdetails": "MINTING DETAILS",
"becomeAMinter":"BECOME A MINTER", "becomeAMinter": "BECOME A MINTER",
"wallets":"WALLETS", "wallets": "WALLETS",
"tradeportal":"TRADE PORTAL", "tradeportal": "TRADE PORTAL",
"rewardshare":"REWARD SHARE", "rewardshare": "REWARD SHARE",
"nameregistration":"NAME REGISTRATION", "nameregistration": "NAME REGISTRATION",
"websites":"WEBSITES", "websites": "WEBSITES",
"management":"MANAGEMENT", "management": "MANAGEMENT",
"datamanagement":"DATA MANAGEMENT", "datamanagement": "DATA MANAGEMENT",
"qchat":"Q-CHAT", "qchat": "Q-CHAT",
"groupmanagement":"GROUP MANAGEMENT", "groupmanagement": "GROUP MANAGEMENT",
"puzzles":"PUZZLES", "puzzles": "PUZZLES",
"nodemanagement":"NODE MANAGEMENT", "nodemanagement": "NODE MANAGEMENT",
"trading":"TRADING", "trading": "TRADING",
"groups":"GROUPS" "groups": "GROUPS"
}, },
"login": { "login": {
"login": "Login", "login": "Login",
@ -130,32 +130,32 @@
"snack4": "Nodes successfully saved as", "snack4": "Nodes successfully saved as",
"snack5": "Nodes successfully imported" "snack5": "Nodes successfully imported"
}, },
"appinfo":{ "appinfo": {
"blockheight":"Block Height", "blockheight": "Block Height",
"uiversion":"UI Version", "uiversion": "UI Version",
"coreversion":"Core Version", "coreversion": "Core Version",
"minting":"(Minting)", "minting": "(Minting)",
"synchronizing":"Synchronizing", "synchronizing": "Synchronizing",
"peers":"Connected Peers" "peers": "Connected Peers"
}, },
"walletprofile": { "walletprofile": {
"minterlevel": "Minter Level", "minterlevel": "Minter Level",
"blocksminted": "Blocks Minted" "blocksminted": "Blocks Minted"
}, },
"general":{ "general": {
"yes":"Yes", "yes": "Yes",
"no":"No", "no": "No",
"confirm":"Confirm", "confirm": "Confirm",
"decline":"Decline", "decline": "Decline",
"open":"Open", "open": "Open",
"close":"Close", "close": "Close",
"back":"Back", "back": "Back",
"next":"Next", "next": "Next",
"create":"Create", "create": "Create",
"continue":"Continue", "continue": "Continue",
"save":"Save", "save": "Save",
"balance":"Balance", "balance": "Balance",
"balances":"YOUR WALLET BALANCES" "balances": "YOUR WALLET BALANCES"
}, },
"startminting": { "startminting": {
"smchange1": "Cannot fetch minting accounts", "smchange1": "Cannot fetch minting accounts",
@ -280,55 +280,55 @@
"wchange56": "WARNING!", "wchange56": "WARNING!",
"wchange57": "Memo" "wchange57": "Memo"
}, },
"tradepage":{ "tradepage": {
"tchange1":"Trade Portal", "tchange1": "Trade Portal",
"tchange2":"Select Trading Pair", "tchange2": "Select Trading Pair",
"tchange3":"HISTORIC MARKET TRADES", "tchange3": "HISTORIC MARKET TRADES",
"tchange4":"MY TRADE HISTORY", "tchange4": "MY TRADE HISTORY",
"tchange5":"OPEN MARKET SELL ORDERS", "tchange5": "OPEN MARKET SELL ORDERS",
"tchange6":"MY ORDERS", "tchange6": "MY ORDERS",
"tchange7":"Stuck Offers", "tchange7": "Stuck Offers",
"tchange8":"Amount", "tchange8": "Amount",
"tchange9":"Price", "tchange9": "Price",
"tchange10":"Total", "tchange10": "Total",
"tchange11":"Date", "tchange11": "Date",
"tchange12":"Status", "tchange12": "Status",
"tchange13":"Seller", "tchange13": "Seller",
"tchange14":"Price Each", "tchange14": "Price Each",
"tchange15":"Clear Form", "tchange15": "Clear Form",
"tchange16":"You have", "tchange16": "You have",
"tchange17":"Action", "tchange17": "Action",
"tchange18":"BUY", "tchange18": "BUY",
"tchange19":"SELL", "tchange19": "SELL",
"tchange20":"Failed to Create Trade. Try again!", "tchange20": "Failed to Create Trade. Try again!",
"tchange21":"Failed to Create Trade. Error Code", "tchange21": "Failed to Create Trade. Error Code",
"tchange22":"Insufficient Funds!", "tchange22": "Insufficient Funds!",
"tchange23":"Buy Request Successful!", "tchange23": "Buy Request Successful!",
"tchange24":"Buy Request Existing!", "tchange24": "Buy Request Existing!",
"tchange25":"Failed to Create Trade. Error Code", "tchange25": "Failed to Create Trade. Error Code",
"tchange26":"Trade Cancelling In Progress!", "tchange26": "Trade Cancelling In Progress!",
"tchange27":"Failed to Cancel Trade. Try again!", "tchange27": "Failed to Cancel Trade. Try again!",
"tchange28":"Failed to Cancel Trade. Error Code", "tchange28": "Failed to Cancel Trade. Error Code",
"tchange29":"CANCEL", "tchange29": "CANCEL",
"tchange30":"Failed to Fetch Balance. Try again!", "tchange30": "Failed to Fetch Balance. Try again!",
"tchange31":"SOLD", "tchange31": "SOLD",
"tchange32":"BOUGHT", "tchange32": "BOUGHT",
"tchange33":"Average", "tchange33": "Average",
"tchange34":"Amount can not be 0", "tchange34": "Amount can not be 0",
"tchange35":"Price can not be 0", "tchange35": "Price can not be 0",
"tchange36":"PENDING AUTO BUY", "tchange36": "PENDING AUTO BUY",
"tchange37":"No auto buy order found !", "tchange37": "No auto buy order found !",
"tchange38":"ADD", "tchange38": "ADD",
"tchange39":"AUTO BUY ORDER", "tchange39": "AUTO BUY ORDER",
"tchange40":"Price", "tchange40": "Price",
"tchange41":"Successfully removed auto buy order!", "tchange41": "Successfully removed auto buy order!",
"tchange42":"MARKET OPEN SELL ORDERS", "tchange42": "MARKET OPEN SELL ORDERS",
"tchange43":"MY BUY HISTORY", "tchange43": "MY BUY HISTORY",
"tchange44":"Successfully added auto buy order!", "tchange44": "Successfully added auto buy order!",
"tchange45":"AUTO BUY WITH", "tchange45": "AUTO BUY WITH",
"tchange46":"AUTO BUY", "tchange46": "AUTO BUY",
"tchange47":"Sell for this price", "tchange47": "Sell for this price",
"tchange48":"NOT ENOUGH" "tchange48": "NOT ENOUGH"
}, },
"rewardsharepage": { "rewardsharepage": {
"rchange1": "Rewardshares", "rchange1": "Rewardshares",
@ -354,47 +354,47 @@
"rchange21": "Reward Share Successful!", "rchange21": "Reward Share Successful!",
"rchange22": "Reward Share Removed Successfully!" "rchange22": "Reward Share Removed Successfully!"
}, },
"registernamepage":{ "registernamepage": {
"nchange1":"Name Registration", "nchange1": "Name Registration",
"nchange2":"Register Name", "nchange2": "Register Name",
"nchange3":"Registered Names", "nchange3": "Registered Names",
"nchange4":"Avatar", "nchange4": "Avatar",
"nchange5":"Name", "nchange5": "Name",
"nchange6":"Owner", "nchange6": "Owner",
"nchange7":"Action", "nchange7": "Action",
"nchange8":"No names registered by this account!", "nchange8": "No names registered by this account!",
"nchange9":"Register a Name!", "nchange9": "Register a Name!",
"nchange10":"Description (optional)", "nchange10": "Description (optional)",
"nchange11":"Doing something delicious", "nchange11": "Doing something delicious",
"nchange12":"Registering Name", "nchange12": "Registering Name",
"nchange13":"The current name registration fee is", "nchange13": "The current name registration fee is",
"nchange14":"Register", "nchange14": "Register",
"nchange15":"Set Avatar", "nchange15": "Set Avatar",
"nchange16":"Need Core Update", "nchange16": "Need Core Update",
"nchange17":"Name Already Exists!", "nchange17": "Name Already Exists!",
"nchange18":"Name Registration Successful!", "nchange18": "Name Registration Successful!",
"nchange19":"Sell Name", "nchange19": "Sell Name",
"nchange20":"Cancel Sell", "nchange20": "Cancel Sell",
"nchange21":"Buy Name", "nchange21": "Buy Name",
"nchange22":"Open Market Names To Sell", "nchange22": "Open Market Names To Sell",
"nchange23":"Sell Price", "nchange23": "Sell Price",
"nchange24":"No Names To Sell", "nchange24": "No Names To Sell",
"nchange25":"Name To Sell", "nchange25": "Name To Sell",
"nchange26":"Are you sure to sell this name ?", "nchange26": "Are you sure to sell this name ?",
"nchange27":"For this price in QORT", "nchange27": "For this price in QORT",
"nchange28":"On pressing confirm, the sell name request will be sent!", "nchange28": "On pressing confirm, the sell name request will be sent!",
"nchange29":"Name To Cancel", "nchange29": "Name To Cancel",
"nchange30":"Are you sure to cancel the sell for this name ?", "nchange30": "Are you sure to cancel the sell for this name ?",
"nchange31":"On pressing confirm, the cancel sell name request will be sent!", "nchange31": "On pressing confirm, the cancel sell name request will be sent!",
"nchange32":"Sell Name Request Successful!", "nchange32": "Sell Name Request Successful!",
"nchange33":"Cancel Sell Name Request Successful!", "nchange33": "Cancel Sell Name Request Successful!",
"nchange34":"Buy Name Request Successful!", "nchange34": "Buy Name Request Successful!",
"nchange35":"YOU HAVE A NAME!", "nchange35": "YOU HAVE A NAME!",
"nchange36":"Only accounts with no registered name can buy a name.", "nchange36": "Only accounts with no registered name can buy a name.",
"nchange37":"ATTENTION!", "nchange37": "ATTENTION!",
"nchange38":"You not have enough qort to buy this name.", "nchange38": "You not have enough qort to buy this name.",
"nchange39":"Are you sure to buy this name ?", "nchange39": "Are you sure to buy this name ?",
"nchange40":"On pressing confirm, the buy name request will be sent!" "nchange40": "On pressing confirm, the buy name request will be sent!"
}, },
"websitespage": { "websitespage": {
"schange1": "Browse Websites", "schange1": "Browse Websites",
@ -541,9 +541,8 @@
"cchange38": "User Verified", "cchange38": "User Verified",
"cchange39": "Cannot send an encrypted message to this user since they do not have their publickey on chain.", "cchange39": "Cannot send an encrypted message to this user since they do not have their publickey on chain.",
"cchange40": "IMAGE (click to view)", "cchange40": "IMAGE (click to view)",
"cchange41":"Your Balance Is Under 4.20 QORT", "cchange41": "Your Balance Is Under 4.20 QORT",
"cchange42":"Out of the need to combat spam, accounts with under 4.20 Qort balance will take a long time to SEND messages in Q-Chat. If you wish to immediately increase the send speed for Q-Chat messages, obtain over 4.20 QORT to your address. This can be done with trades in the Trade Portal, or by way of another Qortian giving you the QORT. Once you have over 4.20 QORT in your account, Q-Chat messages will be instant and this dialog will no more show. Thank you for your understanding of this necessary spam prevention method, and we hope you enjoy Qortal!" "cchange42": "Out of the need to combat spam, accounts with under 4.20 Qort balance will take a long time to SEND messages in Q-Chat. If you wish to immediately increase the send speed for Q-Chat messages, obtain over 4.20 QORT to your address. This can be done with trades in the Trade Portal, or by way of another Qortian giving you the QORT. Once you have over 4.20 QORT in your account, Q-Chat messages will be instant and this dialog will no more show. Thank you for your understanding of this necessary spam prevention method, and we hope you enjoy Qortal!"
}, },
"welcomepage": { "welcomepage": {
"wcchange1": "Welcome to Q-Chat", "wcchange1": "Welcome to Q-Chat",
@ -635,7 +634,15 @@
"gchange57": "TIP USER", "gchange57": "TIP USER",
"gchange58": "Tip Amount", "gchange58": "Tip Amount",
"gchange59": "Available Balance", "gchange59": "Available Balance",
"gchange60": "Failed to Fetch QORT Balance. Try again!" "gchange60": "Failed to Fetch QORT Balance. Try again!",
"gchange61": "Current static fee",
"gchange62": "Send",
"gchange63": "Insufficient Funds!",
"gchange64": "Invalid Amount!",
"gchange65": "Receiver cannot be empty!",
"gchange66": "Invalid Receiver!",
"gchange67": "Transaction Successful!",
"gchange68": "Transaction Failed!"
}, },
"puzzlepage": { "puzzlepage": {
"pchange1": "Puzzles", "pchange1": "Puzzles",
@ -725,104 +732,104 @@
"rewarddialog5": "You are removing a reward share transaction associated with account:", "rewarddialog5": "You are removing a reward share transaction associated with account:",
"rewarddialog6": "On pressing confirm, the rewardshare will be removed and the minting key will become invalid." "rewarddialog6": "On pressing confirm, the rewardshare will be removed and the minting key will become invalid."
}, },
"sponsorshipspage":{ "sponsorshipspage": {
"schange1":"Active Sponsorships", "schange1": "Active Sponsorships",
"schange2":"Account Address", "schange2": "Account Address",
"schange3":"Total Sponsorships active", "schange3": "Total Sponsorships active",
"schange4":"Next sponsorship ending in", "schange4": "Next sponsorship ending in",
"schange5":"Sponsor New Minter", "schange5": "Sponsor New Minter",
"schange6":"Finished Sponsorships", "schange6": "Finished Sponsorships",
"schange7":"Completed", "schange7": "Completed",
"schange8":"Addresses", "schange8": "Addresses",
"schange9":"You currently have no active sponsorships", "schange9": "You currently have no active sponsorships",
"schange10":"Public Key Lookup", "schange10": "Public Key Lookup",
"schange11":"Copy", "schange11": "Copy",
"schange12":"Address to Public Key Converter", "schange12": "Address to Public Key Converter",
"schange13":"Enter address", "schange13": "Enter address",
"schange14":"In progress", "schange14": "In progress",
"schange15":"Finishing up", "schange15": "Finishing up",
"schange16":"Copy the key below and share it with your sponsored person.", "schange16": "Copy the key below and share it with your sponsored person.",
"schange17":"Copied to clipboard", "schange17": "Copied to clipboard",
"schange18":"Warning: do not leave this plugin or close the Qortal UI until completion!", "schange18": "Warning: do not leave this plugin or close the Qortal UI until completion!",
"schange19":"Copy Sponsorship Key", "schange19": "Copy Sponsorship Key",
"schange20":"Creating relationship", "schange20": "Creating relationship",
"schange21":"Remove Sponsorship Key" "schange21": "Remove Sponsorship Key"
}, },
"explorerpage":{ "explorerpage": {
"exp1":"Address or name to search", "exp1": "Address or name to search",
"exp2":"Account Balance", "exp2": "Account Balance",
"exp3":"More Info", "exp3": "More Info",
"exp4":"Address or Name not found !", "exp4": "Address or Name not found !",
"exp5":"Note that registered names are case-sensitive.", "exp5": "Note that registered names are case-sensitive.",
"exp6":"Founder", "exp6": "Founder",
"exp7":"Info", "exp7": "Info",
"exp8":"Show all buy trades", "exp8": "Show all buy trades",
"exp9":"Show all sell trades", "exp9": "Show all sell trades",
"exp10":"BUY HISTORY", "exp10": "BUY HISTORY",
"exp11":"SELL HISTORY", "exp11": "SELL HISTORY",
"exp12":"No buy trades made yet.", "exp12": "No buy trades made yet.",
"exp13":"No sell trades made yet.", "exp13": "No sell trades made yet.",
"exp14":"Show complete info", "exp14": "Show complete info",
"exp15":"Minting Since", "exp15": "Minting Since",
"exp16":"Not Minting", "exp16": "Not Minting",
"exp17":"ALL PAYMENTS", "exp17": "ALL PAYMENTS",
"exp18":"Payments", "exp18": "Payments",
"exp19":"Sent", "exp19": "Sent",
"exp20":"Received", "exp20": "Received",
"exp21":"Trades" "exp21": "Trades"
}, },
"managegroup":{ "managegroup": {
"mg1":"Group Members", "mg1": "Group Members",
"mg2":"Invite To Group", "mg2": "Invite To Group",
"mg3":"Group Admins", "mg3": "Group Admins",
"mg4":"Update Group", "mg4": "Update Group",
"mg5":"Close Manage Group", "mg5": "Close Manage Group",
"mg6":"BAN", "mg6": "BAN",
"mg7":"KICK", "mg7": "KICK",
"mg8":"Group ID", "mg8": "Group ID",
"mg9":"Joined", "mg9": "Joined",
"mg10":"Add Group Admin", "mg10": "Add Group Admin",
"mg11":"Are you sure to add this member to admins ?", "mg11": "Are you sure to add this member to admins ?",
"mg12":"On pressing confirm, add admin request will be sent!", "mg12": "On pressing confirm, add admin request will be sent!",
"mg13":"Remove Group Admin", "mg13": "Remove Group Admin",
"mg14":"Remove Admin Address", "mg14": "Remove Admin Address",
"mg15":"Are you sure to remove this member from admins ?", "mg15": "Are you sure to remove this member from admins ?",
"mg16":"On pressing confirm, remove admin request will be sent!", "mg16": "On pressing confirm, remove admin request will be sent!",
"mg17":"Ban Member From Group", "mg17": "Ban Member From Group",
"mg18":"Member Name", "mg18": "Member Name",
"mg19":"Member Address", "mg19": "Member Address",
"mg20":"How Long To Ban", "mg20": "How Long To Ban",
"mg21":"Reason For Ban", "mg21": "Reason For Ban",
"mg22":"Are you sure to ban this member from the group ?", "mg22": "Are you sure to ban this member from the group ?",
"mg23":"On pressing confirm, the ban request will be sent!", "mg23": "On pressing confirm, the ban request will be sent!",
"mg24":"FOREVER", "mg24": "FOREVER",
"mg25":"Banned Members", "mg25": "Banned Members",
"mg26":"CANCEL BAN", "mg26": "CANCEL BAN",
"mg27":"Ban Expiry", "mg27": "Ban Expiry",
"mg28":"Cancel Ban Member From Group", "mg28": "Cancel Ban Member From Group",
"mg29":"Are you sure to cancel the ban for this member from the group ?", "mg29": "Are you sure to cancel the ban for this member from the group ?",
"mg30":"On pressing confirm, the cancel ban request will be sent!", "mg30": "On pressing confirm, the cancel ban request will be sent!",
"mg31":"Kick Member From Group", "mg31": "Kick Member From Group",
"mg32":"Reason For Kick", "mg32": "Reason For Kick",
"mg33":"Are you sure to kick this member from the group ?", "mg33": "Are you sure to kick this member from the group ?",
"mg34":"On pressing confirm, the kick request will be sent!", "mg34": "On pressing confirm, the kick request will be sent!",
"mg35":"No Open Group Invites", "mg35": "No Open Group Invites",
"mg36":"Your Open Group Invites", "mg36": "Your Open Group Invites",
"mg37":"Address or name to invite", "mg37": "Address or name to invite",
"mg38":"Invite Expiry Time", "mg38": "Invite Expiry Time",
"mg39":"All Fields Are Required", "mg39": "All Fields Are Required",
"mg40":"Are you sure to invite this member to the group ?", "mg40": "Are you sure to invite this member to the group ?",
"mg41":"On pressing confirm, the invite request will be sent!", "mg41": "On pressing confirm, the invite request will be sent!",
"mg42":"Group Type", "mg42": "Group Type",
"mg43":"Invite Expiry", "mg43": "Invite Expiry",
"mg44":"Public Group", "mg44": "Public Group",
"mg45":"Private Group", "mg45": "Private Group",
"mg46":"Cancel Invite", "mg46": "Cancel Invite",
"mg47":"Cancel Invite To Group", "mg47": "Cancel Invite To Group",
"mg48":"Are you sure to cancel the invite for this member ?", "mg48": "Are you sure to cancel the invite for this member ?",
"mg49":"On pressing confirm, the cancel invite request will be sent!", "mg49": "On pressing confirm, the cancel invite request will be sent!",
"mg50":"Coming Soon...", "mg50": "Coming Soon...",
"mg51":"Minimum 3 Characters / Maximum 32 Characters", "mg51": "Minimum 3 Characters / Maximum 32 Characters",
"mg52":"Maximum 128 Characters" "mg52": "Maximum 128 Characters"
} }
} }

View File

@ -47,8 +47,8 @@
"@polymer/paper-slider": "3.0.1", "@polymer/paper-slider": "3.0.1",
"@polymer/paper-spinner": "3.0.2", "@polymer/paper-spinner": "3.0.2",
"@polymer/paper-tooltip": "3.0.1", "@polymer/paper-tooltip": "3.0.1",
"@vaadin/horizontal-layout": "23.2.5", "@vaadin/horizontal-layout": "23.3.2",
"@vaadin/tabs": "23.2.5", "@vaadin/tabs": "23.3.2",
"@rollup/plugin-alias": "4.0.2", "@rollup/plugin-alias": "4.0.2",
"@rollup/plugin-babel": "6.0.3", "@rollup/plugin-babel": "6.0.3",
"@rollup/plugin-commonjs": "24.0.0", "@rollup/plugin-commonjs": "24.0.0",
@ -75,4 +75,4 @@
"engines": { "engines": {
"node": ">=16.17.1" "node": ">=16.17.1"
} }
} }

View File

@ -1171,22 +1171,20 @@ class ChatPage extends LitElement {
</div> </div>
</wrapper-modal> </wrapper-modal>
</div> </div>
<div class="chat-right-panel ${this.shifted ? "movedin" : "movedout"}" ${animate()}> <div class="chat-right-panel ${this.shifted ? "movedin" : "movedout"}" ${animate()}>
<chat-right-panel <chat-right-panel
.getMoreMembers=${(val)=> this.getMoreMembers(val)} .getMoreMembers=${(val)=> this.getMoreMembers(val)}
.toggle=${(val)=> this._toggle(val)} .toggle=${(val)=> this._toggle(val)}
.selectedAddress=${this.selectedAddress} .selectedAddress=${this.selectedAddress}
.groupMembers=${this.groupMembers} .groupMembers=${this.groupMembers}
.groupAdmin=${this.groupAdmin} .groupAdmin=${this.groupAdmin}
.leaveGroupObj=${this.groupInfo} .leaveGroupObj=${this.groupInfo}
.setOpenPrivateMessage=${(val) => this.setOpenPrivateMessage(val)} .setOpenPrivateMessage=${(val) => this.setOpenPrivateMessage(val)}
.chatEditor=${this.chatEditor} .chatEditor=${this.chatEditor}>
>
</chat-right-panel> </chat-right-panel>
</div>
</div> </div>
</div> `
`
} }
async getMoreMembers(groupId){ async getMoreMembers(groupId){

View File

@ -1,16 +1,17 @@
import { LitElement, html, css } from "lit" import { LitElement, html, css } from "lit";
import { render } from "lit/html.js" import { render } from "lit/html.js";
import { get, translate } from "lit-translate" import { get, translate } from "lit-translate";
import { Epml } from "../../../epml" import { Epml } from "../../../epml";
import { getUserNameFromAddress } from "../../utils/getUserNameFromAddress" import { getUserNameFromAddress } from "../../utils/getUserNameFromAddress";
import snackbar from "./snackbar.js" import snackbar from "./snackbar.js";
import "@material/mwc-button" import "@material/mwc-button";
import "@material/mwc-dialog" import "@material/mwc-dialog";
import "@polymer/paper-spinner/paper-spinner-lite.js" import "@polymer/paper-spinner/paper-spinner-lite.js";
import "@material/mwc-icon" import '@polymer/paper-progress/paper-progress.js';
import "./WrapperModal" import "@material/mwc-icon";
import '@vaadin/button';
const parentEpml = new Epml({ type: "WINDOW", source: window.parent }) import "./WrapperModal";
import "./TipUser"
class ChatRightPanel extends LitElement { class ChatRightPanel extends LitElement {
static get properties() { static get properties() {
@ -30,7 +31,11 @@ class ChatRightPanel extends LitElement {
openTipUser: { type: Boolean }, openTipUser: { type: Boolean },
userName: { type: String }, userName: { type: String },
chatEditor: { type: Object }, chatEditor: { type: Object },
walletBalance: { type: Number } walletBalance: { type: Number },
sendMoneyLoading: { type: Boolean },
btnDisable: { type: Boolean },
errorMessage: { type: String },
successMessage: { type: String }
} }
} }
@ -50,7 +55,12 @@ class ChatRightPanel extends LitElement {
this.downObserverElement = '' this.downObserverElement = ''
this.myAddress = window.parent.reduxStore.getState().app.selectedAddress.address this.myAddress = window.parent.reduxStore.getState().app.selectedAddress.address
this.openTipUser = false this.openTipUser = false
this.userName = {} this.userName = ""
this.sendMoneyLoading = false
this.btnDisable = false
this.errorMessage = ""
this.successMessage = ""
this.setOpenTipUser = this.setOpenTipUser.bind(this);
} }
static get styles() { static get styles() {
@ -203,8 +213,8 @@ class ChatRightPanel extends LitElement {
} }
.send-message-button:hover { .send-message-button:hover {
cursor: pointer; cursor: pointer;
background-color: #03a8f485; background-color: #03a8f485;
} }
.close-icon { .close-icon {
@ -220,54 +230,6 @@ class ChatRightPanel extends LitElement {
cursor: pointer; cursor: pointer;
color: #494c50; color: #494c50;
} }
.tip-user-header {
display: flex;
justify-content: center;
align-items: center;
padding: 12px;
border-bottom: 1px solid whitesmoke;
gap: 25px;
}
.tip-user-header-font {
font-family: Montserrat, sans-serif;
font-size: 20px;
color: var(--chat-bubble-msg-color);
}
.tip-user-body {
display: flex;
justify-content: center;
align-items: flex-start;
padding: 20px 10px;
flex-direction: column;
gap: 15px;
}
.tip-input {
width: 300px;
margin-bottom: 15px;
outline: 0;
border-width: 0 0 2px;
border-color: var(--mdc-theme-primary);
background-color: transparent;
padding: 10px;
font-family: Roboto, sans-serif;
font-size: 15px;
color: var(--chat-bubble-msg-color);
}
.tip-input::selection {
background-color: var(--mdc-theme-primary);
color: white;
}
.tip-input::placeholder {
opacity: 0.9;
color: var(--black);
}
` `
} }
@ -275,7 +237,6 @@ class ChatRightPanel extends LitElement {
this.viewElement = this.shadowRoot.getElementById('viewElement'); this.viewElement = this.shadowRoot.getElementById('viewElement');
this.downObserverElement = this.shadowRoot.getElementById('downObserver'); this.downObserverElement = this.shadowRoot.getElementById('downObserver');
this.elementObserver(); this.elementObserver();
this.fetchWalletDetails();
} }
async updated(changedProperties) { async updated(changedProperties) {
@ -287,236 +248,6 @@ class ChatRightPanel extends LitElement {
} }
} }
timeIsoString(timestamp) {
let myTimestamp = timestamp === undefined ? 1587560082346 : timestamp
let time = new Date(myTimestamp)
return time.toISOString()
}
resetDefaultSettings() {
this.error = false
this.message = ""
this.isLoading = false
}
renderErr9Text() {
return html`${translate("grouppage.gchange49")}`
}
async confirmRelationship(reference) {
let interval = null
let stop = false
const getAnswer = async () => {
if (!stop) {
stop = true
try {
let myRef = await parentEpml.request("apiCall", {
type: "api",
url: `/transactions/reference/${reference}`,
})
if (myRef && myRef.type) {
clearInterval(interval)
this.isLoading = false
this.openUserInfo = false
}
} catch (error) {}
stop = false
}
}
interval = setInterval(getAnswer, 5000)
}
async unitFee(txType) {
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node];
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
const url = `${nodeUrl}/transactions/unitfee?txType=${txType}`;
let fee = null;
try {
const res = await fetch(url);
const data = await res.json();
fee = (Number(data) / 1e8).toFixed(3);
} catch (error) {
fee = null;
}
return fee;
}
async getLastRef() {
let myRef = await parentEpml.request("apiCall", {
type: "api",
url: `/addresses/lastreference/${this.selectedAddress.address}`,
})
return myRef;
}
getTxnRequestResponse(txnResponse, reference) {
if (txnResponse === true) {
this.message = this.renderErr9Text()
this.error = false
this.confirmRelationship(reference)
} else {
this.error = true
this.message = ""
throw new Error(txnResponse)
}
}
async convertBytesForSigning(transactionBytesBase58) {
let convertedBytes = await parentEpml.request("apiCall", {
type: "api",
method: "POST",
url: `/transactions/convert`,
body: `${transactionBytesBase58}`,
})
return convertedBytes
}
async signTx(body){
return await parentEpml.request("apiCall", {
type: "api",
method: "POST",
url: `/transactions/sign`,
body: body,
headers: {
'Content-Type': 'application/json'
}
})
}
async process(body){
return await parentEpml.request("apiCall", {
type: "api",
method: "POST",
url: `/transactions/process`,
body: body,
})
}
async _addAdmin(groupId) {
this.resetDefaultSettings()
const leaveFeeInput = await this.unitFee('ADD_GROUP_ADMIN')
if(!leaveFeeInput){
throw Error()
}
this.isLoading = true
// Get Last Ref
const getLastRef = async () => {
let myRef = await parentEpml.request('apiCall', {
type: 'api',
url: `/addresses/lastreference/${this.selectedAddress.address}`
})
return myRef
};
const validateReceiver = async () => {
let lastRef = await getLastRef();
let myTransaction = await makeTransactionRequest(lastRef)
getTxnRequestResponse(myTransaction)
}
// Make Transaction Request
const makeTransactionRequest = async (lastRef) => {
let groupdialog3 = get("transactions.groupdialog3")
let groupdialog4 = get("transactions.groupdialog4")
let myTxnrequest = await parentEpml.request('transaction', {
type: 24,
nonce: this.selectedAddress.nonce,
params: {
_groupId: groupId,
fee: leaveFeeInput,
member: this.selectedHead.address,
lastReference: lastRef
}
})
return myTxnrequest
}
const getTxnRequestResponse = (txnResponse) => {
if (txnResponse.success === false && txnResponse.message) {
this.error = true
this.message = txnResponse.message
throw new Error(txnResponse)
} else if (txnResponse.success === true && !txnResponse.data.error) {
this.message = this.renderErr9Text()
this.error = false
this.confirmRelationship()
} else {
this.error = true
this.message = txnResponse.data.message
throw new Error(txnResponse)
}
}
validateReceiver()
}
async _removeAdmin(groupId) {
this.resetDefaultSettings()
const leaveFeeInput = await this.unitFee('REMOVE_GROUP_ADMIN')
if(!leaveFeeInput){
throw Error()
}
this.isLoading = true
// Get Last Ref
const getLastRef = async () => {
let myRef = await parentEpml.request('apiCall', {
type: 'api',
url: `/addresses/lastreference/${this.selectedAddress.address}`
})
return myRef
};
const validateReceiver = async () => {
let lastRef = await getLastRef();
let myTransaction = await makeTransactionRequest(lastRef)
getTxnRequestResponse(myTransaction)
}
// Make Transaction Request
const makeTransactionRequest = async (lastRef) => {
let groupdialog3 = get("transactions.groupdialog3")
let groupdialog4 = get("transactions.groupdialog4")
let myTxnrequest = await parentEpml.request('transaction', {
type: 25,
nonce: this.selectedAddress.nonce,
params: {
_groupId: groupId,
fee: leaveFeeInput,
member: this.selectedHead.address,
lastReference: lastRef
}
})
return myTxnrequest
}
const getTxnRequestResponse = (txnResponse) => {
if (txnResponse.success === false && txnResponse.message) {
this.error = true
this.message = txnResponse.message
throw new Error(txnResponse)
} else if (txnResponse.success === true && !txnResponse.data.error) {
this.message = this.renderErr9Text()
this.error = false
this.confirmRelationship()
} else {
this.error = true
this.message = txnResponse.data.message
throw new Error(txnResponse)
}
}
validateReceiver()
}
elementObserver() { elementObserver() {
const options = { const options = {
root: this.viewElement, root: this.viewElement,
@ -530,42 +261,27 @@ class ChatRightPanel extends LitElement {
// call `observe()` on that MutationObserver instance, // call `observe()` on that MutationObserver instance,
// passing it the element to observe, and the options object // passing it the element to observe, and the options object
observer.observe(elementToObserve); observer.observe(elementToObserve);
}
observerHandler(entries) {
if (!entries[0].isIntersecting) {
return
} else {
if(this.groupMembers.length < 20){
return
}
console.log('this.leaveGroupObjp', this.leaveGroupObj)
this.getMoreMembers(this.leaveGroupObj.groupId)
}
}
getApiKey() {
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node];
let apiKey = myNode.apiKey;
return apiKey;
} }
async fetchWalletDetails() { observerHandler(entries) {
parentEpml.request('apiCall', { if (!entries[0].isIntersecting) {
url: `/addresses/balance/${this.myAddress}?apiKey=${this.getApiKey()}`, return
}) } else {
.then((res) => { if(this.groupMembers.length < 20){
if (isNaN(Number(res))) { return
let snack4string = get("grouppage.gchange60")
parentEpml.request('showSnackBar', `${snack4string}`)
} else {
this.walletBalance = Number(res).toFixed(8);
} }
}) console.log('this.leaveGroupObjp', this.leaveGroupObj)
this.getMoreMembers(this.leaveGroupObj.groupId)
}
}
setOpenTipUser(props) {
this.openTipUser = props
} }
render() { render() {
console.log('this.groupMembers', this.groupMembers); console.log('this.groupMembers', this.groupMembers);
console.log(20, "Chat Right Panel Here"); console.log(28, "Chat Right Panel Here");
const owner = this.groupAdmin.filter((admin)=> admin.address === this.leaveGroupObj.owner) const owner = this.groupAdmin.filter((admin)=> admin.address === this.leaveGroupObj.owner)
return html` return html`
<div class="container"> <div class="container">
@ -626,7 +342,9 @@ class ChatRightPanel extends LitElement {
<wrapper-modal <wrapper-modal
.onClickFunc=${() => { .onClickFunc=${() => {
if (this.isLoading) return if (this.isLoading) return
this.openUserInfo = false this.openUserInfo = false;
this.userName = "";
this.shadowRoot.querySelector("tip-user").shadowRoot.getElementById('amountInput').value = "";
}} }}
style=${ style=${
this.openUserInfo ? "display: block" : "display: none" this.openUserInfo ? "display: block" : "display: none"
@ -691,14 +409,13 @@ class ChatRightPanel extends LitElement {
this.chatEditor.enable(); this.chatEditor.enable();
}} }}
style=${this.openTipUser ? "display: block" : "display: none"}> style=${this.openTipUser ? "display: block" : "display: none"}>
<div class="tip-user-header"> <tip-user
<img src="/img/qort.png" width="32" height="32"> .openUserInfo=${this.openUserInfo}
<p class="tip-user-header-font">${translate("grouppage.gchange55")} ${this.userName}</p> .chatEditor=${this.chatEditor}
</div> .userName=${this.userName}
<div class="tip-user-body"> .setOpenTipUser=${(val) => this.setOpenTipUser(val)}
<p class="tip-available">${translate("grouppage.gchange59")}: ${this.walletBalance} QORT</p> >
<input class="tip-input" type="number" placeholder="${translate("grouppage.gchange58")}" /> </tip-user>
</div>
</wrapper-modal> </wrapper-modal>
</div> </div>
</div> </div>

View File

@ -0,0 +1,85 @@
import { css } from 'lit'
export const tipUserStyles = css`
.tip-user-header {
display: flex;
justify-content: center;
align-items: center;
padding: 12px;
border-bottom: 1px solid whitesmoke;
gap: 25px;
user-select: none;
}
.tip-user-header-font {
font-family: Montserrat, sans-serif;
font-size: 20px;
color: var(--chat-bubble-msg-color);
margin: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.tip-user-body {
display: flex;
justify-content: center;
align-items: center;
padding: 20px 10px;
flex-direction: column;
gap: 25px;
}
.tip-input {
width: 300px;
margin-bottom: 15px;
outline: 0;
border-width: 0 0 2px;
border-color: var(--mdc-theme-primary);
background-color: transparent;
padding: 10px;
font-family: Roboto, sans-serif;
font-size: 15px;
color: var(--chat-bubble-msg-color);
}
.tip-input::selection {
background-color: var(--mdc-theme-primary);
color: white;
}
.tip-input::placeholder {
opacity: 0.9;
color: var(--black);
}
.tip-available {
font-family: Roboto, sans-serif;
font-size: 17px;
color: var(--chat-bubble-msg-color);
font-weight: 300;
letter-spacing: 0.3px;
margin: 0;
user-select: none;
}
.success-msg {
font-family: Roboto, sans-serif;
font-size: 18px;
font-weight: 400;
letter-spacing: 0.3px;
margin: 0;
user-select: none;
color: #10880b;
}
.error-msg {
font-family: Roboto, sans-serif;
font-size: 18px;
font-weight: 400;
letter-spacing: 0.3px;
margin: 0;
user-select: none;
color: #f30000;
}
`

View File

@ -0,0 +1,282 @@
import { LitElement, html } from 'lit';
import { render } from 'lit/html.js';
import { get, translate } from 'lit-translate';
import { tipUserStyles } from './TipUser-css.js';
import { Epml } from '../../../epml';
import '@vaadin/button';
import '@polymer/paper-progress/paper-progress.js';
const parentEpml = new Epml({ type: "WINDOW", source: window.parent });
export class TipUser extends LitElement {
static get properties() {
return {
userName: { type: String },
chatEditor: { type: Object },
walletBalance: { type: Number },
sendMoneyLoading: { type: Boolean },
openUserInfo: { type: Boolean },
btnDisable: { type: Boolean },
errorMessage: { type: String },
successMessage: { type: String },
setOpenTipUser: { attribute: false }
}
}
constructor() {
super()
this.sendMoneyLoading = false
this.btnDisable = false
this.errorMessage = ""
this.successMessage = ""
this.myAddress = window.parent.reduxStore.getState().app.selectedAddress
}
static styles = [tipUserStyles]
async firstUpdated() {
await this.fetchWalletDetails();
}
updated(changedProperties) {
if (changedProperties && changedProperties.has("openUserInfo")) {
if (this.openUserInfo) {
this.shadowRoot.getElementById("amountInput").value = "";
this.errorMessage = "";
this.successMessage = "";
}
}
}
async getLastRef() {
let myRef = await parentEpml.request("apiCall", {
type: "api",
url: `/addresses/lastreference/${this.myAddress.address}`,
})
return myRef;
}
renderSuccessText() {
return html`${translate("grouppage.gchange67")}`
}
renderReceiverText() {
return html`${translate("grouppage.gchange66")}`
}
getApiKey() {
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node];
let apiKey = myNode.apiKey;
return apiKey;
}
async fetchWalletDetails() {
await parentEpml.request('apiCall', {
url: `/addresses/balance/${this.myAddress.address}?apiKey=${this.getApiKey()}`,
})
.then((res) => {
if (isNaN(Number(res))) {
let snack4string = get("grouppage.gchange60")
parentEpml.request('showSnackBar', `${snack4string}`)
} else {
this.walletBalance = Number(res).toFixed(8);
}
})
}
async sendQort() {
const amount = this.shadowRoot.getElementById("amountInput").value;
let recipient = this.userName;
this.sendMoneyLoading = true;
this.btnDisable = true;
if (parseFloat(amount) + parseFloat(0.001) > parseFloat(this.walletBalance)) {
this.sendMoneyLoading = false;
this.btnDisable = false;
let snack1string = get("grouppage.gchange63");
parentEpml.request('showSnackBar', `${snack1string}`);
return false;
}
if (parseFloat(amount) <= 0) {
this.sendMoneyLoading = false;
this.btnDisable = false;
let snack2string = get("grouppage.gchange64");
parentEpml.request('showSnackBar', `${snack2string}`);
return false;
}
if (recipient.length === 0) {
this.sendMoneyLoading = false;
this.btnDisable = false;
let snack3string = get("grouppage.gchange65");
parentEpml.request('showSnackBar', `${snack3string}`);
return false;
}
const validateName = async (receiverName) => {
let myRes;
let myNameRes = await parentEpml.request('apiCall', {
type: 'api',
url: `/names/${receiverName}`,
})
if (myNameRes.error === 401) {
myRes = false;
} else {
myRes = myNameRes;
}
return myRes;
}
const validateAddress = async (receiverAddress) => {
let myAddress = await window.parent.validateAddress(receiverAddress);
return myAddress;
}
const validateReceiver = async (recipient) => {
let lastRef = await this.getLastRef();
let isAddress;
try {
isAddress = await validateAddress(recipient);
} catch (err) {
isAddress = false;
}
if (isAddress) {
let myTransaction = await makeTransactionRequest(recipient, lastRef);
getTxnRequestResponse(myTransaction);
} else {
let myNameRes = await validateName(recipient);
if (myNameRes !== false) {
let myNameAddress = myNameRes.owner
let myTransaction = await makeTransactionRequest(myNameAddress, lastRef)
getTxnRequestResponse(myTransaction)
} else {
console.error(this.renderReceiverText())
this.errorMessage = this.renderReceiverText();
this.sendMoneyLoading = false;
this.btnDisable = false;
}
}
}
const getName = async (recipient)=> {
try {
const getNames = await parentEpml.request("apiCall", {
type: "api",
url: `/names/address/${recipient}`,
});
if (getNames?.length > 0 ) {
return getNames[0].name;
} else {
return '';
}
} catch (error) {
return "";
}
}
const makeTransactionRequest = async (receiver, lastRef) => {
let myReceiver = receiver;
let mylastRef = lastRef;
let dialogamount = get("transactions.amount");
let dialogAddress = get("login.address");
let dialogName = get("login.name");
let dialogto = get("transactions.to");
let recipientName = await getName(myReceiver);
let myTxnrequest = await parentEpml.request('transaction', {
type: 2,
nonce: this.myAddress.nonce,
params: {
recipient: myReceiver,
recipientName: recipientName,
amount: amount,
lastReference: mylastRef,
fee: 0.001,
dialogamount: dialogamount,
dialogto: dialogto,
dialogAddress,
dialogName
},
})
return myTxnrequest;
}
const getTxnRequestResponse = (txnResponse) => {
if (txnResponse.success === false && txnResponse.message) {
this.errorMessage = txnResponse.message;
this.sendMoneyLoading = false;
this.btnDisable = false;
throw new Error(txnResponse);
} else if (txnResponse.success === true && !txnResponse.data.error) {
this.shadowRoot.getElementById('amountInput').value = '';
this.userName = '';
this.errorMessage = '';
this.successMessage = this.renderSuccessText();
this.sendMoneyLoading = false;
this.btnDisable = false;
setTimeout(() => {
this.setOpenTipUser(false);
this.chatEditor.enable();
this.successMessage = "";
}, 3000);
} else {
this.errorMessage = txnResponse.data.message;
this.sendMoneyLoading = false;
this.btnDisable = false;
throw new Error(txnResponse);
}
}
validateReceiver(recipient);
}
render() {
console.log(5, "Tip User Here");
console.log(this.openUserInfo, "openUserInfo here");
return html`
<div class="tip-user-header">
<img src="/img/qort.png" width="32" height="32">
<p class="tip-user-header-font">${translate("grouppage.gchange55")} ${this.userName}</p>
</div>
<div class="tip-user-body">
<p class="tip-available">${translate("grouppage.gchange59")}: ${this.walletBalance} QORT</p>
<input id="amountInput" class="tip-input" type="number" placeholder="${translate("grouppage.gchange58")}" />
<p class="tip-available">${translate("grouppage.gchange61")}: 0.001 QORT</p>
${this.sendMoneyLoading ?
html`
<paper-progress indeterminate style="width: 100%; margin: 4px;">
</paper-progress>`
: html`
<div style=${"text-align: center;"}>
<vaadin-button
?disabled=${this.btnDisable}
theme="primary medium"
style="width: 100%; cursor: pointer"
@click=${() => this.sendQort()}>
<vaadin-icon icon="vaadin:arrow-forward" slot="prefix"></vaadin-icon>
${translate("grouppage.gchange62")} QORT
</vaadin-button>
</div>
`}
${this.successMessage ?
html`
<p class="success-msg">
${this.successMessage}
</p>
`
: this.errorMessage ?
html`
<p class="error-msg">
${this.errorMessage}
</p>
`
: null}
</div>
`;
}
}
customElements.define('tip-user', TipUser);

View File

@ -13,7 +13,7 @@ export const getUserNameFromAddress = async (address) => {
if (Array.isArray(getNames) && getNames.length > 0 ) { if (Array.isArray(getNames) && getNames.length > 0 ) {
return getNames[0].name; return getNames[0].name;
} else { } else {
return cropAddress(address); return address;
} }
} catch (error) { } catch (error) {
console.error(error); console.error(error);