Beautify alerts

This commit is contained in:
viktor 2018-02-23 16:13:37 +03:00
parent 968c16685a
commit adca406d00
2 changed files with 11 additions and 9 deletions

View File

@ -13,7 +13,7 @@ import Loading from './Loading';
function generateElement(msg){
let errorNode = document.createElement("div");
errorNode.innerHTML = `<div>
errorNode.innerHTML = `<div style="line-height: 1.6;">
${msg}
</div>`;
return errorNode;
@ -102,9 +102,11 @@ class App extends Component {
console.log(isValid);
if(Number(isValid) !== 1){
this.setState({loading:false});
const invalidKeyMsg = `The key is not valid initial Key!<br/>
Please make sure you have loaded correct initial key in metamask.<br/>
Your current selected key is ${initialKey}`
const invalidKeyMsg = `The key is invalid initial Key<br/>
or you're connect to incorrect chain!<br/>
Please make sure you have loaded correct initial key in Metamask.<br/><br/>
<b>Your current selected key is</b> <i>${initialKey}</i><br/>
<b>Current Network ID</b> is <i>${this.state.web3Config.netId}</i>`
swal({
icon: 'error',
title: 'Error',

View File

@ -1,10 +1,10 @@
let errorMsgNoMetamaskAccount = `You haven't chosen any account in MetaMask.
Please, choose your initial key in MetaMask and reload the page.
Please choose your initial key in MetaMask and reload the page.
Check POA Network <a href='https://github.com/poanetwork/wiki' target='blank'>wiki</a> for more info.`;
function generateElement(msg){
let errorNode = document.createElement("div");
errorNode.innerHTML = `<div>
errorNode.innerHTML = `<div style="line-height: 1.6;">
${msg}
</div>`;
return errorNode;
@ -33,11 +33,11 @@ let getWeb3 = () => {
console.log('This is Core')
break
default:
netIdName = 'ERROR'
netIdName = 'Unknown'
errorMsg = `You aren't connected to POA Network.
Please, switch on POA plugin and refresh the page.
Please switch on Metamask and refresh the page.
Check POA Network <a href='https://github.com/poanetwork/wiki' target='blank'>wiki</a> for more info.
Current Network Id: ${netId}`
<b>Current Network ID</b> is <i>${netId}</i>`
console.log('This is an unknown network.', netId)
}