From f606230c65f672bbe1d0f6425c86cc8dc8a03fdf Mon Sep 17 00:00:00 2001 From: bono <13803343+bonomite@users.noreply.github.com> Date: Fri, 16 Dec 2022 13:07:03 -0500 Subject: [PATCH] Bono/goth 324 (#218) * good start * first draft complete * added logic for when only 1 article * clean up * design feedback done * qa bug fixed --- components/Byline.vue | 8 +- components/CenterFeature.vue | 4 +- components/SkylineFeature.vue | 201 ++++++++++++++++++++++++++++++++++ components/VCardMetadata.vue | 17 ++- pages/index.vue | 37 ++++--- 5 files changed, 242 insertions(+), 25 deletions(-) create mode 100644 components/SkylineFeature.vue diff --git a/components/Byline.vue b/components/Byline.vue index bf8af780..1f8e664b 100644 --- a/components/Byline.vue +++ b/components/Byline.vue @@ -42,7 +42,7 @@ const commentCount = computed(() => {
diff --git a/components/CenterFeature.vue b/components/CenterFeature.vue index 57671426..64bd86d6 100644 --- a/components/CenterFeature.vue +++ b/components/CenterFeature.vue @@ -24,8 +24,8 @@ const articlesSm = ref([ @@ -69,9 +75,10 @@ const commentCount = computed(() => { class="col-12 comments" v-if="!props.article.comments && showComments && commentCount" > - - {{ String(Number(commentCount)) }} {{commentCount === 1 ? 'comment' : 'comments'}} - + + {{ String(Number(commentCount)) }} + {{ commentCount === 1 ? 'comment' : 'comments' }} + diff --git a/pages/index.vue b/pages/index.vue index 5ef01c26..4344d89a 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -3,18 +3,17 @@ import { onMounted } from 'vue' import VCard from '@nypublicradio/nypr-design-system-vue3/v2/src/components/VCard.vue' import { useUpdateCommentCounts } from '~~/composables/comments' import useImageUrl from '~~/composables/useImageUrl' -import { ArticlePage } from '~~/composables/types/Page'; +import { ArticlePage } from '~~/composables/types/Page' import { computed, ref } from 'vue' const riverStoryCount = ref(6) const riverAdOffset = ref(2) const riverAdRepeatRate = ref(6) -const articlesPromise = findArticlePages({limit: riverStoryCount.value}).then(({ data }) => - normalizeFindArticlePagesResponse(data) +const articlesPromise = findArticlePages({ limit: riverStoryCount.value }).then( + ({ data }) => normalizeFindArticlePagesResponse(data) ) - const homePageCollectionsPromise = findPage('/').then(({ data }) => { return data.value.pageCollectionRelationship.map((collection) => { return { @@ -30,7 +29,6 @@ const [articles, homePageCollections] = await Promise.all([ articlesPromise, homePageCollectionsPromise, ]) - // the latest articles const latestArticles = ref([...articles]) @@ -49,7 +47,7 @@ const riverSegments = computed(() => { const loadMoreArticles = async () => { const newArticles = await useLoadMoreArticles({ limit: riverStoryCount.value, - offset: latestArticles.value.length + offset: latestArticles.value.length, }) latestArticles.value.push(...newArticles) } @@ -85,7 +83,6 @@ const nativoSectionLoaded = (name) => { PostRelease.Start() } } - @@ -132,13 +134,18 @@ const nativoSectionLoaded = (name) => {
-
{{segmentIndex === 0 ? "LATEST" : ""}}
+
+ {{ segmentIndex === 0 ? 'LATEST' : '' }} +
{