forked from MapComplete/MapComplete
Add loading indicator for Wikipedia Article
This commit is contained in:
parent
04dd9bb1d1
commit
60d7531838
1 changed files with 4 additions and 0 deletions
|
|
@ -15,8 +15,12 @@
|
||||||
* Shows a wikipedia-article + wikidata preview for the given item
|
* Shows a wikipedia-article + wikidata preview for the given item
|
||||||
*/
|
*/
|
||||||
export let wikipediaDetails: Store<FullWikipediaDetails>
|
export let wikipediaDetails: Store<FullWikipediaDetails>
|
||||||
|
let titleOnly = wikipediaDetails.mapD(details => Object.keys(details).length === 1 && details.title !== undefined)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
{#if $titleOnly}
|
||||||
|
<Loading>{$wikipediaDetails.title}</Loading>
|
||||||
|
{/if}
|
||||||
{#if $wikipediaDetails.articleUrl}
|
{#if $wikipediaDetails.articleUrl}
|
||||||
<a class="flex" href={$wikipediaDetails.articleUrl} rel="noreferrer" target="_blank">
|
<a class="flex" href={$wikipediaDetails.articleUrl} rel="noreferrer" target="_blank">
|
||||||
<Wikipedia class="h-6 w-6" />
|
<Wikipedia class="h-6 w-6" />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue