()
- // todo: remove this menu active track
- if (router.pathname == "/create") {
- if (typeof document !== "undefined") {
- const els = document.getElementsByClassName("_nav")
- Array.prototype.forEach.call(els, function (el) {
- el.classList.remove("current")
- })
- document.getElementById("_create")?.classList?.add("current")
- }
- }
-
useEffect(() => {
if (typeof window !== "undefined") {
const account = localStorage.getItem("ethAccount")
diff --git a/pages/index.js b/pages/index.js
index 8090513..604f2cc 100644
--- a/pages/index.js
+++ b/pages/index.js
@@ -1,7 +1,6 @@
import { ethers } from "ethers"
import { useEffect, useState } from "react"
import axios from "axios"
-import { useRouter } from "next/router"
import { nftaddress, nftmarketaddress } from "../config"
@@ -12,17 +11,6 @@ let provider
export default function Home() {
const [nfts, setNfts] = useState([])
- const router = useRouter()
- console.log(router) // pathname: '/', route: '/', asPath: '/'
- if (router.pathname == "/") {
- if (typeof document !== "undefined") {
- var els = document.getElementsByClassName("_nav")
- Array.prototype.forEach.call(els, function (el) {
- el.classList.remove("current")
- })
- document.getElementById("_home").classList.add("current")
- }
- }
return (
diff --git a/pages/my-collections.js b/pages/my-collections.js
index 8f7ed78..9a35a5e 100644
--- a/pages/my-collections.js
+++ b/pages/my-collections.js
@@ -2,7 +2,6 @@ import { ethers } from "ethers"
import { useEffect, useState } from "react"
import axios from "axios"
import Web3Modal from "web3modal"
-import { useRouter } from "next/router"
import { nftmarketaddress, nftaddress } from "../config"
import Market from "../artifacts/contracts/Market.sol/NFTMarket.json"
@@ -12,18 +11,6 @@ export default function MyAssets() {
const [nfts, setNfts] = useState([])
const [loadingState, setLoadingState] = useState("not-loaded")
- const router = useRouter()
- console.log(router)
- if (router.pathname == "/my-collections") {
- if (typeof document !== "undefined") {
- var els = document.getElementsByClassName("_nav")
- Array.prototype.forEach.call(els, function (el) {
- el.classList.remove("current")
- })
- document.getElementById("_my_collections").classList.add("current")
- }
- }
-
useEffect(() => {
loadNFTs()
}, [])
diff --git a/pages/my-nfts.js b/pages/my-nfts.js
index 7c26dfd..312fc02 100644
--- a/pages/my-nfts.js
+++ b/pages/my-nfts.js
@@ -2,7 +2,6 @@ import { ethers } from "ethers"
import { useEffect, useState } from "react"
import axios from "axios"
import Web3Modal from "web3modal"
-import { useRouter } from "next/router"
import { nftmarketaddress, nftaddress } from "../config"
import Market from "../artifacts/contracts/Market.sol/NFTMarket.json"
@@ -13,18 +12,6 @@ export default function CreatorDashboard() {
const [sold, setSold] = useState([])
const [loadingState, setLoadingState] = useState("not-loaded")
- const router = useRouter()
- console.log(router)
- if (router.pathname == "/my-nfts") {
- if (typeof document !== "undefined") {
- var els = document.getElementsByClassName("_nav")
- Array.prototype.forEach.call(els, function (el) {
- el.classList.remove("current")
- })
- document.getElementById("_my_nfts").classList.add("current")
- }
- }
-
useEffect(() => {
loadNFTs()
}, [])
diff --git a/pages/nft-market.js b/pages/nft-market.js
index 207912e..1a964bb 100644
--- a/pages/nft-market.js
+++ b/pages/nft-market.js
@@ -2,7 +2,6 @@ import { ethers } from "ethers"
import { useEffect, useState } from "react"
import axios from "axios"
import Web3Modal from "web3modal"
-import { useRouter } from "next/router"
import { nftaddress, nftmarketaddress } from "../config"
@@ -13,18 +12,6 @@ export default function Home() {
const [nfts, setNfts] = useState([])
const [loadingState, setLoadingState] = useState("not-loaded")
- const router = useRouter()
- console.log(router)
- if (router.pathname == "/nft-market") {
- if (typeof document !== "undefined") {
- var els = document.getElementsByClassName("_nav")
- Array.prototype.forEach.call(els, function (el) {
- el.classList.remove("current")
- })
- document.getElementById("_nft_market").classList.add("current")
- }
- }
-
useEffect(() => {
loadNFTs()
}, [])