mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-15 08:46:58 +08:00
fix(web): fix navigation from Data page using window.location.href
This commit is contained in:
@@ -378,6 +378,23 @@ function App() {
|
|||||||
}
|
}
|
||||||
// Data page - publicly accessible with embedded dashboard
|
// Data page - publicly accessible with embedded dashboard
|
||||||
if (route === '/data') {
|
if (route === '/data') {
|
||||||
|
const dataPageNavigate = (page: Page) => {
|
||||||
|
const pathMap: Record<string, string> = {
|
||||||
|
'data': '/data',
|
||||||
|
'competition': '/competition',
|
||||||
|
'strategy-market': '/strategy-market',
|
||||||
|
'traders': '/traders',
|
||||||
|
'trader': '/dashboard',
|
||||||
|
'backtest': '/backtest',
|
||||||
|
'strategy': '/strategy',
|
||||||
|
'debate': '/debate',
|
||||||
|
'faq': '/faq',
|
||||||
|
}
|
||||||
|
const path = pathMap[page]
|
||||||
|
if (path) {
|
||||||
|
window.location.href = path
|
||||||
|
}
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="min-h-screen"
|
className="min-h-screen"
|
||||||
@@ -391,7 +408,7 @@ function App() {
|
|||||||
user={user}
|
user={user}
|
||||||
onLogout={logout}
|
onLogout={logout}
|
||||||
onLoginRequired={handleLoginRequired}
|
onLoginRequired={handleLoginRequired}
|
||||||
onPageChange={navigateToPage}
|
onPageChange={dataPageNavigate}
|
||||||
/>
|
/>
|
||||||
<main className="pt-16">
|
<main className="pt-16">
|
||||||
<DataPage />
|
<DataPage />
|
||||||
|
|||||||
Reference in New Issue
Block a user