From f51f2a70794858f9c8fb5d75ecd40fd1e4ec3897 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Fri, 12 Feb 2021 02:03:22 +0100 Subject: [PATCH] Components for internal links (#69) * add component for link to details page * introduce components for reverse and generic internal links Supersedes the generic click handler that was looking for internal links. --- src/components/DetailsIndex.svelte | 2 +- src/components/DetailsLink.svelte | 42 +++++++++++++++++++++++++++++ src/components/DetailsOneRow.svelte | 5 ++-- src/components/Header.svelte | 7 ++--- src/components/PageLink.svelte | 12 +++++++++ src/components/ResultsList.svelte | 18 ++++++------- src/components/ReverseBar.svelte | 6 +++-- src/components/ReverseLink.svelte | 31 +++++++++++++++++++++ src/components/SearchBar.svelte | 17 ++++++------ src/lib/helpers.js | 28 ------------------- src/main.js | 39 --------------------------- src/pages/DeletablePage.svelte | 6 +++-- src/pages/DetailsPage.svelte | 15 +++++++---- 13 files changed, 128 insertions(+), 100 deletions(-) create mode 100644 src/components/DetailsLink.svelte create mode 100644 src/components/PageLink.svelte create mode 100644 src/components/ReverseLink.svelte diff --git a/src/components/DetailsIndex.svelte b/src/components/DetailsIndex.svelte index 1b19967..2183597 100644 --- a/src/components/DetailsIndex.svelte +++ b/src/components/DetailsIndex.svelte @@ -91,4 +91,4 @@ margin-right: 5px; width: 30em; } - \ No newline at end of file + diff --git a/src/components/DetailsLink.svelte b/src/components/DetailsLink.svelte new file mode 100644 index 0000000..51a0c8c --- /dev/null +++ b/src/components/DetailsLink.svelte @@ -0,0 +1,42 @@ + + + diff --git a/src/components/DetailsOneRow.svelte b/src/components/DetailsOneRow.svelte index cde2ac2..1ab566d 100644 --- a/src/components/DetailsOneRow.svelte +++ b/src/components/DetailsOneRow.svelte @@ -1,4 +1,5 @@ @@ -24,7 +25,7 @@ {addressLine.rank_address} {formatAdminLevel(addressLine.admin_level)} {@html formatDistance(addressLine.distance, bDistanceInMeters)} - {#if addressLine.osm_id}details{/if} + {#if addressLine.osm_id}details{/if} diff --git a/src/components/ReverseBar.svelte b/src/components/ReverseBar.svelte index c7f081d..53d7bff 100644 --- a/src/components/ReverseBar.svelte +++ b/src/components/ReverseBar.svelte @@ -1,5 +1,7 @@ + + diff --git a/src/components/SearchBar.svelte b/src/components/SearchBar.svelte index 306ce6e..dca6161 100644 --- a/src/components/SearchBar.svelte +++ b/src/components/SearchBar.svelte @@ -1,5 +1,7 @@ @@ -67,7 +72,7 @@

{aPlace.localname} - link to this page + link to this page

@@ -278,7 +283,7 @@ padding-left: 8px; } - h1 small a { + h1 small :global(a) { font-size: 0.5em; white-space: nowrap; } -- 2.39.5