Skip to content

Commit

Permalink
feat: use error component
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Aug 26, 2020
1 parent ceaa55c commit 8461083
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions components/pages/posts/content/PostMedia.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<template>
<div>
<template v-if="showError">
<Error
:show-action="false"
:render-borders="false"
error-data="Media couln't be loaded"
/>
</template>

<template v-else-if="isImage">
<!-- if media is an Image -->
<img
Expand Down Expand Up @@ -38,15 +46,26 @@
</video>
</template>

<template v-else>
<Error
:show-action="false"
:render-borders="false"
error-data="Unknown media type"
/>
</template>
</div>
</template>

<script>
import { mapState } from 'vuex'
import Error from '~/components/utils/Error'
export default {
name: 'PostMedia',
components: { Error },
props: {
post: {
type: Object,
Expand All @@ -58,6 +77,8 @@ export default {
data() {
return {
showError: false,
hasMediaLoaded: false,
retryLogic: {
Expand Down

0 comments on commit 8461083

Please sign in to comment.