refactor: 💄 refacto NcEmptyContent
This commit is contained in:
parent
b0132287f0
commit
9005b519f3
22
src/components/Atoms/EmptyContent.vue
Normal file
22
src/components/Atoms/EmptyContent.vue
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<template>
|
||||||
|
<NcEmptyContent class="empty">
|
||||||
|
<slot />
|
||||||
|
</NcEmptyContent>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { NcEmptyContent } from '@nextcloud/vue'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'EmptyContent',
|
||||||
|
components: {
|
||||||
|
NcEmptyContent,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.empty {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,14 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<AppContent :padding="false">
|
<AppContent :padding="false">
|
||||||
<Loading v-if="loading" />
|
<Loading v-if="loading" />
|
||||||
<NcEmptyContent
|
<EmptyContent
|
||||||
v-if="failed"
|
v-if="failed"
|
||||||
class="error"
|
class="error"
|
||||||
:name="t('repod', 'Error loading feed')">
|
:name="t('repod', 'Error loading feed')">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<Alert />
|
<Alert />
|
||||||
</template>
|
</template>
|
||||||
</NcEmptyContent>
|
</EmptyContent>
|
||||||
<Banner
|
<Banner
|
||||||
v-if="feed"
|
v-if="feed"
|
||||||
:author="feed.author"
|
:author="feed.author"
|
||||||
@ -24,9 +24,9 @@
|
|||||||
import Alert from 'vue-material-design-icons/Alert.vue'
|
import Alert from 'vue-material-design-icons/Alert.vue'
|
||||||
import AppContent from '../components/Atoms/AppContent.vue'
|
import AppContent from '../components/Atoms/AppContent.vue'
|
||||||
import Banner from '../components/Feed/Banner.vue'
|
import Banner from '../components/Feed/Banner.vue'
|
||||||
|
import EmptyContent from '../components/Atoms/EmptyContent.vue'
|
||||||
import Episodes from '../components/Feed/Episodes.vue'
|
import Episodes from '../components/Feed/Episodes.vue'
|
||||||
import Loading from '../components/Atoms/Loading.vue'
|
import Loading from '../components/Atoms/Loading.vue'
|
||||||
import { NcEmptyContent } from '@nextcloud/vue'
|
|
||||||
import axios from '@nextcloud/axios'
|
import axios from '@nextcloud/axios'
|
||||||
import { decodeUrl } from '../utils/url.js'
|
import { decodeUrl } from '../utils/url.js'
|
||||||
import { generateUrl } from '@nextcloud/router'
|
import { generateUrl } from '@nextcloud/router'
|
||||||
@ -37,9 +37,9 @@ export default {
|
|||||||
Alert,
|
Alert,
|
||||||
AppContent,
|
AppContent,
|
||||||
Banner,
|
Banner,
|
||||||
|
EmptyContent,
|
||||||
Episodes,
|
Episodes,
|
||||||
Loading,
|
Loading,
|
||||||
NcEmptyContent,
|
|
||||||
},
|
},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
failed: false,
|
failed: false,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<AppContent>
|
<AppContent>
|
||||||
<NcEmptyContent class="empty" :name="t('repod', 'Missing required app')">
|
<EmptyContent class="empty" :name="t('repod', 'Missing required app')">
|
||||||
<template #action>
|
<template #action>
|
||||||
<NcButton :href="gPodderSyncUrl">
|
<NcButton :href="gPodderSyncUrl">
|
||||||
{{ t('repod', 'Install GPodder Sync') }}
|
{{ t('repod', 'Install GPodder Sync') }}
|
||||||
@ -9,14 +9,15 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<Alert />
|
<Alert />
|
||||||
</template>
|
</template>
|
||||||
</NcEmptyContent>
|
</EmptyContent>
|
||||||
</AppContent>
|
</AppContent>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { NcButton, NcEmptyContent } from '@nextcloud/vue'
|
|
||||||
import Alert from 'vue-material-design-icons/Alert.vue'
|
import Alert from 'vue-material-design-icons/Alert.vue'
|
||||||
import AppContent from '../components/Atoms/AppContent.vue'
|
import AppContent from '../components/Atoms/AppContent.vue'
|
||||||
|
import EmptyContent from '../components/Atoms/EmptyContent.vue'
|
||||||
|
import { NcButton } from '@nextcloud/vue'
|
||||||
import { generateUrl } from '@nextcloud/router'
|
import { generateUrl } from '@nextcloud/router'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -24,8 +25,8 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
Alert,
|
Alert,
|
||||||
AppContent,
|
AppContent,
|
||||||
|
EmptyContent,
|
||||||
NcButton,
|
NcButton,
|
||||||
NcEmptyContent,
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
gPodderSyncUrl() {
|
gPodderSyncUrl() {
|
||||||
@ -34,9 +35,3 @@ export default {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.empty {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<AppContent>
|
<AppContent>
|
||||||
<NcEmptyContent
|
<EmptyContent
|
||||||
v-if="!favs.length"
|
v-if="!favs.length"
|
||||||
class="empty"
|
class="empty"
|
||||||
:description="
|
:description="
|
||||||
@ -10,7 +10,7 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<StarOffIcon :size="20" />
|
<StarOffIcon :size="20" />
|
||||||
</template>
|
</template>
|
||||||
</NcEmptyContent>
|
</EmptyContent>
|
||||||
<ul v-if="favs.length">
|
<ul v-if="favs.length">
|
||||||
<li
|
<li
|
||||||
v-for="url in favs.sort((fav) => fav.lastPub).map((fav) => fav.url)"
|
v-for="url in favs.sort((fav) => fav.lastPub).map((fav) => fav.url)"
|
||||||
@ -23,8 +23,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import AppContent from '../components/Atoms/AppContent.vue'
|
import AppContent from '../components/Atoms/AppContent.vue'
|
||||||
|
import EmptyContent from '../components/Atoms/EmptyContent.vue'
|
||||||
import Favorites from '../components/Home/Favorites.vue'
|
import Favorites from '../components/Home/Favorites.vue'
|
||||||
import { NcEmptyContent } from '@nextcloud/vue'
|
|
||||||
import StarOffIcon from 'vue-material-design-icons/StarOff.vue'
|
import StarOffIcon from 'vue-material-design-icons/StarOff.vue'
|
||||||
import { mapState } from 'pinia'
|
import { mapState } from 'pinia'
|
||||||
import { useSubscriptions } from '../store/subscriptions.js'
|
import { useSubscriptions } from '../store/subscriptions.js'
|
||||||
@ -33,8 +33,8 @@ export default {
|
|||||||
name: 'Home',
|
name: 'Home',
|
||||||
components: {
|
components: {
|
||||||
AppContent,
|
AppContent,
|
||||||
|
EmptyContent,
|
||||||
Favorites,
|
Favorites,
|
||||||
NcEmptyContent,
|
|
||||||
StarOffIcon,
|
StarOffIcon,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -42,9 +42,3 @@ export default {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.empty {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
Loading…
Reference in New Issue
Block a user