Skip to content

Commit

Permalink
Merge branch 'razi-jafari' of github.com:genzstaking/dashboard into r…
Browse files Browse the repository at this point in the history
…azi-jafari
  • Loading branch information
razi jafari committed Dec 15, 2022
2 parents 85978c5 + 3f87ef9 commit 95bc648
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/components/Topbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Web3 from "web3";

export class Topbar extends Component {

static template = xml`
static template = xml`
<nav class="navbar justify-content-between navbar-expand navbar-light bg-white topbar mb-4 static-top shadow">
<!-- -->
Expand Down Expand Up @@ -64,20 +64,18 @@ export class Topbar extends Component {
</div>
`;

connectToMetamask(){
// const Web3 = require("web3");
const ethEnabled = async () => {
connectToMetamask() {
if (window.ethereum) {
await window.ethereum.request({method: 'eth_requestAccounts'});
window.web3 = new Web3(window.ethereum);
return true;
}
return false;
window.ethereum.request({ method: 'eth_requestAccounts' })
.then(() => {
window.web3 = new Web3(window.ethereum);
return true;
});
}
};
state = useState({ text: "Owl" });
state = useState({ text: "Owl" });

update() {
this.state.text = this.state.text === "Owl" ? "World" : "Owl";
}
update() {
this.state.text = this.state.text === "Owl" ? "World" : "Owl";
}
}

0 comments on commit 95bc648

Please sign in to comment.