From 84c0020f11799b0e5cc418778333c62e872c75bd Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Sat, 24 Jun 2023 00:02:04 -0230 Subject: [PATCH] Support `/dapps` subpath or root (#178) The page now supports being hosted at the root or at the `/dapps` subpath. Previously it only supported being hosted at the root. --- package.json | 1 + src/App.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index b29facd..82a6b47 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "eject": "react-scripts eject", "update-changelog": "./scripts/auto-changelog.sh" }, + "homepage": ".", "eslintConfig": { "extends": "react-app" }, diff --git a/src/App.js b/src/App.js index 49cd88a..0b4298a 100644 --- a/src/App.js +++ b/src/App.js @@ -34,8 +34,11 @@ function App() { if (isLoading) return null + const currentPath = window.location.pathname; + const basename = currentPath.startsWith('/dapps') ? '/dapps' : undefined; + return ( - +