From 7ad4384d3fb76a5ec4440625bdadf0481e6674db Mon Sep 17 00:00:00 2001 From: Rashmi V Abbigeri Date: Mon, 6 Nov 2023 00:52:23 +0530 Subject: [PATCH 1/3] fixing display and upgrade wagmi --- daostar-website/package.json | 8 +- daostar-website/src/App.js | 373 +++++++++--------- .../src/components/ExplorePage/ExplorePage.js | 16 + .../ExplorePage/queries/registrations.js | 28 +- .../src/components/Homepage/Eye/Box.js | 4 +- .../RegistrationReceived.js | 3 + .../DisplayRegistration.js | 4 + daostar-website/src/index.js | 2 +- 8 files changed, 247 insertions(+), 191 deletions(-) diff --git a/daostar-website/package.json b/daostar-website/package.json index 5e1e9991..84980ba0 100644 --- a/daostar-website/package.json +++ b/daostar-website/package.json @@ -33,7 +33,7 @@ "axios-hooks": "^4.0.0", "babel-jest": "^29.4.1", "caip": "^1.1.0", - "connectkit": "^1.1.2", + "connectkit": "^1.5.3", "ethers": "^5.7.2", "graphql": "^15.0.0", "jest": "^29.4.1", @@ -49,13 +49,13 @@ "typescript": "^5.2.2", "typewriter-effect": "^2.19.0", "validator": "^13.7.0", - "wagmi": "^0.12.19", + "wagmi": "^1.4.5", "web-vitals": "^2.1.4", "web3": "^1.8.1" }, "scripts": { - "start": "PORT=8000 REACT_APP_API_URL=http://localhost:8080/https://api.daostar.org react-scripts start", - "build": "REACT_APP_API_URL=https://api.daostar.org react-scripts build", + "start": "react-scripts start", + "build": "react-scripts build", "predeploy": "REACT_APP_API_URL=https://api.daostar.org npm run build", "deploy": "REACT_APP_API_URL=https://api.daostar.org gh-pages -d build", "test": "react-scripts test", diff --git a/daostar-website/src/App.js b/daostar-website/src/App.js index cdf8b9d6..0a1b115e 100644 --- a/daostar-website/src/App.js +++ b/daostar-website/src/App.js @@ -4,8 +4,8 @@ import Register from "./components/Register/Register"; import TopNavigation from "./components/TopNavigation/TopNavigation"; import RegistrationPage from "./components/RegistrationPage/RegistrationPage"; import ExplorePage from "./components/ExplorePage/ExplorePage"; -import { WagmiConfig, createClient } from "wagmi"; -import { ConnectKitProvider, getDefaultClient } from "connectkit"; +import { WagmiConfig, createConfig } from "wagmi"; +import { ConnectKitProvider, getDefaultConfig } from "connectkit"; import { useQuery } from "@apollo/client"; import registrationIdsToFilter from "./components/FilterRegistrations/Filter_Registrations_By_Id"; @@ -16,195 +16,200 @@ import "./bp4-theme.css"; import Eye from "./components/Homepage/Eye/Eye"; const alchemyId = process.env.ALCHEMY_ID; +const walletConnectId = process.env.WALLETCONNECT_ID; -const client = createClient( - getDefaultClient({ - appName: "DAOstar", - alchemyId, - }) +const client = createConfig( + getDefaultConfig({ + appName: "DAOstar", + alchemyId, + walletConnectId, + }) ); function App() { - const { - loading, - error, - data: mainnetData, - } = useQuery(queries.REGISTRATIONS, { - context: { apiName: "mainnet" }, - variables: { id: "mainnet" }, - }); - const mainnetv0Res = useQuery(queries.REGISTRATIONS, { - context: { apiName: "mainnetOld" }, - variables: { id: "mainnetOld" }, - }); - const goerliRes = useQuery(queries.REGISTRATIONS, { - context: { apiName: "goerli" }, - variables: { id: "goerli" }, - }); - const optimismGoerliRes = useQuery(queries.REGISTRATIONS, { - context: { apiName: "optimismGoerli" }, - variables: { id: "optimism-goerli" }, - }); - const arbitrumGoerliRes = useQuery(queries.REGISTRATIONS, { - context: { apiName: "arbitrumGoerli" }, - variables: { id: "arbitrum-goerli" }, - }); - const chapelRes = useQuery(queries.REGISTRATIONS, { - context: { apiName: "chapel" }, - variables: { id: "chapel" }, - }); - - const optimismRes = useQuery(queries.REGISTRATIONS, { - context: { apiName: "optimism" }, - variables: { id: "optimism" }, - }); - const { - loading: mainnetv0Loading, - error: mainnetv0Error, - data: mainnetv0Data, - } = mainnetv0Res; - const { - loading: optimismLoading, - error: optimismError, - data: optimismData, - } = optimismRes; - - const { - loading: optimismGoerliLoading, - error: optimismGoerliError, - data: optimismGoerliData, - } = optimismGoerliRes; - const { - loading: arbitrumGoerliLoading, - error: arbitrumGoerliError, - data: arbitrumGoerliData, - } = arbitrumGoerliRes; - const { - loading: chapelLoading, - error: chapelError, - data: chapelData, - } = chapelRes; - const { - loading: goerliLoading, - error: goerliError, - data: goerliData, - } = goerliRes; - const gnosisRes = useQuery(queries.REGISTRATIONS, { - context: { apiName: "gnosis" }, - variables: { id: "gnosis" }, - }); - const { - loading: gnosisLoading, - error: gnosisError, - data: gnosisData, - } = gnosisRes; - console.log({ mainnetData, goerliData, gnosisData, optimismGoerliData, arbitrumGoerliData, chapelData, mainnetv0Data }); - - if (error || goerliError || optimismGoerliError || arbitrumGoerliError || chapelError || optimismError || mainnetv0Error ) { - console.error("Mainnet Error "+ error); - console.error("Mainnet v0 Error "+ mainnetv0Error); - console.error("Goerli Error "+ goerliError); - console.error("Optimism Goerli Error "+ optimismGoerliError); - console.error("Arbitrum Goerli Error" + arbitrumGoerliError); - console.error("Chapel Error" + chapelError); - console.error("Optimism Error" + optimismError) - }; - if (loading || mainnetv0Loading || goerliLoading || gnosisLoading || optimismGoerliLoading || arbitrumGoerliLoading || chapelLoading || optimismLoading) return "loading..."; - const mainnetRegistrations = - mainnetData?.registrationNetwork?.registrations || []; - const mainnetv0Registrations = - mainnetv0Data?.registrationNetwork?.registrations || []; - const goerliRegistrations = - goerliData?.registrationNetwork?.registrations || []; - const optimismGoerliRegistrations = - optimismGoerliData?.registrationNetwork?.registrations || []; - const optimismRegistrations = - optimismData?.registrationNetwork?.registrations || []; - const gnosisRegistrations = - gnosisData?.registrationNetwork?.registrations || []; - const arbitrumGoerliRegistrations = - arbitrumGoerliData?.registrationNetwork?.registrations || []; - const chapelRegistrations = - chapelData?.registrationNetwork?.registrations || []; - const allRegistrationInstances = mainnetRegistrations.concat( - mainnetv0Registrations, - goerliRegistrations, - gnosisRegistrations, - optimismGoerliRegistrations, - arbitrumGoerliRegistrations, - chapelRegistrations, - optimismRegistrations - ); - - const registrationInstances = allRegistrationInstances.filter((instance) => - !registrationIdsToFilter.includes(instance.id) - ) - - - - return ( - - -
- - {/* */} - - - } /> - } /> - } - /> - - } - /> - - } - /> - { - window.location.href = - "https://github.com/metagov/daostar/discussions/41"; - return null; - }} - /> - -
-
-
- ); + const { + loading, + error, + data: mainnetData, + } = useQuery(queries.REGISTRATIONS, { + context: { apiName: "mainnet" }, + variables: { id: "mainnet" }, + }); + + + + const goerliRes = useQuery(queries.REGISTRATIONS, { + context: { apiName: "goerli" }, + variables: { id: "goerli" }, + }); + const optimismGoerliRes = useQuery(queries.REGISTRATIONS, { + context: { apiName: "optimismGoerli" }, + variables: { id: "optimism-goerli" }, + }); + const arbitrumGoerliRes = useQuery(queries.REGISTRATIONS, { + context: { apiName: "arbitrumGoerli" }, + variables: { id: "arbitrum-goerli" }, + }); + const chapelRes = useQuery(queries.REGISTRATIONS, { + context: { apiName: "chapel" }, + variables: { id: "chapel" }, + }); + + const optimismRes = useQuery(queries.REGISTRATIONS, { + context: { apiName: "optimism" }, + variables: { id: "optimism" }, + }); + + const { + loading: optimismLoading, + error: optimismError, + data: optimismData, + } = optimismRes; + + const { + loading: optimismGoerliLoading, + error: optimismGoerliError, + data: optimismGoerliData, + } = optimismGoerliRes; + const { + loading: arbitrumGoerliLoading, + error: arbitrumGoerliError, + data: arbitrumGoerliData, + } = arbitrumGoerliRes; + const { + loading: chapelLoading, + error: chapelError, + data: chapelData, + } = chapelRes; + const { + loading: goerliLoading, + error: goerliError, + data: goerliData, + } = goerliRes; + const gnosisRes = useQuery(queries.REGISTRATIONS, { + context: { apiName: "gnosis" }, + variables: { id: "gnosis" }, + }); + const { + loading: gnosisLoading, + error: gnosisError, + data: gnosisData, + } = gnosisRes; + console.log({ + mainnetData, + goerliData, + gnosisData, + optimismGoerliData, + arbitrumGoerliData, + chapelData, + }); + + + if ( + error || + goerliError || + optimismGoerliError || + arbitrumGoerliError || + chapelError || + optimismError + ) { + console.error("Mainnet Error " + error); + console.error("Goerli Error " + goerliError); + console.error("Optimism Goerli Error " + optimismGoerliError); + console.error("Arbitrum Goerli Error" + arbitrumGoerliError); + console.error("Chapel Error" + chapelError); + console.error("Optimism Error" + optimismError); + } + if ( + loading || + goerliLoading || + gnosisLoading || + optimismGoerliLoading || + arbitrumGoerliLoading || + chapelLoading || + optimismLoading + ) + return "loading..."; + const mainnetRegistrations = + mainnetData?.registrationNetwork?.registrations || []; + //const mainnetv0Registrations = mainnetv0Data?.registrationNetwork?.registrations || []; + const goerliRegistrations = + goerliData?.registrationNetwork?.registrations || []; + const optimismGoerliRegistrations = + optimismGoerliData?.registrationNetwork?.registrations || []; + const optimismRegistrations = + optimismData?.registrationNetwork?.registrations || []; + const gnosisRegistrations = + gnosisData?.registrationNetwork?.registrations || []; + const arbitrumGoerliRegistrations = + arbitrumGoerliData?.registrationNetwork?.registrations || []; + const chapelRegistrations = + chapelData?.registrationNetwork?.registrations || []; + const allRegistrationInstances = mainnetRegistrations.concat( + goerliRegistrations, + gnosisRegistrations, + optimismGoerliRegistrations, + arbitrumGoerliRegistrations, + chapelRegistrations, + optimismRegistrations + ); + + const registrationInstances = allRegistrationInstances.filter( + (instance) => !registrationIdsToFilter.includes(instance.id) + ); + + return ( + + +
+ + {/* */} + + + } /> + } /> + } /> + + } + /> + + } + /> + { + window.location.href = + "https://github.com/metagov/daostar/discussions/41"; + return null; + }} + /> + +
+
+
+ ); } if (window.location.path === "creative-universe") { - window.location = "https://github.com/metagov/daostar/discussions/41"; + window.location = "https://github.com/metagov/daostar/discussions/41"; } export default App; diff --git a/daostar-website/src/components/ExplorePage/ExplorePage.js b/daostar-website/src/components/ExplorePage/ExplorePage.js index 3407c59e..6288dbdc 100644 --- a/daostar-website/src/components/ExplorePage/ExplorePage.js +++ b/daostar-website/src/components/ExplorePage/ExplorePage.js @@ -1,5 +1,8 @@ import React, { useEffect, useState } from 'react' import RegistrationCard from '../RegistrationCard/RegistrationCard' +import { useQuery } from "@apollo/client"; +import queries from "../ExplorePage/queries/registrations"; + import './ExplorePage.css' import { InputGroup } from '@blueprintjs/core' @@ -17,8 +20,21 @@ const ExplorePage = ({registrationInstances}) => { const [filterVal, setFilterVal] = useState('') const onChangeFilter = (e) => setFilterVal(e.target.value) + const { + mainnetv0Loading, + mainnetv0Error, + mainnetv0Data, + } = useQuery(queries.REGISTRATIONSOLD, { + context: { apiName: "mainnet" }, + variables: { id: "mainnet" }, + }); + console.log(mainnetv0Data ); + console.error("Mainnet v0 Error " + mainnetv0Error); + const mainnetv0Registrations = mainnetv0Data?.registrationNetwork?.registrations || []; + const daoCards = registrationInstances + .concat(mainnetv0Registrations) .filter((reg) => filterRegistrations(reg, filterVal)) .map((registration, i) => { return diff --git a/daostar-website/src/components/ExplorePage/queries/registrations.js b/daostar-website/src/components/ExplorePage/queries/registrations.js index 28c52176..3b754359 100644 --- a/daostar-website/src/components/ExplorePage/queries/registrations.js +++ b/daostar-website/src/components/ExplorePage/queries/registrations.js @@ -26,6 +26,32 @@ const REGISTRATIONS = gql` } ` +const REGISTRATIONSOLD = gql` + query Registrations($id: String) @api(name: mainnetOld) { + registrationNetwork(id: $id) { + id + registrations { + id + daoAddress + daoURI + daoName + daoDescription + proposalsURI + membersURI + issuersURI + governanceURI + activityLogURI + managerAddress + contractsRegistryURI + registrationAddress + registrationNetwork { + id + } + } + } + } +` + const REGISTRATION = gql` query Registration($id: String) @api(contextKey: "apiName") { registrationInstance(id: $id) { @@ -49,4 +75,4 @@ const REGISTRATION = gql` } ` -export default { REGISTRATIONS, REGISTRATION } +export default { REGISTRATIONS, REGISTRATION, REGISTRATIONSOLD } diff --git a/daostar-website/src/components/Homepage/Eye/Box.js b/daostar-website/src/components/Homepage/Eye/Box.js index 8b62cc81..1ab52cf9 100644 --- a/daostar-website/src/components/Homepage/Eye/Box.js +++ b/daostar-website/src/components/Homepage/Eye/Box.js @@ -9,10 +9,12 @@ export default function Box({ text, ...props }) { const [hovered, setHovered] = useState(false) useFrame(({ mouse, viewport }) => { + if (viewport.width && viewport.height) { + const x = (mouse.x * viewport.width) / 2.5 const y = (mouse.y * viewport.height) / 2.5 ref.current.lookAt(x, y, 1) - ref.current.material.color.lerp(hovered ? lime : black, 0.05) + ref.current.material.color.lerp(hovered ? lime : black, 0.05) } }) return ( diff --git a/daostar-website/src/components/Register/RegistrationReceived/RegistrationReceived.js b/daostar-website/src/components/Register/RegistrationReceived/RegistrationReceived.js index b2681ed7..1fc5bbf4 100644 --- a/daostar-website/src/components/Register/RegistrationReceived/RegistrationReceived.js +++ b/daostar-website/src/components/Register/RegistrationReceived/RegistrationReceived.js @@ -50,6 +50,9 @@ const RegistrationReceived = ({ if(daoContractNetwork === 'arbitrum-goerli'){ daoContractNetwork = 'arbitrumGoerli'; } + if(daoContractNetwork === 'mainnet-Old'){ + daoContractNetwork = 'mainnet'; + } return ( diff --git a/daostar-website/src/components/RegistrationCard/DisplayRegistration/DisplayRegistration.js b/daostar-website/src/components/RegistrationCard/DisplayRegistration/DisplayRegistration.js index 8cedfcac..3bca6dec 100644 --- a/daostar-website/src/components/RegistrationCard/DisplayRegistration/DisplayRegistration.js +++ b/daostar-website/src/components/RegistrationCard/DisplayRegistration/DisplayRegistration.js @@ -39,6 +39,10 @@ const DisplayRegistration = ({ network = 'arbitrumGoerli'; } + if(network === 'mainnet-Old'){ + network = 'mainnet'; + } + return ( {standalone === true ? ( diff --git a/daostar-website/src/index.js b/daostar-website/src/index.js index 0fd19279..b1fa275e 100644 --- a/daostar-website/src/index.js +++ b/daostar-website/src/index.js @@ -38,7 +38,7 @@ const client = new ApolloClient({ mainnetOld: `https://api.thegraph.com/subgraphs/name/rashmi-278/daostar-ethereum-mainnet-v0` }, - // defaultEndpoint: 'https://api.thegraph.com/subgraphs/name/ipatka/daostar', + //defaultEndpoint: 'https://api.thegraph.com/subgraphs/name/ipatka/daostar', httpSuffix: "", createHttpLink: createHttpLink, }), From 2953a41b03487b5b679ba54c87c743aff09aefe3 Mon Sep 17 00:00:00 2001 From: Rashmi V Abbigeri Date: Mon, 6 Nov 2023 03:23:05 +0530 Subject: [PATCH 2/3] 'solved' --- daostar-website/public/index.html | 7 ++- daostar-website/src/App.js | 56 +++++++++++++------ .../src/components/ExplorePage/ExplorePage.js | 14 ----- .../ExplorePage/queries/registrations.js | 2 +- daostar-website/src/index.js | 5 +- 5 files changed, 51 insertions(+), 33 deletions(-) diff --git a/daostar-website/public/index.html b/daostar-website/public/index.html index c75b2f6a..139ff31a 100644 --- a/daostar-website/public/index.html +++ b/daostar-website/public/index.html @@ -45,10 +45,15 @@ --> diff --git a/daostar-website/src/App.js b/daostar-website/src/App.js index 0a1b115e..1fd6912c 100644 --- a/daostar-website/src/App.js +++ b/daostar-website/src/App.js @@ -8,13 +8,21 @@ import { WagmiConfig, createConfig } from "wagmi"; import { ConnectKitProvider, getDefaultConfig } from "connectkit"; import { useQuery } from "@apollo/client"; import registrationIdsToFilter from "./components/FilterRegistrations/Filter_Registrations_By_Id"; +import { ApolloClient, InMemoryCache } from "@apollo/client"; +import { createHttpLink } from "apollo-link-http"; import queries from "./components/ExplorePage/queries/registrations"; - import "./App.css"; import "./bp4-theme.css"; import Eye from "./components/Homepage/Eye/Eye"; +const mainnetOldClient = new ApolloClient({ + link: createHttpLink({ + uri: "https://api.thegraph.com/subgraphs/name/rashmi-278/daostar-ethereum-mainnet-v0", + }), + cache: new InMemoryCache(), +}); + const alchemyId = process.env.ALCHEMY_ID; const walletConnectId = process.env.WALLETCONNECT_ID; @@ -36,7 +44,15 @@ function App() { variables: { id: "mainnet" }, }); - + const { + loading: mainnetv0Loading, + error: mainnetv0Error, + data: mainnetv0Data, + } = useQuery(queries.REGISTRATIONSOLD, { + client: mainnetOldClient, + context: { apiName: "mainnet" }, + variables: { id: "mainnet" }, + }); const goerliRes = useQuery(queries.REGISTRATIONS, { context: { apiName: "goerli" }, @@ -60,6 +76,16 @@ function App() { variables: { id: "optimism" }, }); + const { + loading: goerliLoading, + error: goerliError, + data: goerliData, + } = goerliRes; + + const gnosisRes = useQuery(queries.REGISTRATIONS, { + context: { apiName: "gnosis" }, + variables: { id: "gnosis" }, + }); const { loading: optimismLoading, error: optimismError, @@ -81,22 +107,16 @@ function App() { error: chapelError, data: chapelData, } = chapelRes; - const { - loading: goerliLoading, - error: goerliError, - data: goerliData, - } = goerliRes; - const gnosisRes = useQuery(queries.REGISTRATIONS, { - context: { apiName: "gnosis" }, - variables: { id: "gnosis" }, - }); + const { loading: gnosisLoading, error: gnosisError, data: gnosisData, } = gnosisRes; + console.log({ mainnetData, + mainnetv0Data, goerliData, gnosisData, optimismGoerliData, @@ -104,16 +124,17 @@ function App() { chapelData, }); - if ( error || goerliError || optimismGoerliError || arbitrumGoerliError || chapelError || - optimismError + optimismError || + mainnetv0Error ) { console.error("Mainnet Error " + error); + console.error("Mainnet v0 Error " + mainnetv0Error); console.error("Goerli Error " + goerliError); console.error("Optimism Goerli Error " + optimismGoerliError); console.error("Arbitrum Goerli Error" + arbitrumGoerliError); @@ -127,12 +148,14 @@ function App() { optimismGoerliLoading || arbitrumGoerliLoading || chapelLoading || - optimismLoading + optimismLoading || + mainnetv0Loading ) return "loading..."; const mainnetRegistrations = mainnetData?.registrationNetwork?.registrations || []; - //const mainnetv0Registrations = mainnetv0Data?.registrationNetwork?.registrations || []; + const mainnetv0Registrations = + mainnetv0Data?.registrationNetwork?.registrations || []; const goerliRegistrations = goerliData?.registrationNetwork?.registrations || []; const optimismGoerliRegistrations = @@ -146,6 +169,7 @@ function App() { const chapelRegistrations = chapelData?.registrationNetwork?.registrations || []; const allRegistrationInstances = mainnetRegistrations.concat( + mainnetv0Registrations, goerliRegistrations, gnosisRegistrations, optimismGoerliRegistrations, @@ -212,4 +236,4 @@ if (window.location.path === "creative-universe") { window.location = "https://github.com/metagov/daostar/discussions/41"; } -export default App; +export default App; \ No newline at end of file diff --git a/daostar-website/src/components/ExplorePage/ExplorePage.js b/daostar-website/src/components/ExplorePage/ExplorePage.js index 6288dbdc..188e6f2d 100644 --- a/daostar-website/src/components/ExplorePage/ExplorePage.js +++ b/daostar-website/src/components/ExplorePage/ExplorePage.js @@ -20,21 +20,7 @@ const ExplorePage = ({registrationInstances}) => { const [filterVal, setFilterVal] = useState('') const onChangeFilter = (e) => setFilterVal(e.target.value) - const { - mainnetv0Loading, - mainnetv0Error, - mainnetv0Data, - } = useQuery(queries.REGISTRATIONSOLD, { - context: { apiName: "mainnet" }, - variables: { id: "mainnet" }, - }); - console.log(mainnetv0Data ); - console.error("Mainnet v0 Error " + mainnetv0Error); - const mainnetv0Registrations = mainnetv0Data?.registrationNetwork?.registrations || []; - - const daoCards = registrationInstances - .concat(mainnetv0Registrations) .filter((reg) => filterRegistrations(reg, filterVal)) .map((registration, i) => { return diff --git a/daostar-website/src/components/ExplorePage/queries/registrations.js b/daostar-website/src/components/ExplorePage/queries/registrations.js index 3b754359..a5f907af 100644 --- a/daostar-website/src/components/ExplorePage/queries/registrations.js +++ b/daostar-website/src/components/ExplorePage/queries/registrations.js @@ -27,7 +27,7 @@ const REGISTRATIONS = gql` ` const REGISTRATIONSOLD = gql` - query Registrations($id: String) @api(name: mainnetOld) { + query Registrations($id: String) @api(contextKey: "apiName") { registrationNetwork(id: $id) { id registrations { diff --git a/daostar-website/src/index.js b/daostar-website/src/index.js index b1fa275e..0bbb96ec 100644 --- a/daostar-website/src/index.js +++ b/daostar-website/src/index.js @@ -15,15 +15,18 @@ import { import { createHttpLink } from "apollo-link-http"; import { MultiAPILink } from "@habx/apollo-multi-endpoint-link"; import "./index.css"; +import { setupErrorHandling } from "./errorHandler.js"; const root = ReactDOM.createRoot(document.getElementById("root")); +setupErrorHandling(); FocusStyleManager.onlyShowFocusOnTabs(); function getLibrary(provider) { return new Web3Provider(provider); } + const client = new ApolloClient({ link: ApolloLink.from([ new MultiAPILink({ @@ -35,7 +38,6 @@ const client = new ApolloClient({ arbitrumGoerli: `https://api.thegraph.com/subgraphs/name/rashmi-278/daostar-arbitrum-goerli`, chapel:`https://api.thegraph.com/subgraphs/name/rashmi-278/daostar-bnb-bruno`, optimism: `https://api.thegraph.com/subgraphs/name/rashmi-278/daostar-optimism`, - mainnetOld: `https://api.thegraph.com/subgraphs/name/rashmi-278/daostar-ethereum-mainnet-v0` }, //defaultEndpoint: 'https://api.thegraph.com/subgraphs/name/ipatka/daostar', @@ -46,6 +48,7 @@ const client = new ApolloClient({ cache: new InMemoryCache({}), }); + root.render( From 094de9851e83b22ef0242421e97a3bc69dbca8f9 Mon Sep 17 00:00:00 2001 From: Rashmi V Abbigeri Date: Mon, 6 Nov 2023 03:39:46 +0530 Subject: [PATCH 3/3] 'cleanup' --- .../src/components/ExplorePage/ExplorePage.js | 3 --- .../src/components/ExplorePage/queries/registrations.js | 3 ++- .../RegistrationReceived/RegistrationReceived.js | 3 --- .../DisplayRegistration/DisplayRegistration.js | 4 ---- daostar-website/src/errorHandler.js | 9 +++++++++ 5 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 daostar-website/src/errorHandler.js diff --git a/daostar-website/src/components/ExplorePage/ExplorePage.js b/daostar-website/src/components/ExplorePage/ExplorePage.js index 188e6f2d..f2509f2e 100644 --- a/daostar-website/src/components/ExplorePage/ExplorePage.js +++ b/daostar-website/src/components/ExplorePage/ExplorePage.js @@ -1,8 +1,5 @@ import React, { useEffect, useState } from 'react' import RegistrationCard from '../RegistrationCard/RegistrationCard' -import { useQuery } from "@apollo/client"; -import queries from "../ExplorePage/queries/registrations"; - import './ExplorePage.css' import { InputGroup } from '@blueprintjs/core' diff --git a/daostar-website/src/components/ExplorePage/queries/registrations.js b/daostar-website/src/components/ExplorePage/queries/registrations.js index a5f907af..f06f71f8 100644 --- a/daostar-website/src/components/ExplorePage/queries/registrations.js +++ b/daostar-website/src/components/ExplorePage/queries/registrations.js @@ -25,7 +25,8 @@ const REGISTRATIONS = gql` } } ` - +// DO NOT UPDATE THIS QUERY, this query is specifically for v0 Subgraph Indexer +// We don't want to keep having to update the schema of old indexers as we add new fields const REGISTRATIONSOLD = gql` query Registrations($id: String) @api(contextKey: "apiName") { registrationNetwork(id: $id) { diff --git a/daostar-website/src/components/Register/RegistrationReceived/RegistrationReceived.js b/daostar-website/src/components/Register/RegistrationReceived/RegistrationReceived.js index 1fc5bbf4..b2681ed7 100644 --- a/daostar-website/src/components/Register/RegistrationReceived/RegistrationReceived.js +++ b/daostar-website/src/components/Register/RegistrationReceived/RegistrationReceived.js @@ -50,9 +50,6 @@ const RegistrationReceived = ({ if(daoContractNetwork === 'arbitrum-goerli'){ daoContractNetwork = 'arbitrumGoerli'; } - if(daoContractNetwork === 'mainnet-Old'){ - daoContractNetwork = 'mainnet'; - } return ( diff --git a/daostar-website/src/components/RegistrationCard/DisplayRegistration/DisplayRegistration.js b/daostar-website/src/components/RegistrationCard/DisplayRegistration/DisplayRegistration.js index 3bca6dec..8cedfcac 100644 --- a/daostar-website/src/components/RegistrationCard/DisplayRegistration/DisplayRegistration.js +++ b/daostar-website/src/components/RegistrationCard/DisplayRegistration/DisplayRegistration.js @@ -39,10 +39,6 @@ const DisplayRegistration = ({ network = 'arbitrumGoerli'; } - if(network === 'mainnet-Old'){ - network = 'mainnet'; - } - return ( {standalone === true ? ( diff --git a/daostar-website/src/errorHandler.js b/daostar-website/src/errorHandler.js new file mode 100644 index 00000000..a8eda249 --- /dev/null +++ b/daostar-website/src/errorHandler.js @@ -0,0 +1,9 @@ +export function setupErrorHandling() { + window.onerror = function (message, source, lineno, colno, error) { + // Handle the error, log it, or send it to a reporting service. + console.error(message, source, lineno, colno, error); + // Return false to prevent the default browser error handling. + return false; + }; + } + \ No newline at end of file