|
|
@ -1,5 +1,9 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
<script setup lang="ts"> |
|
|
|
const { loadFeed, githubFeed, isErrorOccurred } = useProductFeed() |
|
|
|
const props = defineProps<{ |
|
|
|
|
|
|
|
type: 'github' | 'cloud' |
|
|
|
|
|
|
|
}>() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { loadFeed, githubFeed, isErrorOccurred, cloudFeed } = useProductFeed() |
|
|
|
|
|
|
|
|
|
|
|
const scrollContainer = ref<HTMLElement>() |
|
|
|
const scrollContainer = ref<HTMLElement>() |
|
|
|
|
|
|
|
|
|
|
@ -8,12 +12,16 @@ const { isLoading } = useInfiniteScroll( |
|
|
|
async () => { |
|
|
|
async () => { |
|
|
|
if (isLoading.value) return |
|
|
|
if (isLoading.value) return |
|
|
|
await loadFeed({ |
|
|
|
await loadFeed({ |
|
|
|
type: 'github', |
|
|
|
type: props.type, |
|
|
|
loadMore: true, |
|
|
|
loadMore: true, |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ distance: 4 }, |
|
|
|
{ distance: 4 }, |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const feed = computed(() => { |
|
|
|
|
|
|
|
return props.type === 'github' ? githubFeed.value : cloudFeed.value |
|
|
|
|
|
|
|
}) |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
@ -24,15 +32,18 @@ const { isLoading } = useInfiniteScroll( |
|
|
|
}" |
|
|
|
}" |
|
|
|
class="overflow-y-auto nc-scrollbar-md mx-auto w-full" |
|
|
|
class="overflow-y-auto nc-scrollbar-md mx-auto w-full" |
|
|
|
> |
|
|
|
> |
|
|
|
<div v-if="isErrorOccurred?.github && !githubFeed.length" class="h-full flex justify-center items-center"> |
|
|
|
<div |
|
|
|
<FeedError page="github" /> |
|
|
|
v-if="(props.type === 'github' ? isErrorOccurred.github : isErrorOccurred.cloud) && !feed.length" |
|
|
|
|
|
|
|
class="h-full flex justify-center items-center" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<FeedError :page="type" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-else-if="isLoading && !githubFeed.length" class="flex items-center justify-center h-full w-full"> |
|
|
|
<div v-else-if="isLoading && !feed.length" class="flex items-center justify-center h-full w-full"> |
|
|
|
<GeneralLoader size="xlarge" /> |
|
|
|
<GeneralLoader size="xlarge" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div v-else class="mx-auto max-w-[540px] xl:max-w-[638px] justify-around justify-items-center"> |
|
|
|
<div v-else class="mx-auto max-w-[540px] xl:max-w-[638px] justify-around justify-items-center"> |
|
|
|
<FeedChangelogItem v-for="(feed, index) in githubFeed" :key="feed.Id" :item="feed" :index="index" /> |
|
|
|
<FeedChangelogItem v-for="(item, index) in feed" :key="item.Id" :item="item" :index="index" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|