/ Fixed the scope of the nest-loader component
This commit is contained in:
@@ -1,46 +1,41 @@
|
||||
<template>
|
||||
<section class="celestial bg-image">
|
||||
<div v-if="celestialLoaded">
|
||||
<header>
|
||||
<h1 class="heading-1">
|
||||
<span>{{ celestial.name }}</span>
|
||||
<span v-if="celestial.name != celestial.englishName">/ {{ celestial.englishName }}</span>
|
||||
<span class="txt-capitalize">- {{ celestial.type }}</span>
|
||||
</h1>
|
||||
</header>
|
||||
<div class="section-content">
|
||||
<main class="celestial-body">
|
||||
<div>
|
||||
<h3 class="heading-3">
|
||||
Informations
|
||||
</h3>
|
||||
<p v-if="celestial.aroundPlanet">
|
||||
Orbite autour de
|
||||
<nuxt-link
|
||||
:to="`/astres/${celestial.aroundPlanet.planet}`"
|
||||
class="txt-capitalize"
|
||||
>
|
||||
{{ celestial.aroundPlanet.planet }}
|
||||
</nuxt-link>
|
||||
</p>
|
||||
<p v-if="celestial.discoveredBy">
|
||||
Découvert par {{ celestial.discoveredBy }} le {{ celestial.discoveryDate }}
|
||||
</p>
|
||||
<p>Facteur Gravité : {{ celestial.gravity }}</p>
|
||||
<p>Facteur Densité : {{ celestial.density }}</p>
|
||||
<p>Inclinaison : {{ celestial.inclination }}</p>
|
||||
</div>
|
||||
<div v-if="celestial.moons" class="celestial-moons">
|
||||
<h2 class="heading-2">
|
||||
Astres orbitant {{ celestial.name }}
|
||||
</h2>
|
||||
<celestials-list :celestials="celestial.moons" :has-filters="false" />
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<nest-loader />
|
||||
<header>
|
||||
<h1 class="heading-1">
|
||||
<span>{{ celestial.name }}</span>
|
||||
<span v-if="celestial.name != celestial.englishName">/ {{ celestial.englishName }}</span>
|
||||
<span class="txt-capitalize">- {{ celestial.type }}</span>
|
||||
</h1>
|
||||
</header>
|
||||
<div class="section-content">
|
||||
<main class="celestial-body">
|
||||
<div>
|
||||
<h3 class="heading-3">
|
||||
Informations
|
||||
</h3>
|
||||
<p v-if="celestial.aroundPlanet">
|
||||
Orbite autour de
|
||||
<nuxt-link
|
||||
:to="`/astres/${celestial.aroundPlanet.planet}`"
|
||||
class="txt-capitalize"
|
||||
>
|
||||
{{ celestial.aroundPlanet.planet }}
|
||||
</nuxt-link>
|
||||
</p>
|
||||
<p v-if="celestial.discoveredBy">
|
||||
Découvert par {{ celestial.discoveredBy }} le {{ celestial.discoveryDate }}
|
||||
</p>
|
||||
<p>Facteur Gravité : {{ celestial.gravity }}</p>
|
||||
<p>Facteur Densité : {{ celestial.density }}</p>
|
||||
<p>Inclinaison : {{ celestial.inclination }}</p>
|
||||
</div>
|
||||
<div v-if="celestial.moons" class="celestial-moons">
|
||||
<h2 class="heading-2">
|
||||
Astres orbitant {{ celestial.name }}
|
||||
</h2>
|
||||
<celestials-list :celestials="celestial.moons" :has-filters="false" />
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
@@ -51,20 +46,14 @@ import { fetchCelestial } from '@/api/le-systeme-solaire'
|
||||
// import { fetchWikipediaExcerpt } from "@/api/wikipedia";
|
||||
|
||||
// Global methods
|
||||
import NestLoader from '@/components/NestLoader.vue'
|
||||
|
||||
export default {
|
||||
name: 'Celestial',
|
||||
components: {
|
||||
NestLoader
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
celestial: {},
|
||||
celestialLoaded: false,
|
||||
excerpt: '',
|
||||
error: ''
|
||||
celestialLoaded: false
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -6,15 +6,7 @@
|
||||
</h1>
|
||||
</header>
|
||||
<div class="section-content">
|
||||
<div v-if="error">
|
||||
Une erreur est survenue : {{ error }}
|
||||
</div>
|
||||
<div v-if="celestials.length > 1">
|
||||
<celestials-list :celestials="celestials" />
|
||||
</div>
|
||||
<div v-else>
|
||||
<nest-loader />
|
||||
</div>
|
||||
<celestials-list :celestials="celestials" />
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
@@ -24,20 +16,16 @@
|
||||
import { fetchCelestials } from '@/api/le-systeme-solaire'
|
||||
|
||||
// Global methods
|
||||
|
||||
import CelestialsList from '@/components/celestials/CelestialsList.vue'
|
||||
import NestLoader from '@/components/NestLoader.vue'
|
||||
|
||||
export default {
|
||||
name: 'Celestials',
|
||||
components: {
|
||||
CelestialsList,
|
||||
NestLoader
|
||||
CelestialsList
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
celestials: [],
|
||||
error: ''
|
||||
celestials: []
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user