From c470b0fab741d976932f847b5ba350282af8d0bc Mon Sep 17 00:00:00 2001 From: Divya Bhatt Date: Wed, 8 May 2024 10:13:54 +0100 Subject: [PATCH] tidy up and make type as optional to fix error - typeof Card is not assignable to parameter of type --- .../src/components/FrontsEdit/CollectionComponents/Card.tsx | 4 ++-- fronts-client/src/components/card/chef/ChefCard.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fronts-client/src/components/FrontsEdit/CollectionComponents/Card.tsx b/fronts-client/src/components/FrontsEdit/CollectionComponents/Card.tsx index f726333ba93..318d7b73598 100644 --- a/fronts-client/src/components/FrontsEdit/CollectionComponents/Card.tsx +++ b/fronts-client/src/components/FrontsEdit/CollectionComponents/Card.tsx @@ -97,7 +97,7 @@ type CardContainerProps = ContainerProps & { addImageToCard: (id: string, response: ValidationResponse) => void; updateCardMeta: (id: string, meta: CardMeta) => void; clearCardSelection: (id: string) => void; - type: CardTypes; + type?: CardTypes; isSelected: boolean; numSupportingArticles: number; editMode: EditMode; @@ -112,7 +112,7 @@ class Card extends React.Component { }; public toggleShowArticleSublinks = (e?: React.MouseEvent) => { - const togPos = this.state.showCardSublinks ? false : true; + const togPos = !this.state.showCardSublinks; this.setState({ showCardSublinks: togPos }); if (e) { e.stopPropagation(); diff --git a/fronts-client/src/components/card/chef/ChefCard.tsx b/fronts-client/src/components/card/chef/ChefCard.tsx index 27ac1301a98..e4bbacbc21c 100644 --- a/fronts-client/src/components/card/chef/ChefCard.tsx +++ b/fronts-client/src/components/card/chef/ChefCard.tsx @@ -59,7 +59,7 @@ export const ChefCard = ({ {showMeta && ( Chef - {upperFirst(chef?.sectionName)} + {upperFirst(chef?.type)} )} @@ -72,7 +72,7 @@ export const ChefCard = ({ /> - {`${chef?.firstName} ${chef?.lastName}` ?? 'No Chef found'} + {chef?.webTitle ?? 'No Chef found'}