Fix some stuff
All checks were successful
continuous-integration/drone/push Build is passing

- Error page now displaying (+ removed globe, more space between content and footer)
- Manipulate data if existing
This commit is contained in:
2020-04-14 22:23:01 +02:00
parent 2ef3ad838c
commit aeb4196918
4 changed files with 28 additions and 17 deletions

View File

@@ -1,19 +1,23 @@
<script> <script>
import { site } from 'utils/store' import { onMount } from 'svelte'
import { site, pageReady } from 'utils/store'
// Components // Components
import IconArrow from 'atoms/IconArrow' import IconArrow from 'atoms/IconArrow'
import TitleSite from 'atoms/TitleSite' import TitleSite from 'atoms/TitleSite'
import Button from 'atoms/Button' import Button from 'atoms/Button'
import InteractiveGlobe from 'molecules/InteractiveGlobe'
import Footer from 'organisms/Footer' import Footer from 'organisms/Footer'
// Props // Props
export let status export let status
export let error export let error
onMount(() => {
pageReady.set(true)
})
</script> </script>
<svelte:head> <svelte:head>
<title>{$site.seo_name} - {error.message}</title> <title>Houses Of - {error.message}</title>
</svelte:head> </svelte:head>
{#if process.env.NODE_ENV === 'development' && error.stack} {#if process.env.NODE_ENV === 'development' && error.stack}
@@ -35,10 +39,8 @@
<div class="page__description style-description"> <div class="page__description style-description">
<p>Oh no… Looks like something wrong just happened. Like a nasty error {status}.</p> <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> </div>
<InteractiveGlobe type="part" />
</div> </div>
<Footer /> <Footer />

View File

@@ -83,20 +83,24 @@
/* /*
** Manipulate data ** Manipulate data
*/ */
// Replace each countrie's continent by the database if ($countries) {
$countries.forEach(count => count.continent = $continents.find(cont => cont.id === count.continent.id)) // 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 // Push each country to its continent
$countries.forEach(country => { $countries.forEach(country => {
const continent = $continents.find(cont => cont.id === country.continent.id) const continent = $continents.find(cont => cont.id === country.continent.id)
continent.countries = [] continent.countries = []
if (!continent.countries.includes(country)) { if (!continent.countries.includes(country)) {
continent.countries.push(country) continent.countries.push(country)
} }
}) })
}
// Replace each location's country by the database // 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 () => { onMount(async () => {

View File

@@ -1,5 +1,9 @@
.page { .page {
overflow-x: hidden; overflow-x: hidden;
min-height: 100vh;
display: flex;
flex-direction: column;
justify-content: space-between;
// Page part // Page part
&__part { &__part {

View File

@@ -22,6 +22,7 @@
========================================================================== */ ========================================================================== */
// Wrap (global) // Wrap (global)
.wrap { .wrap {
width: 100%;
max-width: 1648px; max-width: 1648px;
margin: 0 auto; margin: 0 auto;
padding: 0 16px; padding: 0 16px;