From c77c58e18143233be042c4980a6ed08ae9beac52 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 16 May 2022 19:40:23 +0200 Subject: chore: adjust and complete missing styles * add logo to topics pages and links * add Prism styles to articles * and a few other adjustements --- src/utils/helpers/pages.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/utils/helpers/pages.ts') diff --git a/src/utils/helpers/pages.ts b/src/utils/helpers/pages.ts index 93582f0..62337db 100644 --- a/src/utils/helpers/pages.ts +++ b/src/utils/helpers/pages.ts @@ -5,12 +5,14 @@ import { type RawThematicPreview, type RawTopicPreview, } from '@ts/types/raw-data'; +import { getImageFromRawData } from './images'; /** * Convert raw data to a Link object. * * @param data - An object. * @param {number} data.databaseId - The data id. + * @param {number} [data.logo] - The data logo. * @param {string} data.slug - The data slug. * @param {string} data.title - The data name. * @returns {PageLink} The link data (id, slug and title). @@ -18,10 +20,11 @@ import { export const getPageLinkFromRawData = ( data: RawThematicPreview | RawTopicPreview ): PageLink => { - const { databaseId, slug, title } = data; + const { databaseId, featuredImage, slug, title } = data; return { id: databaseId, + logo: featuredImage ? getImageFromRawData(featuredImage?.node) : undefined, name: title, slug, }; -- cgit v1.2.3