1
0
mirror of synced 2025-12-19 18:10:59 -05:00

Refactor how the product name is rendered (#49377)

This commit is contained in:
Peter Bengtsson
2024-02-27 14:03:30 -05:00
committed by GitHub
parent 63a446b8a6
commit a4dcd854f8
8 changed files with 54 additions and 23 deletions

View File

@@ -97,6 +97,7 @@ export type MainContextT = {
href: string
}
currentProduct?: ProductT
currentProductName: string
currentLayoutName?: string
isHomepageVersion: boolean
data: DataT
@@ -223,10 +224,14 @@ export const getMainContext = async (req: any, res: any): Promise<MainContextT>
}) ||
null
const currentProduct: ProductT = req.context.productMap[req.context.currentProduct] || null
const currentProductName: string = req.context.currentProductName || ''
const props: MainContextT = {
breadcrumbs: req.context.breadcrumbs || {},
communityRedirect: req.context.page?.communityRedirect || {},
currentProduct: req.context.productMap[req.context.currentProduct] || null,
currentProduct,
currentProductName,
isHomepageVersion: req.context.page?.documentType === 'homepage',
error: req.context.error ? req.context.error.toString() : '',
data: {