Good changes
This commit is contained in:
parent
d39d1b15fd
commit
1f68ca0512
23 changed files with 670 additions and 289 deletions
|
|
@ -1,7 +1,6 @@
|
|||
import { useState, useEffect, useCallback, useMemo } from 'react';
|
||||
import MapPage, { type ExportState } from './components/map/MapPage';
|
||||
import DataSourcesPage from './components/data-sources/DataSourcesPage';
|
||||
import FAQPage from './components/faq/FAQPage';
|
||||
import LearnPage from './components/learn/LearnPage';
|
||||
import PricingPage from './components/pricing/PricingPage';
|
||||
import HomePage from './components/home/HomePage';
|
||||
import SavedSearchesPage from './components/saved-searches/SavedSearchesPage';
|
||||
|
|
@ -27,10 +26,8 @@ function pageToPath(page: Page): string {
|
|||
switch (page) {
|
||||
case 'dashboard':
|
||||
return '/dashboard';
|
||||
case 'data-sources':
|
||||
return '/data-sources';
|
||||
case 'faq':
|
||||
return '/faq';
|
||||
case 'learn':
|
||||
return '/learn';
|
||||
case 'saved-searches':
|
||||
return '/saved';
|
||||
case 'pricing':
|
||||
|
|
@ -42,8 +39,7 @@ function pageToPath(page: Page): string {
|
|||
|
||||
function pathToPage(pathname: string): Page | null {
|
||||
if (pathname === '/dashboard') return 'dashboard';
|
||||
if (pathname === '/data-sources') return 'data-sources';
|
||||
if (pathname === '/faq') return 'faq';
|
||||
if (pathname === '/learn') return 'learn';
|
||||
if (pathname === '/saved') return 'saved-searches';
|
||||
if (pathname === '/pricing') return 'pricing';
|
||||
if (pathname === '/') return 'home';
|
||||
|
|
@ -85,7 +81,7 @@ export default function App() {
|
|||
|
||||
// Backward compat: dashboard params on unknown path
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
if (params.has('v') || params.has('f') || params.has('poi') || params.has('tab')) {
|
||||
if (params.has('lat') || params.has('filter') || params.has('poi') || params.has('tab') || params.has('v') || params.has('f')) {
|
||||
// Rewrite URL to /dashboard keeping query params
|
||||
window.history.replaceState({ page: 'dashboard' }, '', `/dashboard${window.location.search}`);
|
||||
return 'dashboard';
|
||||
|
|
@ -240,10 +236,8 @@ export default function App() {
|
|||
/>
|
||||
{activePage === 'home' ? (
|
||||
<HomePage onOpenDashboard={() => navigateTo('dashboard')} onOpenPricing={() => navigateTo('pricing')} theme={theme} features={features} />
|
||||
) : activePage === 'data-sources' ? (
|
||||
<DataSourcesPage />
|
||||
) : activePage === 'faq' ? (
|
||||
<FAQPage />
|
||||
) : activePage === 'learn' ? (
|
||||
<LearnPage />
|
||||
) : activePage === 'pricing' ? (
|
||||
<PricingPage onOpenDashboard={() => navigateTo('dashboard')} />
|
||||
) : activePage === 'saved-searches' ? (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue