no content fallback

This commit is contained in:
ManjaroOne666 2019-02-14 21:31:01 +00:00
parent f4b5b775a2
commit 8672460e25
3 changed files with 47 additions and 12 deletions

View File

@ -133,6 +133,10 @@
box-shadow: 0 0 64px 64px $color; box-shadow: 0 0 64px 64px $color;
} }
.no-content-text {
color: $color__neutral-800;
}
.selected-indicator { .selected-indicator {
@media (min-width: $bp__layout) { @media (min-width: $bp__layout) {
&::before { &::before {

View File

@ -1,16 +1,21 @@
<template> <template>
<GalleryPage v-if="galleries" :galleries="galleries"> <GalleryPage v-if="galleries && galleries.length > 0" :galleries="galleries">
</GalleryPage> </GalleryPage>
<NoContent v-else heading="My Galleries"
message="My galleries are being prepared for upload, please check back soon."
/>
</template> </template>
<script> <script>
import GalleryPage from '@/components/GalleryPage' import GalleryPage from '@/components/GalleryPage'
import NoContent from '@/components/NoContent'
export default { export default {
name: 'GalleriesPage', name: 'GalleriesPage',
components: { components: {
GalleryPage GalleryPage,
NoContent,
}, },
data () { data () {
@ -31,11 +36,14 @@ export default {
}, },
async asyncData ({ $axios }) { async asyncData ({ $axios }) {
let { galleries } = await $axios.$get('/api/v1/galleries') try {
return { galleries } let { galleries } = await $axios.$get('/api/v1/galleries')
return { galleries }
} catch {
return {
galleries: []
}
}
}, },
} }
</script> </script>
<style scoped lang="scss">
</style>

View File

@ -1,6 +1,7 @@
<template> <template>
<ContentPage heading="My Services"> <ContentPage heading="My Services">
<BackgroundImagePreloader v-if="showPreloaderBackground" slot="background" <BackgroundImagePreloader v-if="showPreloaderBackground && backgroundImageUrls.length > 0"
slot="background"
class="background-preloader" class="background-preloader"
:image-urls="backgroundImageUrls" :image-urls="backgroundImageUrls"
:active-index="activeIndex" :active-index="activeIndex"
@ -14,7 +15,7 @@
<div slot="overlay" class="background-tint background preloader-overlay"></div> <div slot="overlay" class="background-tint background preloader-overlay"></div>
</BackgroundImageLoader> </BackgroundImageLoader>
<ul class="services-list"> <ul v-if="services.length > 0" class="services-list">
<li v-for="(service, index) in services" <li v-for="(service, index) in services"
:key="index" :key="index"
class="services-list__item" class="services-list__item"
@ -34,6 +35,9 @@
</div> </div>
</li> </li>
</ul> </ul>
<div v-else class="no-services">
<p class="no-content-text">Please check back soon for information on the services I provide.</p>
</div>
</ContentPage> </ContentPage>
</template> </template>
@ -87,10 +91,21 @@ export default {
}, },
async asyncData ({ $axios }) { async asyncData ({ $axios }) {
let { services } = await $axios.$get('api/v1/services') try {
let { imageUrl } = await $axios.$get('api/v1/page/services') const { services } = await $axios.$get('api/v1/services')
let { imageUrl } = await $axios.$get('api/v1/page/services')
return { services, imageUrl } if (!imageUrl) {
imageUrl = '/img/default-home.jpg'
}
return { services, imageUrl }
} catch {
return {
services: [],
imageUrl: '/img/default-home.jpg',
}
}
}, },
} }
</script> </script>
@ -251,5 +266,13 @@ export default {
.preloader-overlay { .preloader-overlay {
z-index: 10; z-index: 10;
} }
.no-services {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
text-align: center;
}
</style> </style>