Skip to content

Commit

Permalink
tidy up and make type as optional to fix error - typeof Card is not a…
Browse files Browse the repository at this point in the history
…ssignable to parameter of type
  • Loading branch information
Divs-B committed May 8, 2024
1 parent c937e72 commit c470b0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -112,7 +112,7 @@ class Card extends React.Component<CardContainerProps> {
};

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();
Expand Down
4 changes: 2 additions & 2 deletions fronts-client/src/components/card/chef/ChefCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const ChefCard = ({
{showMeta && (
<CardMetaContainer size={size}>
<CardMetaHeading>Chef</CardMetaHeading>
<CardMetaContent>{upperFirst(chef?.sectionName)}</CardMetaContent>
<CardMetaContent>{upperFirst(chef?.type)}</CardMetaContent>
</CardMetaContainer>
)}
<CardContent textSize={textSize}>
Expand All @@ -72,7 +72,7 @@ export const ChefCard = ({
/>
<CardHeadingContainer size={size}>
<CardHeading data-testid="headline" html>
{`${chef?.firstName} ${chef?.lastName}` ?? 'No Chef found'}
{chef?.webTitle ?? 'No Chef found'}
</CardHeading>
</CardHeadingContainer>
</CardContent>
Expand Down

0 comments on commit c470b0f

Please sign in to comment.