Skip to content

Commit

Permalink
Merge branch 'remnynt-remnynt-patch-1' into remnynt-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
niccolopetti committed Jun 20, 2022
2 parents 3456480 + abca4e8 commit 16713c3
Show file tree
Hide file tree
Showing 6 changed files with 9,717 additions and 60 deletions.
57 changes: 56 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import "./App.css";
import Web3 from "web3";
import React, { useState } from "react";
import { createStyles, makeStyles } from "@material-ui/core/styles";
import checkMyNFTImage from "./images/checkMyNFT.png";
Expand All @@ -13,6 +14,9 @@ import ResultsSection from "./components/ResultsSection";
import FeaturedInSection from "./components/FeaturedInSection";
import WhatIsMetadataSection from "./components/WhatIsMetadataSection";
import FAQSection from "./components/FAQSection";
import {
getConnectedChainInfo
} from "./utils";

const useStyles = makeStyles((theme) =>
createStyles({
Expand Down Expand Up @@ -64,6 +68,52 @@ let defaultImgState = {
loading: false,
};


let wssOptions = {
timeout: 30000, // ms

clientConfig: {
// Useful if requests are large
maxReceivedFrameSize: 100000000, // bytes - default: 1MiB
maxReceivedMessageSize: 100000000, // bytes - default: 8MiB

// Useful to keep a connection alive
keepalive: true,
keepaliveInterval: 60000, // ms
},

// Enable auto reconnection
reconnect: {
auto: true,
delay: 5000, // ms
maxAttempts: 5,
onTimeout: false,
},
};

let web3;
let connectedChainInfo;
(() => {
if(window.ethereum)
{
connectedChainInfo = getConnectedChainInfo(window.ethereum.networkVersion)

web3 = new Web3(window.ethereum);
console.log("0")
}
else
{
connectedChainInfo = getConnectedChainInfo('1')
web3 = new Web3(
new Web3.providers.WebsocketProvider(
"wss://mainnet.infura.io/ws/v3/a30464df239144d0a8eae3f8a426d03e",
wssOptions
)
);

}
})();

function App() {
// used in hero results and modal
const classes = useStyles();
Expand Down Expand Up @@ -125,12 +175,16 @@ function App() {
setErrors,
fetchError,
setFetchError,
web3,
connectedChainInfo
}}
/>
<FeaturedInSection />
<WhatIsMetadataSection />
<HowItWorksSection />
<FAQSection />
<FAQSection componentProps={{
connectedChainInfo
}}/>
<TwitterSection />
<NFTResourcesSection />
<SupportSection />
Expand All @@ -152,6 +206,7 @@ function App() {
setNFTInfo,
setErrors,
setFetchError,
connectedChainInfo
}}
/>
</React.Fragment>
Expand Down
Loading

0 comments on commit 16713c3

Please sign in to comment.