Merge pull request #13 from ranchimall/ui-work

minor bug fixes and UI changes
This commit is contained in:
sairaj mote 2022-04-25 21:29:44 +05:30 committed by GitHub
commit 68608eec85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 6 deletions

View File

@ -841,7 +841,7 @@ ul {
}
#contact > :last-child {
padding: 0.5rem 1.5rem;
background-color: rgba(var(--text-color), 0.03);
border-top: solid thin rgba(var(--text-color), 0.2);
}
#contact > :last-child button {
padding: 0.8rem 2rem;

2
css/main.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -791,7 +791,7 @@ ul {
}
& > :last-child {
padding: 0.5rem 1.5rem;
background-color: rgba(var(--text-color), 0.03);
border-top: solid thin rgba(var(--text-color), 0.2);
button {
padding: 0.8rem 2rem;
border-radius: 1rem;

View File

@ -1244,6 +1244,7 @@
<template id="transaction_message_template">
<li class="transaction-message grid">
<h3 class="transaction-message__amount"></h3>
<p class="transaction-message__remark"></p>
<time class="transaction-message__time"></time>
</li>
</template>

View File

@ -285,12 +285,12 @@ userUI.renderMoneyRequests = function (requests, error = null) {
userUI.payRequest = function (reqID) {
let { message: { amount, remark }, senderID } = User.moneyRequests[reqID];
getConfirmation('Pay?', { message: `Do you want to pay ${request.message.amount} to ${request.senderID}?`, confirmText: 'Pay' }).then(confirmation => {
getConfirmation('Pay?', { message: `Do you want to pay ${amount} to ${senderID}?`, confirmText: 'Pay' }).then(confirmation => {
if (confirmation) {
User.sendToken(senderID, amount, "|" + remark).then(txid => {
console.warn(`Sent ${amount} to ${senderID}`, txid);
notify(`Sent ${formatAmount(amount)} to ${getFloIdTitle(senderID)}. It may take a few mins to reflect in their wallet`, 'success');
User.decideRequest(request, 'PAID: ' + txid)
User.decideRequest(User.moneyRequests[reqID], 'PAID: ' + txid)
.then(result => console.log(result))
.catch(error => console.error(error))
}).catch(error => console.error(error));
@ -498,11 +498,14 @@ const render = {
return clone;
},
transactionMessage(details) {
const { tokenAmount, time, sender, receiver } = tokenAPI.util.parseTxData(details)
const { tokenAmount, time, sender, receiver, flodata } = tokenAPI.util.parseTxData(details)
let messageType = sender === receiver ? 'self' : sender === myFloID ? 'sent' : 'received';
const clone = getRef('transaction_message_template').content.cloneNode(true).firstElementChild;
clone.classList.add(messageType);
clone.querySelector('.transaction-message__amount').textContent = formatAmount(tokenAmount);
if (flodata.split('|')[1]) {
clone.querySelector('.transaction-message__remark').textContent = flodata.split('|')[1];
}
clone.querySelector('.transaction-message__time').textContent = getFormattedTime(time * 1000);
return clone;
},