rename for you to top picks

This commit is contained in:
Hongbo Wu
2024-05-31 12:23:11 +08:00
parent aa4e091c4b
commit a6d27bea8d
3 changed files with 13 additions and 13 deletions

View File

@ -113,7 +113,7 @@ const getJustAddedCandidates = async (
size: limit,
includeContent: false,
useFolders: true, // only show items in inbox folder
query: `in:inbox saved:"this week" -is:seen`,
query: `in:inbox saved:"this week"`,
},
userId
)
@ -414,17 +414,17 @@ const mixHomeItems = (
const sections = []
sections.push({
items: batches.short.flat().map(candidateToItem),
layout: 'quick links',
layout: 'quick_links',
})
sections.push({
items: batches.long.flat().map(candidateToItem),
layout: 'for you',
layout: 'top_picks',
})
sections.push({
items: justAddedCandidates.map(candidateToItem),
layout: 'just added',
layout: 'just_added',
})
return sections

View File

@ -639,11 +639,11 @@ export const functionResolvers = {
if (section.title) return section.title
switch (section.layout) {
case 'just added':
case 'just_added':
return 'Just Added'
case 'for you':
return 'For You'
case 'quick links':
case 'top_picks':
return 'Top Picks'
case 'quick_links':
return 'Quick Links'
default:
return ''

View File

@ -58,21 +58,21 @@ export default function Home(): JSX.Element {
>
{homeData.sections?.map((homeSection, idx) => {
switch (homeSection.layout) {
case 'just added':
case 'just_added':
return (
<JustReadHomeSection
key={`section-${idx}`}
homeSection={homeSection}
/>
)
case 'for you':
case 'top_picks':
return (
<ForYouHomeSection
<TopPicksHomeSection
key={`section-${idx}`}
homeSection={homeSection}
/>
)
case 'quick links':
case 'quick_links':
return (
<QuickLinksHomeSection
key={`section-${idx}`}
@ -117,7 +117,7 @@ const JustReadHomeSection = (props: HomeSectionProps): JSX.Element => {
)
}
const ForYouHomeSection = (props: HomeSectionProps): JSX.Element => {
const TopPicksHomeSection = (props: HomeSectionProps): JSX.Element => {
return (
<VStack
distribution="start"