X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/blobdiff_plain/7318ebd2ec5a7230e45ba97b024fe021baef1572..f51f2a70794858f9c8fb5d75ecd40fd1e4ec3897:/src/components/Header.svelte?ds=sidebyside

diff --git a/src/components/Header.svelte b/src/components/Header.svelte
index f4a9231..5000cd6 100644
--- a/src/components/Header.svelte
+++ b/src/components/Header.svelte
@@ -1,15 +1,8 @@
 <script>
-
-  import { last_updated_store } from '../lib/stores.js';
-
-  let last_updated;
-
-  last_updated_store.subscribe(data => {
-    if (!data) { return; }
-    last_updated = data;
-  });
-
+  import LastUpdated from './LastUpdated.svelte';
+  import PageLink from './PageLink.svelte';
 </script>
+
 <style>
   header {
     width: 100%;
@@ -17,70 +10,43 @@
     z-index: 5;
   }
 
-  header .brand {
+  .brand {
     white-space: nowrap;
   }
 
-  header .brand a:hover{
+  .brand :global(a:hover) {
     text-decoration: none;
   }
 
-  header .brand h1 {
+  .brand h1 {
     display: inline;
     font-size: 1.5em;
     color: #333;
   }
 
-  header .brand img {
+  .brand img {
     display: inline-block;
     margin-right: 5px;
     margin-top: -5px;
   }
 
-  header #last-updated {
-    font-size: 0.7em;
-    white-space: nowrap;
-    text-align: center;
-/*    display: none;
-*/  }
-
-  header .dropdown-menu {
+  .dropdown-menu {
     z-index: 1005;
   }
-
-  #loading {
-    display: none;
-    position: absolute;
-    top: 0;
-    width: 100%;
-    background-color: #eee;
-    z-index: 100;
-    padding: 10px;
-    text-align: center;
-  }
 </style>
 
 <header class="container-fluid">
   <div class="row">
     <div class="col-4">
       <div class="brand">
-        <a href="search.html">
+        <PageLink page="search">
           <img alt="logo" src="images/osm_logo.120px.png" width="30" height="30"/>
           <h1>Nominatim</h1>
-        </a>
+        </PageLink>
       </div>
     </div>
     <div class="col-4">
-      <div id="last-updated" class="text-center">
-        <div id="loading">loading...</div>
-        {#if last_updated}
-          <div id="api-request">
-            Data from <a href="{last_updated.api_request_url}">API request</a>
-            <span id="api-request-debug">(<a href="{last_updated.api_request_url_debug}">debug output</a>)</span>
-          </div>
-          Data last updated: <span id="data-date">{last_updated.date}</span>
-        {/if}
-      </div>
+      <LastUpdated/>
     </div>
     <div class="col-4 text-right">
       <div class="dropdown">
