Pinafore-Web-Client-Frontend/routes/_components/LazyTimeline.html

40 lines
858 B
HTML
Raw Normal View History

2018-01-15 08:24:27 +01:00
{{#await promise}}
<div class="loading-page">
{{#if trueValue}} <!-- hack to get the transition to work -->
<div transition:fade>
<LoadingSpinner />
</div>
{{/if}}
</div>
{{then constructor}}
2018-01-19 08:37:43 +01:00
<:Component {constructor} :timeline />
2018-01-15 08:24:27 +01:00
{{catch error}}
<div>Component failed to load. Please try refreshing! {{error}}</div>
2018-01-15 08:24:27 +01:00
{{/await}}
<style>
.loading-page {
width: 100%;
2018-01-16 03:29:28 +01:00
min-height: 50vh;
2018-01-15 08:24:27 +01:00
display: flex;
align-items: center;
justify-content: center;
}
</style>
<script>
import { importTimeline } from '../_utils/asyncModules'
import LoadingSpinner from './LoadingSpinner.html'
import { fade } from 'svelte-transitions'
export default {
data: () => ({
promise: importTimeline(),
trueValue: true
}),
components: {
LoadingSpinner
},
transitions: {
fade
}
}
</script>