diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index c099ce4f..84964bcc 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -9,16 +9,13 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
- node-version: 16
+ node-version: 21
- uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}-${{ github.run_id }}
- run: yarn install
- run: yarn build
- - name: Generate subgraph.yaml for Goerli
- working-directory: packages/subgraph
- run: yarn prepare:goerli
- name: Generate subgraph.yaml for Sepolia
working-directory: packages/subgraph
run: yarn prepare:sepolia
diff --git a/.github/workflows/dev-cd.yaml b/.github/workflows/dev-cd.yaml
index 21d1b7ce..0558e309 100644
--- a/.github/workflows/dev-cd.yaml
+++ b/.github/workflows/dev-cd.yaml
@@ -5,22 +5,21 @@ on:
branches: main
env:
- REACT_APP_POSTER_CONTRACT: ${{ secrets.REACT_APP_POSTER_CONTRACT }}
- REACT_APP_INFURA_NETWORK_ACCESS_KEY: ${{ secrets.REACT_APP_INFURA_NETWORK_ACCESS_KEY }}
- REACT_APP_INFURA_IPFS_API_KEY: ${{ secrets.REACT_APP_INFURA_IPFS_API_KEY }}
- REACT_APP_INFURA_IPFS_API_SECRET: ${{ secrets.REACT_APP_INFURA_IPFS_API_SECRET }}
- REACT_APP_SUBGRAPH_BASE_URL: https://api.thegraph.com/subgraphs/name/
- REACT_APP_SUBGRAPH_GNOSIS_CHAIN: auryn-macmillan/tabula-gnosis-chain
- REACT_APP_SUBGRAPH_MAINNET: auryn-macmillan/tabula-mainnet
- REACT_APP_SUBGRAPH_GOERLI: auryn-macmillan/tabula-goerli
- REACT_APP_SUBGRAPH_SEPOLIA: auryn-macmillan/tabula-sepolia
- REACT_APP_SUBGRAPH_POLYGON: auryn-macmillan/tabula-polygon
- REACT_APP_SUBGRAPH_ARBITRUM: auryn-macmillan/tabula-arbitrum
- REACT_APP_SUBGRAPH_OPTIMISM: auryn-macmillan/tabula-optimism
- REACT_APP_SUBGRAPH_OPTIMISM_ON_GNOSIS_CHAIN: auryn-macmillan/tabula-optimism-on-gnosis-chain
- REACT_APP_IPFS_GATEWAY: https://ipfs.io/ipfs
- REACT_APP_ENS_SUBGRAPH_MAINNET: ensdomains/ens
- REACT_APP_ENS_SUBGRAPH_GOERLI: ensdomains/ensgoerli
+ VITE_APP_POSTER_CONTRACT: ${{ secrets.VITE_APP_POSTER_CONTRACT }}
+ VITE_APP_INFURA_NETWORK_ACCESS_KEY: ${{ secrets.VITE_APP_INFURA_NETWORK_ACCESS_KEY }}
+ VITE_APP_INFURA_IPFS_API_KEY: ${{ secrets.VITE_APP_INFURA_IPFS_API_KEY }}
+ VITE_APP_INFURA_IPFS_API_SECRET: ${{ secrets.VITE_APP_INFURA_IPFS_API_SECRET }}
+ VITE_APP_SUBGRAPH_BASE_URL: https://api.thegraph.com/subgraphs/name/
+ VITE_APP_SUBGRAPH_GNOSIS_CHAIN: auryn-macmillan/tabula-gnosis-chain
+ VITE_APP_SUBGRAPH_MAINNET: auryn-macmillan/tabula-mainnet
+ VITE_APP_SUBGRAPH_SEPOLIA: auryn-macmillan/tabula-sepolia
+ VITE_APP_SUBGRAPH_POLYGON: auryn-macmillan/tabula-polygon
+ VITE_APP_SUBGRAPH_ARBITRUM: auryn-macmillan/tabula-arbitrum
+ VITE_APP_SUBGRAPH_OPTIMISM: auryn-macmillan/tabula-optimism
+ VITE_APP_SUBGRAPH_OPTIMISM_ON_GNOSIS_CHAIN: auryn-macmillan/tabula-optimism-on-gnosis-chain
+ VITE_APP_IPFS_GATEWAY: https://ipfs.io/ipfs
+ VITE_APP_ENS_SUBGRAPH_MAINNET: ensdomains/ens
+ VITE_APP_ENS_SUBGRAPH_SEPOLIA: ensdomains/enssepolia
jobs:
deploy:
runs-on: ubuntu-latest
@@ -29,7 +28,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
- node-version: 16
+ node-version: 21
- run: npm install -g yarn
- run: yarn install --frozen-lockfile
- run: yarn build
@@ -39,7 +38,7 @@ jobs:
uses: anantaramdas/ipfs-pinata-deploy-action@39bbda1ce1fe24c69c6f57861b8038278d53688d
with:
pin-name: Tabula - Latest — ${ GITHUB_SHA }
- path: "./packages/app/build"
+ path: "./packages/app/dist"
pinata-api-key: ${{ secrets.PINATA_API_KEY }}
pinata-secret-api-key: ${{ secrets.PINATA_API_SECRET_KEY }}
@@ -78,14 +77,8 @@ jobs:
working-directory: packages/subgraph
run: yarn run graph auth --product hosted-service ${{ secrets.GRAPH_ACCESS_TOKEN }}
- - name: Deploy Goerli subgraphs
- working-directory: packages/subgraph
- env:
- HOSTED_SERVICE_SUBGRAPH__GOERLI: auryn-macmillan/tabula-goerli
- run: yarn deploy:goerli
-
- name: Deploy Sepolia subgraphs
working-directory: packages/subgraph
env:
- HOSTED_SERVICE_SUBGRAPH__GOERLI: auryn-macmillan/tabula-sepolia
+ HOSTED_SERVICE_SUBGRAPH__SEPOLIA: auryn-macmillan/tabula-sepolia
run: yarn deploy:sepolia
diff --git a/.github/workflows/prod-release-deploy.yaml b/.github/workflows/prod-release-deploy.yaml
index 99bd36bd..e2bd1f92 100644
--- a/.github/workflows/prod-release-deploy.yaml
+++ b/.github/workflows/prod-release-deploy.yaml
@@ -5,22 +5,21 @@ on:
types: published
env:
- REACT_APP_POSTER_CONTRACT: ${{ secrets.REACT_APP_POSTER_CONTRACT }}
- REACT_APP_INFURA_NETWORK_ACCESS_KEY: ${{ secrets.REACT_APP_INFURA_NETWORK_ACCESS_KEY }}
- REACT_APP_INFURA_IPFS_API_KEY: ${{ secrets.REACT_APP_INFURA_IPFS_API_KEY }}
- REACT_APP_INFURA_IPFS_API_SECRET: ${{ secrets.REACT_APP_INFURA_IPFS_API_SECRET }}
- REACT_APP_SUBGRAPH_BASE_URL: https://api.thegraph.com/subgraphs/name/
- REACT_APP_SUBGRAPH_GNOSIS_CHAIN: auryn-macmillan/tabula-gnosis-chain
- REACT_APP_SUBGRAPH_MAINNET: auryn-macmillan/tabula-mainnet
- REACT_APP_SUBGRAPH_GOERLI: auryn-macmillan/tabula-goerli
- REACT_APP_SUBGRAPH_SEPOLIA: auryn-macmillan/tabula-sepolia
- REACT_APP_SUBGRAPH_POLYGON: auryn-macmillan/tabula-polygon
- REACT_APP_SUBGRAPH_ARBITRUM: auryn-macmillan/tabula-arbitrum
- REACT_APP_SUBGRAPH_OPTIMISM: auryn-macmillan/tabula-optimism
- REACT_APP_SUBGRAPH_OPTIMISM_ON_GNOSIS_CHAIN: auryn-macmillan/tabula-optimism-on-gnosis-chain
- REACT_APP_IPFS_GATEWAY: https://ipfs.io/ipfs
- REACT_APP_ENS_SUBGRAPH_MAINNET: ensdomains/ens
- REACT_APP_ENS_SUBGRAPH_GOERLI: ensdomains/ensgoerli
+ VITE_APP_POSTER_CONTRACT: ${{ secrets.VITE_APP_POSTER_CONTRACT }}
+ VITE_APP_INFURA_NETWORK_ACCESS_KEY: ${{ secrets.VITE_APP_INFURA_NETWORK_ACCESS_KEY }}
+ VITE_APP_INFURA_IPFS_API_KEY: ${{ secrets.VITE_APP_INFURA_IPFS_API_KEY }}
+ VITE_APP_INFURA_IPFS_API_SECRET: ${{ secrets.VITE_APP_INFURA_IPFS_API_SECRET }}
+ VITE_APP_SUBGRAPH_BASE_URL: https://api.thegraph.com/subgraphs/name/
+ VITE_APP_SUBGRAPH_GNOSIS_CHAIN: auryn-macmillan/tabula-gnosis-chain
+ VITE_APP_SUBGRAPH_MAINNET: auryn-macmillan/tabula-mainnet
+ VITE_APP_SUBGRAPH_SEPOLIA: auryn-macmillan/tabula-sepolia
+ VITE_APP_SUBGRAPH_POLYGON: auryn-macmillan/tabula-polygon
+ VITE_APP_SUBGRAPH_ARBITRUM: auryn-macmillan/tabula-arbitrum
+ VITE_APP_SUBGRAPH_OPTIMISM: auryn-macmillan/tabula-optimism
+ VITE_APP_SUBGRAPH_OPTIMISM_ON_GNOSIS_CHAIN: auryn-macmillan/tabula-optimism-on-gnosis-chain
+ VITE_APP_IPFS_GATEWAY: https://ipfs.io/ipfs
+ VITE_APP_ENS_SUBGRAPH_MAINNET: ensdomains/ens
+ VITE_APP_ENS_SUBGRAPH_SEPOLIA: ensdomains/enssepolia
jobs:
deploy:
runs-on: ubuntu-latest
@@ -29,7 +28,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
- node-version: 16
+ node-version: 21
- run: npm install -g yarn
- run: yarn install --frozen-lockfile
- run: yarn build
@@ -39,7 +38,7 @@ jobs:
uses: anantaramdas/ipfs-pinata-deploy-action@39bbda1ce1fe24c69c6f57861b8038278d53688d
with:
pin-name: Tabula - Release — ${ GITHUB_SHA }
- path: "./packages/app/build"
+ path: "./packages/app/dist"
pinata-api-key: ${{ secrets.PINATA_API_KEY }}
pinata-secret-api-key: ${{ secrets.PINATA_API_SECRET_KEY }}
@@ -110,16 +109,10 @@ jobs:
HOSTED_SERVICE_SUBGRAPH__GNOSIS_CHAIN: auryn-macmillan/tabula-gnosis-chain
run: yarn deploy:gnosis-chain
- - name: Deploy subgraph to Goerli
- working-directory: packages/subgraph
- env:
- HOSTED_SERVICE_SUBGRAPH__GOERLI: auryn-macmillan/tabula-goerli
- run: yarn deploy:goerli
-
- name: Deploy subgraph to Sepolia
working-directory: packages/subgraph
env:
- HOSTED_SERVICE_SUBGRAPH__GOERLI: auryn-macmillan/tabula-sepolia
+ HOSTED_SERVICE_SUBGRAPH__SEPOLIA: auryn-macmillan/tabula-sepolia
run: yarn deploy:sepolia
- name: Deploy subgraph to Polygon
@@ -144,4 +137,4 @@ jobs:
uses: JamesIves/github-pages-deploy-action@v4.3.3
with:
branch: gh-pages
- folder: ./packages/app/build
+ folder: ./packages/app/dist
diff --git a/.gitignore b/.gitignore
index b9bd832f..0329a6f9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@ packages/subgraph/tests/.bin
packages/subgraph/subgraph.yaml
**/.env
.vscode/*
+packages/app/tsconfig.tsbuildinfo
diff --git a/package.json b/package.json
index 09f0fd31..0d15629e 100644
--- a/package.json
+++ b/package.json
@@ -9,8 +9,8 @@
],
"dependencies": {
"@ethersproject/providers": "^5.6.1",
- "axios": "^0.26.1",
- "gh-pages": "^3.2.3",
+ "axios": "^1.6.8",
+ "gh-pages": "^6.1.1",
"markdown-to-jsx": "^7.1.7",
"react-markdown": "^8.0.0",
"react-router-dom": "6",
diff --git a/packages/app/.env.example b/packages/app/.env.example
index 985f217d..e4724630 100644
--- a/packages/app/.env.example
+++ b/packages/app/.env.example
@@ -1,18 +1,16 @@
-
-REACT_APP_INFURA_NETWORK_ACCESS_KEY=
-REACT_APP_POSTER_CONTRACT=0x000000000000cd17345801aa8147b8D3950260FF
-REACT_APP_SUBGRAPH_BASE_URL=https://api.thegraph.com/subgraphs/name/
-REACT_APP_SUBGRAPH_GNOSIS_CHAIN=auryn-macmillan/tabula-gnosis-chain
-REACT_APP_SUBGRAPH_MAINNET=auryn-macmillan/tabula-mainnet
-REACT_APP_SUBGRAPH_GOERLI=auryn-macmillan/tabula-goerli
-REACT_APP_SUBGRAPH_SEPOLIA=auryn-macmillan/tabula-sepolia
-REACT_APP_SUBGRAPH_POLYGON=auryn-macmillan/tabula-polygon
-REACT_APP_SUBGRAPH_ARBITRUM=auryn-macmillan/tabula-arbitrum
-REACT_APP_SUBGRAPH_OPTIMISM=auryn-macmillan/tabula-optimism
-REACT_APP_ENS_SUBGRAPH_MAINNET=ensdomains/ens
-REACT_APP_ENS_SUBGRAPH_GOERLI=ensdomains/ensgoerli
-REACT_APP_IPFS_GATEWAY=https://ipfs.io/ipfs
-REACT_APP_SUBGRAPH_OPTIMISM_ON_GNOSIS_CHAIN=auryn-macmillan/tabula-optimism-on-gnosis-chain
-REACT_APP_INFURA_IPFS_API_KEY=
-REACT_APP_INFURA_IPFS_API_SECRET=
-
+VITE_APP_INFURA_NETWORK_ACCESS_KEY=
+VITE_APP_WALLET_CONNECT_ID=
+VITE_APP_POSTER_CONTRACT=0x000000000000cd17345801aa8147b8D3950260FF
+VITE_APP_SUBGRAPH_BASE_URL=https://api.thegraph.com/subgraphs/name/
+VITE_APP_SUBGRAPH_GNOSIS_CHAIN=auryn-macmillan/tabula-gnosis-chain
+VITE_APP_SUBGRAPH_MAINNET=auryn-macmillan/tabula-mainnet
+VITE_APP_SUBGRAPH_SEPOLIA=auryn-macmillan/tabula-sepolia
+VITE_APP_SUBGRAPH_POLYGON=auryn-macmillan/tabula-polygon
+VITE_APP_SUBGRAPH_ARBITRUM=auryn-macmillan/tabula-arbitrum
+VITE_APP_SUBGRAPH_OPTIMISM=auryn-macmillan/tabula-optimism
+VITE_APP_ENS_SUBGRAPH_MAINNET=ensdomains/ens
+VITE_APP_ENS_SUBGRAPH_SEPOLIA=ensdomains/enssepolia
+VITE_APP_IPFS_GATEWAY=https://ipfs.io/ipfs
+VITE_APP_SUBGRAPH_OPTIMISM_ON_GNOSIS_CHAIN=auryn-macmillan/tabula-optimism-on-gnosis-chain
+VITE_APP_INFURA_IPFS_API_KEY=
+VITE_APP_INFURA_IPFS_API_SECRET=
diff --git a/packages/app/.gitignore b/packages/app/.gitignore
index 8692cf66..7e5993ce 100644
--- a/packages/app/.gitignore
+++ b/packages/app/.gitignore
@@ -10,6 +10,7 @@
# production
/build
+/dist
# misc
.DS_Store
diff --git a/packages/app/src/react-app-env.d.ts b/packages/app/declarations.d.ts
similarity index 51%
rename from packages/app/src/react-app-env.d.ts
rename to packages/app/declarations.d.ts
index 0a328c24..a44ac9b1 100644
--- a/packages/app/src/react-app-env.d.ts
+++ b/packages/app/declarations.d.ts
@@ -1,4 +1,5 @@
-declare module "react-helmet";
+declare module "react-helmet"
+
interface Window {
ethereum: any
-}
\ No newline at end of file
+}
diff --git a/packages/app/index.html b/packages/app/index.html
new file mode 100644
index 00000000..7cae908d
--- /dev/null
+++ b/packages/app/index.html
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Tabula
+
+
+
+
+
+
+
diff --git a/packages/app/package.json b/packages/app/package.json
index f432f8fd..8b791052 100644
--- a/packages/app/package.json
+++ b/packages/app/package.json
@@ -1,68 +1,98 @@
{
"name": "tabula",
- "version": "2.1.1",
+ "version": "2.2.0",
"private": true,
"license": "LGPL-2.1",
- "homepage": "https://onposter.github.io",
+ "homepage": "https://tabual.gg",
+ "type": "module",
"dependencies": {
- "@chainsafe/web3-context": "^1.3.1",
+ "@chainsafe/libp2p-gossipsub": "^13.0.0",
+ "@chainsafe/libp2p-noise": "^15.0.0",
+ "@emotion/babel-plugin": "^11.11.0",
"@emotion/react": "^11.8.2",
"@emotion/styled": "^11.8.1",
- "@hookform/resolvers": "^2.8.8",
+ "@ensdomains/ensjs": "^3.7.0",
+ "@helia/delegated-routing-v1-http-api-client": "^3.0.1",
+ "@helia/unixfs": "^3.0.5",
+ "@helia/verified-fetch": "^1.3.14",
+ "@hookform/resolvers": "^3.3.4",
+ "@ipfs-shipyard/pinning-service-client": "^1.0.3",
+ "@libp2p/autonat": "^1.0.19",
+ "@libp2p/bootstrap": "^10.0.22",
+ "@libp2p/circuit-relay-v2": "^1.0.22",
+ "@libp2p/dcutr": "^1.0.19",
+ "@libp2p/identify": "^2.0.0",
+ "@libp2p/interface": "^1.3.1",
+ "@libp2p/ipni-content-routing": "^2.0.2",
+ "@libp2p/kad-dht": "^12.0.15",
+ "@libp2p/keychain": "^4.0.14",
+ "@libp2p/mplex": "^10.0.22",
+ "@libp2p/ping": "^1.0.17",
+ "@libp2p/webrtc": "^4.0.31",
+ "@libp2p/websockets": "^8.0.22",
+ "@libp2p/webtransport": "^4.0.30",
"@mui/icons-material": "^5.5.1",
"@mui/material": "^5.5.0",
"@mui/styles": "^5.5.0",
- "@testing-library/jest-dom": "^5.14.1",
- "@testing-library/react": "^12.0.0",
- "@testing-library/user-event": "^13.2.1",
- "@types/jest": "^27.0.1",
- "@types/node": "^16.7.13",
- "@types/react": "^18.0.28",
- "@types/react-dom": "^18.0.9",
- "@web3-react/core": "^6.1.9",
- "@web3-react/injected-connector": "^6.0.7",
- "@web3-react/walletconnect-connector": "^6.2.13",
- "@web3-react/walletlink-connector": "^6.2.13",
+ "@nanostores/react": "ai/react",
+ "@tiptap/extension-code-block": "^2.4.0",
+ "@tiptap/extension-code-block-lowlight": "^2.4.0",
+ "@tiptap/html": "^2.4.0",
+ "@types/dompurify": "^3.0.5",
+ "@web3modal/ethers5": "^4.1.11",
+ "ai": "^3.1.12",
"axios": "^0.26.1",
"blockies-ts": "^1.0.0",
- "draft-convert": "^2.1.13",
- "draft-js": "^0.11.7",
- "draft-js-export-html": "^1.4.1",
- "draft-js-import-html": "^1.4.1",
+ "blockstore-core": "^4.0.0",
+ "blockstore-level": "^1.1.3",
+ "browserslist-to-esbuild": "^1.2.0",
+ "class-variance-authority": "^0.7.0",
+ "datastore-core": "^9.0.0",
+ "dompurify": "^3.1.4",
"ethers": "^5.7.2",
"gh-pages": "^3.2.3",
"graphql": "^16.3.0",
+ "helia": "^4.1.2",
+ "highlight.js": "^11.9.0",
"ipfs-core": "0.14.3",
"ipfs-http-client": "54.0.0",
+ "ipns": "^7.0.1",
"is-ipfs": "^6.0.2",
+ "kubo-rpc-client": "^4.1.1",
+ "libp2p": "^1.0.3",
"lodash": "^4.17.21",
+ "lowlight": "^3.1.0",
"markdown-to-jsx": "^7.1.7",
"marked": "^5.1.2",
"moment": "^2.29.2",
"notistack": "^2.0.8",
- "react": "^17.0.2",
- "react-dom": "^17.0.2",
+ "novel": "^0.2.13",
+ "openai": "^4.47.1",
+ "path": "^0.12.7",
+ "react": "^18.2.0",
+ "react-dom": "^18.2.0",
"react-helmet": "^6.1.0",
- "react-hook-form": "^7.29.0",
+ "react-hook-form": "^7.51.3",
"react-p5": "^1.3.33",
"react-query": "^3.34.16",
"react-router-dom": "^6.2.2",
- "react-scripts": "4.0.3",
"react-select": "^5.3.2",
"turndown": "^7.1.1",
- "typescript": "^4.4.2",
"uid": "^2.0.1",
"urql": "^2.2.0",
+ "use-debounce": "^10.0.0",
+ "viem": "^2.9.28",
"web-vitals": "^2.1.0",
- "webpack": "4.44.2",
"yup": "^0.32.11"
},
"scripts": {
- "start": "react-scripts --openssl-legacy-provider start",
- "old-start": "react-scripts start",
- "build": "react-scripts build",
- "test": "react-scripts test",
- "eject": "react-scripts eject",
+ "dev": "vite --port=3000",
+ "clean": "rimraf ./dist ./.cache ./node_modules/.vite",
+ "start": "vite",
+ "build": "tsc && vite build",
+ "preview": "vite preview",
+ "test": "vite test",
+ "eject": "vite eject",
"fmt": "prettier '(test|src)/**/*.(ts|tsx)' -w",
"pre-commit": "yarn fmt"
},
@@ -72,23 +102,41 @@
"react-app/jest"
]
},
- "browserslist": [
- ">0.2%",
- "not dead",
- "not op_mini all"
- ],
+ "browserslist": {
+ "production": [
+ ">0.2%",
+ "not dead",
+ "not op_mini all"
+ ],
+ "development": [
+ "last 1 chrome version",
+ "last 1 firefox version",
+ "last 1 safari version"
+ ]
+ },
"browser": {
"crypto": false
},
+ "engines": {
+ "node": ">=18.0.0"
+ },
"devDependencies": {
- "@types/draft-convert": "^2.1.4",
- "@types/draft-js": "^0.11.10",
+ "@svgr/rollup": "^8.1.0",
+ "@testing-library/jest-dom": "^5.14.1",
+ "@testing-library/react": "^12.0.0",
+ "@testing-library/user-event": "^13.2.1",
+ "@types/jest": "^27.0.1",
"@types/lodash": "^4.14.180",
"@types/marked": "^5.0.1",
+ "@types/node": "^20",
+ "@types/react": "^18",
+ "@types/react-dom": "^18",
+ "@types/react-helmet": "^6.1.11",
"@types/turndown": "^5.0.1",
- "prettier": "^2.5.1"
- },
- "resolutions": {
- "@babel/runtime": "7.18.0"
+ "@vitejs/plugin-react": "^4.2.1",
+ "prettier": "^2.5.1",
+ "typescript": "^5",
+ "vite": "^5.0.10",
+ "vite-tsconfig-paths": "^4.3.2"
}
}
diff --git a/packages/app/public/index.html b/packages/app/public/index.html
deleted file mode 100644
index 1909c847..00000000
--- a/packages/app/public/index.html
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Tabula
-
-
-
-
-
-
-
diff --git a/packages/app/src/App.tsx b/packages/app/src/App.tsx
index 61ee945d..9a2b6207 100644
--- a/packages/app/src/App.tsx
+++ b/packages/app/src/App.tsx
@@ -1,86 +1,81 @@
import React, { useEffect, useState } from "react"
-import { PublicationView } from "./components/views/publication/PublicationView"
-import { Routes, Route } from "react-router-dom"
+import { PublicationView } from "@/components/views/publication/PublicationView"
+import { Routes, Route, useLocation } from "react-router-dom"
import { SnackbarProvider } from "notistack"
import { Provider as UrqlProvider } from "urql"
/** Views **/
-import { LandingView } from "./components/views/home/LandingView"
-import { WalletView } from "./components/views/wallet/WalletView"
-import { PublicationsView } from "./components/views/publication/PublicationsView"
-import { ArticleProvider, PublicationProvider } from "./services/publications/contexts"
-import { CreateArticleView } from "./components/views/publication/CreateArticleView"
-import { ArticleView } from "./components/views/publication/ArticleView"
-import ScrollToTop from "./components/commons/ScrollToTop"
-import { subgraphClient } from "./services/graphql"
-import { PermissionView } from "./components/views/publication/PermissionView"
-import { useWeb3React } from "@web3-react/core"
-import { PosterProvider } from "./services/poster/context"
-import { WalletProvider } from "./connectors/WalletProvider"
-import { RedirectOldRoute } from "./components/commons/RedicrectOldRoute"
-import PreviewArticleView from "./components/views/publication/PreviewArticleView"
-import { EnsProvider } from "./services/ens/context"
+import { LandingView } from "@/components/views/home/LandingView"
+import { PublicationsView } from "@/components/views/publication/PublicationsView"
+import { ArticleProvider, PublicationProvider } from "@/services/publications/contexts"
+import { CreateArticleView } from "@/components/views/publication/CreateArticleView"
+import { ArticleView } from "@/components/views/publication/ArticleView"
+import ScrollToTop from "@/components/commons/ScrollToTop"
+import { subgraphClient } from "@/services/graphql"
+import { PermissionView } from "@/components/views/publication/PermissionView"
+import { PosterProvider } from "@/services/poster/context"
+import { RedirectOldRoute } from "@/components/commons/RedicrectOldRoute"
+import PreviewArticleView from "@/components/views/publication/PreviewArticleView"
+import { EnsProvider } from "@/services/ens/context"
+import { useWeb3ModalAccount } from "@web3modal/ethers5/react"
+import { useIPFSContext } from "@/services/ipfs/context"
+import { CHAINS } from "@/config/network"
const App: React.FC = () => {
- // the chainId should be from the publication if its present
+ const { chainId: userChainId } = useWeb3ModalAccount()
+ const location = useLocation()
+ const [currentSubgraphClient, setCurrentSubgraphClient] = useState(subgraphClient(userChainId))
+ const { startIpfsClientInstance } = useIPFSContext()
- const { chainId: initialChainIdFromProvider } = useWeb3React() // chain id from connected wallet
- const [chainId, setChainId] = useState(initialChainIdFromProvider)
- const [currentSubgraphClient, setCurrentSubgraphClient] = useState(subgraphClient(chainId))
+ useEffect(() => {
+ const pathParts = location.pathname.split("-")
+ let urlChainId = pathParts[0].replace("/", "")
+ const validChainIds = CHAINS.map((chain) => chain.id.toString())
- const updateChainId = (newChainId: number | undefined) => {
- if (newChainId !== chainId) {
- setChainId(newChainId)
+ if (!validChainIds.includes(urlChainId) && userChainId) {
+ urlChainId = userChainId.toString()
}
- }
- useEffect(() => {
- setCurrentSubgraphClient(subgraphClient(chainId))
- }, [chainId])
+ const client = subgraphClient(parseInt(urlChainId))
+ setCurrentSubgraphClient(client)
+ }, [location, userChainId])
useEffect(() => {
- setChainId(initialChainIdFromProvider)
- }, [initialChainIdFromProvider])
+ const initIPFS = async () => {
+ await startIpfsClientInstance()
+ }
+ initIPFS()
+ }, [startIpfsClientInstance])
return (
-
-
-
-
-
-
-
- {" "}
- } />
- } />
- } />
- } />
- {/* Redirect old routes to new routes */}
- } />
- } />
- } />
- } />
- } />
- } />
- {/* New routes */}
-
- } />
-
- } />
-
- } />
-
- } />
-
- } />
-
-
-
-
-
-
-
+
+
+
+
+
+
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
+
+ } />
+ } />
+ } />
+ } />
+ } />
+
+
+
+
+
+
)
diff --git a/packages/app/src/assets/images/tabula-logo-wordmark.svg b/packages/app/src/assets/images/tabula-logo-wordmark.svg
index 5fe79af9..e45daabe 100644
--- a/packages/app/src/assets/images/tabula-logo-wordmark.svg
+++ b/packages/app/src/assets/images/tabula-logo-wordmark.svg
@@ -1,20 +1,20 @@
-