Skip to content

Commit cca3cac

Browse files
authored
Merge pull request #224 from oasisprotocol/lw/pathname-urls
Remove /#/ from URLs and add redirects
2 parents 1ff4940 + 1c942bb commit cca3cac

File tree

7 files changed

+10
-47
lines changed

7 files changed

+10
-47
lines changed

.changelog/224.feature.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove /#/ from URLs

home/public/discover/index.html

Lines changed: 0 additions & 11 deletions
This file was deleted.

home/public/move/index.html

Lines changed: 0 additions & 11 deletions
This file was deleted.

home/public/stake/index.html

Lines changed: 0 additions & 11 deletions
This file was deleted.

home/public/wrap/index.html

Lines changed: 0 additions & 11 deletions
This file was deleted.

home/src/main.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import { MoveApp } from '@oasisprotocol/rose-app-move'
33
import { stakeRouteObject } from '@oasisprotocol/rose-app-stake'
44
import { wrapRouteObject } from '@oasisprotocol/rose-app-wrap'
55
import { DiscoverApp } from '@oasisprotocol/rose-app-discover'
6-
import { createHashRouter, RouterProvider } from 'react-router-dom'
6+
import { createBrowserRouter, RouterProvider } from 'react-router-dom'
77

88
import { App } from './App.tsx'
99
import { ProvidersWithSidebar } from './ProvidersWithSidebar.tsx'
1010

1111
import '@oasisprotocol/rose-app-ui/core/index.css'
1212

13-
const router = createHashRouter([
13+
const router = createBrowserRouter([
1414
{
1515
path: '',
1616
element: <ProvidersWithSidebar />,
@@ -43,4 +43,10 @@ const router = createHashRouter([
4343
},
4444
])
4545

46+
// Redirect from old URLs to new URLs
47+
if (location.pathname + location.hash === '/#/wrap') location.href = '/wrap'
48+
if (location.pathname + location.hash === '/#/stake') location.href = '/stake'
49+
if (location.pathname + location.hash === '/#/move') location.href = '/move'
50+
if (location.pathname + location.hash === '/#/discover') location.href = '/discover'
51+
4652
ReactDOM.createRoot(document.getElementById('root')!).render(<RouterProvider router={router} />)

home/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default defineConfig({
1616
APP_VERSION: JSON.stringify(version),
1717
BUILD_COMMIT: JSON.stringify(execSync('git rev-parse HEAD').toString()),
1818
BUILD_DATETIME: JSON.stringify(new Date().getTime()),
19-
GITHUB_REPOSITORY_URL: JSON.stringify('https://github.com/oasisprotocol/rose/'),
19+
GITHUB_REPOSITORY_URL: JSON.stringify('https://github.com/oasisprotocol/rose-app/'),
2020
OASIS_HOME_PAGE_URL: JSON.stringify('https://oasisprotocol.org/'),
2121
OASIS_DOCS_PAGE_URL: JSON.stringify('https://docs.oasis.io/'),
2222
PRIVACY_POLICY_URL: JSON.stringify('https://oasisprotocol.org/privacy-policy'),

0 commit comments

Comments
 (0)