Commit 976149cb authored by Kegan's avatar Kegan
Browse files

added error banner and network detection.

parent 36731406
......@@ -1333,8 +1333,6 @@ blockquote {
@media screen and (min-width: 1440px) {
.notification-header {
position: static;
height: 25px;
background-color: #000;
}
.section-2 {
......@@ -1384,10 +1382,6 @@ blockquote {
color: #615e83;
font-size: 16px;
}
.notification-header {
height: 35px;
}
}
@media screen and (max-width: 991px) {
......@@ -1873,8 +1867,8 @@ blockquote {
padding: 40px 20px;
}
.section-2 {
height: 35px;
.paragraph-2 {
white-space: normal;
}
}
......
<!DOCTYPE html><!-- This site was created in Webflow. http://www.webflow.com -->
<!-- Last Published: Sun Sep 05 2021 16:30:24 GMT+0000 (Coordinated Universal Time) -->
<!-- Last Published: Mon Sep 06 2021 01:55:17 GMT+0000 (Coordinated Universal Time) -->
<html data-wf-page="6134d5b7d6b22ccf9fd8df81" data-wf-site="6134d5b6d6b22c5832d8df7c">
<head>
<meta charset="utf-8">
......@@ -31,13 +31,18 @@
</head>
<body>
<div class="page-wrapper">
<div id="header-error-notification" style="display: none !important;" class="section-2 wf-section">
<div class="notification-header">
<p id="header-error-text" class="paragraph-2">You are not connected to the Arbitrum Network!</p>
</div>
</div>
<div data-collapse="medium" data-animation="default" data-duration="400" data-w-id="58db7844-5919-d71b-dd74-2323ed8dffe9" role="banner" class="header w-nav">
<div class="container-default w-container">
<div class="w-layout-grid grid-header">
<a href="index.html" aria-current="page" class="logo-brand w-nav-brand w--current"><img src="images/logo_text.png" width="256" sizes="(max-width: 479px) 87vw, (max-width: 767px) 260px, 256px" srcset="images/logo_text-p-500.png 500w, images/logo_text-p-800.png 800w, images/logo_text.png 1536w" alt="" class="header-logo"></a>
<div id="w-node-_46da189b-bbb8-bef4-dcee-3a432b15a416-ed8dffe9">
<a data-w-id="ea485132-27e6-b439-c7af-d8391815e2d2" href="#" target="_blank" id="connect-wallet-btn" class="button-primary button-header w-inline-block">
<div id="connect-wallet-btn-text">Connect Wallet</div>
<a id="connect-wallet-btn" data-w-id="ea485132-27e6-b439-c7af-d8391815e2d2" href="#" target="_blank" class="button-primary button-header w-inline-block">
<div id="connect-wallet-btn-text" class="text-block">Connect Wallet</div>
</a>
</div>
</div>
......@@ -488,10 +493,14 @@
<script src="js/webflow.js" type="text/javascript"></script>
<!-- [if lte IE 9]><script src="https://cdnjs.cloudflare.com/ajax/libs/placeholders/3.0.2/placeholders.min.js"></script><![endif] -->
<script type="module">
import { ethers } from "./js/ethers.js";
import infura from "./js/infura.js";
const error_banner = document.getElementById('header-error-notification');
const error_text = document.getElementById('header-error-text');
const connect_txt = document.getElementById('connect-wallet-btn-text');
const connect_btn = document.getElementById('connect-wallet-btn');
const is_web3 = (window.ethereum != undefined);
......@@ -627,8 +636,15 @@
const GetENSName = (address) => {
let temp_provider = new ethers.providers.JsonRpcProvider(infura.getEthMainnet());
return temp_provider.lookupAddress(address);
}
};
const HideErrorBanner = () => {
error_banner.style.display = "none !important";
};
const ShowErrorBanner = (text) => {
error_text.innerHTML = text;
error_banner.style.display = "block";
};
if(await IsWalletConnected()) OnWalletLinked();
......@@ -636,10 +652,9 @@
if(!await IsOnArbitrum())
{
ShowErrorBanner("You are not connected to the <a href=\"https://arbitrum.io/\" target=\"_blank\">Arbitrum</a> Network!");
}
</script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment