add section title

This commit is contained in:
Hongbo Wu
2024-05-30 15:48:57 +08:00
parent 8dfd876392
commit d349c1867f

View File

@ -635,6 +635,20 @@ export const functionResolvers = {
},
},
HomeSection: {
title: (section: { title?: string; layout: string }) => {
if (section.title) return section.title
switch (section.layout) {
case 'just added':
return 'Just Added'
case 'long':
return 'Long Reads'
case 'quick links':
return 'Quick Links'
default:
return ''
}
},
async items(
section: {
items: Array<{