Skip to content

Commit

Permalink
Merge pull request #33 from getsafle/bugfix-ui-overflow
Browse files Browse the repository at this point in the history
UI fix and error message added
  • Loading branch information
apoorvq authored May 2, 2023
2 parents 6eb5869 + 815c6e5 commit 9cf83e5
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 13 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,9 @@
##### Fixed token amounts overflow and USD value

* Fixed token amounts overflow and USD values

### 1.1.7 (2023-02-06)

##### UI font-sizes fix and show correct error messages

* UI font-sizes fix and show correct error messages
4 changes: 2 additions & 2 deletions lib/keyless.umd.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@getsafle/safle-keyless-js",
"version": "1.1.6",
"version": "1.1.7",
"description": "",
"engines": {
"node": ">=12.22.9"
Expand Down
10 changes: 5 additions & 5 deletions src/helpers/blockchains.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ const blockchainInfo = {
explorer: 'https://etherscan.io/tx/',
chain_name: 'ethereum',
},
3: {
name: 'Ropsten Testnet',
rpcURL: 'https://ropsten.infura.io/v3/',
explorer: 'https://ropsten.etherscan.io/tx/',
chain_name: 'ropsten',
420: {
name: 'Goerli Testnet',
rpcURL: 'https://goerli.infura.io/v3/',
explorer: 'https://goerli.etherscan.io/tx/',
chain_name: 'goerli',
},
137: {
name: 'Polygon Mainnet',
Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import config from './config/config';


const getNetworks = async () => {
const networks = await fetch( config.networks ).then(e=>e.json());
const allowedIds = [ 1, 3, 137, 80001 ];
return Object.values( networks ).reduce( (acc, e) => acc.concat( e ), [] ).filter( e=> allowedIds.indexOf( e.chainId ) != -1 );
const networks = await fetch(config.networks).then(e => e.json());
const allowedIds = [1, 420, 137, 80001];
return Object.values(networks).reduce((acc, e) => acc.concat(e), []).filter(e => allowedIds.indexOf(e.chainId) != -1);

return networks;

Expand Down
5 changes: 5 additions & 0 deletions src/scss/items/_transaction.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@

.transaction {
position: relative;

.transaction_amount {
font-size: 17px;
padding: 0px;
}
.hover-info--1 {
position: absolute;
top: 60px;
Expand Down
17 changes: 16 additions & 1 deletion src/ui/SendScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -551,14 +551,27 @@ class SendScreen extends UIScreen {
checkCanProceed() {
if (this.isToken) {
if ((parseFloat(this.balance) < parseFloat(this.feeETH)) || (parseFloat(this.tokenBalance) < parseFloat(this.tokenValue))) {
this.setProceedActive(false);
if ((parseFloat(this.balance) < parseFloat(this.feeETH))) {
this.el.querySelector('.insufficient-balance-message-div').style.display = "block"
this.el.querySelector('.insufficient-balance-message').innerHTML = 'Insufficient balance'
this.setProceedActive(false);
}
else {
this.el.querySelector('.insufficient-balance-message-div').style.display = "block"
this.el.querySelector('.insufficient-balance-message').innerHTML = 'Insufficient token balance'
this.setProceedActive(false);
}
} else {
this.el.querySelector('.insufficient-balance-message-div').style.display = "none"
this.setProceedActive(true);
}
} else {
if (parseFloat(this.balance) < (parseFloat(this.amt) + parseFloat(this.feeETH))) {
this.el.querySelector('.insufficient-balance-message-div').style.display = "block"
this.el.querySelector('.insufficient-balance-message').innerHTML = 'Insufficient balance'
this.setProceedActive(false);
} else {
this.el.querySelector('.insufficient-balance-message-div').style.display = "none"
this.setProceedActive(true);
}
}
Expand Down Expand Up @@ -644,6 +657,8 @@ class SendScreen extends UIScreen {
</div>
</div>
<div class="insufficient-balance-message-div"><p style="color: red" class="insufficient-balance-message">Insufficient balance</p></div>
<button class="btn__tp--1 confirm_btn">Confirm</button>
<button class="btn__tp--2 reject_btn">Reject</button>
<button class="btn__tp--2 c--gray open_wallet_btn">
Expand Down

0 comments on commit 9cf83e5

Please sign in to comment.