]> git.openstreetmap.org Git - nominatim-ui.git/blob - src/App.svelte
Merge pull request #55 from lonvia/sveltify-popstate
[nominatim-ui.git] / src / App.svelte
1 <script>
2   import 'bootstrap/dist/css/bootstrap.css';
3   import 'bootstrap/dist/js/bootstrap.bundle.js';
4
5   import { page, refresh_page } from './lib/stores.js';
6
7   import Header from './components/Header.svelte';
8   import Footer from './components/Footer.svelte';
9   import ReportIssueModal from './components/ReportIssueModal.svelte';
10   import SearchPage from './pages/SearchPage.svelte';
11   import ReversePage from './pages/ReversePage.svelte';
12   import DetailsPage from './pages/DetailsPage.svelte';
13   import PolygonsPage from './pages/PolygonsPage.svelte';
14   import DeletablePage from './pages/DeletablePage.svelte';
15
16   $: view = $page.tab;
17
18   refresh_page();
19 </script>
20
21 // deal with back-button and other user action
22 <svelte:window on:popstate={refresh_page} />
23
24 <Header/>
25 {#if view === 'search'}
26 <SearchPage />
27 {:else if view === 'reverse'}
28 <ReversePage />
29 {:else if view === 'details'}
30 <DetailsPage />
31 {:else if view === 'deletable'}
32 <DeletablePage />
33 {:else if view === 'polygons'}
34 <PolygonsPage />
35 {/if}
36 <Footer/>
37 <ReportIssueModal/>