- Error page now displaying (+ removed globe, more space between content and footer) - Manipulate data if existing
This commit is contained in:
@@ -1,19 +1,23 @@
|
||||
<script>
|
||||
import { site } from 'utils/store'
|
||||
import { onMount } from 'svelte'
|
||||
import { site, pageReady } from 'utils/store'
|
||||
// Components
|
||||
import IconArrow from 'atoms/IconArrow'
|
||||
import TitleSite from 'atoms/TitleSite'
|
||||
import Button from 'atoms/Button'
|
||||
import InteractiveGlobe from 'molecules/InteractiveGlobe'
|
||||
import Footer from 'organisms/Footer'
|
||||
|
||||
// Props
|
||||
export let status
|
||||
export let error
|
||||
|
||||
onMount(() => {
|
||||
pageReady.set(true)
|
||||
})
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>{$site.seo_name} - {error.message}</title>
|
||||
<title>Houses Of - {error.message}</title>
|
||||
</svelte:head>
|
||||
|
||||
{#if process.env.NODE_ENV === 'development' && error.stack}
|
||||
@@ -35,10 +39,8 @@
|
||||
|
||||
<div class="page__description style-description">
|
||||
<p>Oh no… Looks like something wrong just happened. Like a nasty error {status}.</p>
|
||||
<Button href="/" class="button" text="Go back to the homepage" on:click={() => window.location.href = '/'} />
|
||||
<Button href="/" class="button" text="Go back to homepage" />
|
||||
</div>
|
||||
|
||||
<InteractiveGlobe type="part" />
|
||||
</div>
|
||||
|
||||
<Footer />
|
||||
|
||||
@@ -83,20 +83,24 @@
|
||||
/*
|
||||
** Manipulate data
|
||||
*/
|
||||
// Replace each countrie's continent by the database
|
||||
$countries.forEach(count => count.continent = $continents.find(cont => cont.id === count.continent.id))
|
||||
if ($countries) {
|
||||
// Replace each countrie's continent by the database
|
||||
$countries.forEach(count => count.continent = $continents.find(cont => cont.id === count.continent.id))
|
||||
|
||||
// Push each country to its continent
|
||||
$countries.forEach(country => {
|
||||
const continent = $continents.find(cont => cont.id === country.continent.id)
|
||||
continent.countries = []
|
||||
if (!continent.countries.includes(country)) {
|
||||
continent.countries.push(country)
|
||||
}
|
||||
})
|
||||
// Push each country to its continent
|
||||
$countries.forEach(country => {
|
||||
const continent = $continents.find(cont => cont.id === country.continent.id)
|
||||
continent.countries = []
|
||||
if (!continent.countries.includes(country)) {
|
||||
continent.countries.push(country)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// Replace each location's country by the database
|
||||
$locations.forEach(loc => loc.country = $countries.find(cont => cont.id === loc.country.id))
|
||||
if ($locations) {
|
||||
$locations.forEach(loc => loc.country = $countries.find(cont => cont.id === loc.country.id))
|
||||
}
|
||||
|
||||
|
||||
onMount(async () => {
|
||||
|
||||
Reference in New Issue
Block a user