diff --git a/.env.defaults b/.env.defaults index 00c793e26..d29e521b2 100644 --- a/.env.defaults +++ b/.env.defaults @@ -5,6 +5,7 @@ FILE_DIRECTORY_IPFS_HASH="QmYwYkRdYMBCtMqbimgaXjf7UL4RUb5zBQu4TDE67oZbq5" PART_GLOSSARY_IPFS_HASH="bafybeibytsozn7qsvqgecogv5urg5en34r7v3zxo326vacumi56ckah5b4" # RPC URLs ARBITRUM_RPC_URL="https://sepolia-rollup.arbitrum.io/rpc" +ARBITRUM_RPC_FALLBACK_URL="https://arbitrum-sepolia.blockpi.network/v1/rpc/public" TENDERLY_RPC_URL="https://rpc.tenderly.co/fork/2fc2cf12-5c58-439f-9b5e-967bfd02191a" LOCALHOST_RPC_URL="http://localhost:8545" ETHEREUM_RPC_URL="https://1rpc.io/eth" @@ -16,8 +17,12 @@ USE_ARBITRUM_SEPOLIA="false" TENDERLY_USER=thesis TENDERLY_PROJECT=development ALLOW_TENDERLY_RESET="false" +# Analytics +ANALYTICS_ENV=DEV +POSTHOG_API_KEY= # Misc SEASON_LENGTH_IN_WEEKS=8 CONTRACT_DEPLOYMENT_BLOCK_NUMBER=553443 +SEASON_START_DATE="2023-10-26" SKIP_REACT_STRICT_MODE="false" -IS_COMING_SOON="true" +IS_COMING_SOON="true" \ No newline at end of file diff --git a/.github/workflows/test-list.yml b/.github/workflows/test-list.yml index 4918486f1..9d8667eb8 100644 --- a/.github/workflows/test-list.yml +++ b/.github/workflows/test-list.yml @@ -15,7 +15,7 @@ on: jobs: add-release-test-list: runs-on: ubuntu-latest - if: github.head_ref == 'refs/heads/stage-live' + if: github.head_ref == 'stage-live' permissions: pull-requests: write steps: diff --git a/package.json b/package.json index 081f56472..fc55a4afe 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "version": "1.0.0", "prettier": "@thesis/prettier-config", "scripts": { - "start": "yarn write-types && patch-package && webpack serve --mode=development", + "start": "yarn write-types && patch-package && webpack serve --mode=development --https", "build": "yarn write-types && patch-package && webpack build --mode=production", "write-types": "node scripts/write-taho-types.mjs", "lint:eslint": "eslint .", @@ -15,6 +15,7 @@ "postinstall": "patch-package" }, "dependencies": { + "@ethersproject/networks": "^5.7.1", "@react-spring/konva": "^9.7.3", "@react-spring/web": "^9.7.3", "@reduxjs/toolkit": "^1.9.5", @@ -29,7 +30,6 @@ "crypto-browserify": "^3.12.0", "emittery": "^1.0.1", "ethers": "^5", - "@ethersproject/networks": "^5.7.1", "gifler": "^0.1.0", "https-browserify": "^1.0.0", "konva": "^9.2.0", @@ -77,6 +77,7 @@ "eslint-plugin-import": "^2.28.1", "fork-ts-checker-webpack-plugin": "^8.0.0", "html-webpack-plugin": "^5.5.3", + "posthog-js": "^1.85.3", "prettier": "^2.8.1", "typescript": "^5.0.2", "webpack": "^5.88.1", diff --git a/src/data/questline-data.json b/src/assets/questline-data.json similarity index 100% rename from src/data/questline-data.json rename to src/assets/questline-data.json diff --git a/src/assets/xp-data.json b/src/assets/xp-data.json new file mode 100644 index 000000000..bcac8addb --- /dev/null +++ b/src/assets/xp-data.json @@ -0,0 +1,22 @@ +{ + "4": { + "xp": [], + "leaderboard": null + }, + "7": { + "xp": [], + "leaderboard": null + }, + "9": { + "xp": [], + "leaderboard": null + }, + "19": { + "xp": [], + "leaderboard": null + }, + "22": { + "xp": [], + "leaderboard": null + } +} \ No newline at end of file diff --git a/src/index.tsx b/src/index.tsx index eb61470f1..2621223e4 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,6 +1,11 @@ -import React from "react" +import React, { ReactNode, useEffect } from "react" import ReactDOM from "react-dom/client" -import { BrowserRouter as Router, Switch, Route } from "react-router-dom" +import { + BrowserRouter as Router, + Switch, + Route, + useLocation, +} from "react-router-dom" import { Web3OnboardProvider } from "@web3-onboard/react" import { Provider } from "react-redux" import { @@ -32,8 +37,23 @@ import { ROUTES } from "shared/constants" import Onboarding from "ui/Onboarding" import FullPageLoader from "shared/components/FullPageLoader" import MobileScreen from "ui/MobileScreen" +// Unfortunately the PostHog React package structure does not play nice with +// no-extraneous-dependencies. +// eslint-disable-next-line import/no-extraneous-dependencies +import { PostHogProvider, usePostHog } from "posthog-js/react" import reduxStore from "./redux-state" +function TrackEvents({ children }: { children: ReactNode[] }) { + const location = useLocation() + const posthog = usePostHog() + + useEffect(() => { + posthog?.capture("$pageview", { url: location.pathname }) + }, []) + + return children +} + function DApp() { const islandMode = useDappSelector(selectIslandMode) const { isConnected } = useConnect() @@ -56,7 +76,7 @@ function DApp() { {(!walletOnboarded || !isConnected) && } {walletOnboarded && isConnected && ( - <> + @@ -76,7 +96,7 @@ function DApp() {