Skip to content

Commit

Permalink
Fix failing builds
Browse files Browse the repository at this point in the history
Signed-off-by: Kipruto <[email protected]>
  • Loading branch information
kelvinkipruto committed Jul 2, 2024
1 parent 154e460 commit d87820b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions apps/roboshield/src/components/Content/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
import LongFormRichText from "@/roboshield/components/LongFormRichText";
import LongFormMedia from "@/roboshield/components/LongFormMedia";
import LongFormExternalEmbed from "@/roboshield/components/LongFormExternalEmbed";
import { FC } from "react";

type ContentProps = ExtractBlockType<
NonNullable<Page["blocks"]>[number],
Expand All @@ -29,10 +30,11 @@ export type MediaBlock = ExtractNestedBlockType<
>;

type ComponentMap = {
richtext: (props: RichTextBlock) => JSX.Element;
mediaBlock?: (props: MediaBlock) => JSX.Element;
externalEmbedd?: (props: ExternalEmbeddBlock) => JSX.Element;
richtext: React.FC<RichTextBlock>;
mediaBlock: React.FC<MediaBlock>;
externalEmbedd: React.FC<ExternalEmbeddBlock>;
};

export default function Content({ content }: ContentProps) {
const COMPONENT_BY_CONTENT_TYPE: ComponentMap = {
richtext: LongFormRichText,
Expand All @@ -50,7 +52,7 @@ export default function Content({ content }: ContentProps) {
}}
>
{content?.map((child) => {
const Component = COMPONENT_BY_CONTENT_TYPE[child.blockType];
const Component: FC<any> = COMPONENT_BY_CONTENT_TYPE[child.blockType];

if (Component) {
return <Component key={child.id} {...child} />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function LongFormRichText({ content }: RichTextBlock) {
"& h5": {
mb: 1.25,
mt: 5,
...theme.typography.h5Small,
...theme.typography.h5,
[theme.breakpoints.up("md")]: {
...theme.typography.h5,
},
Expand All @@ -49,14 +49,14 @@ export default function LongFormRichText({ content }: RichTextBlock) {
...theme.typography.body1,
mb: 2,
[theme.breakpoints.up("md")]: {
...theme.typography.body3,
...theme.typography.body2,
},
},
"& a": {
...theme.typography.body1,
mb: 2,
[theme.breakpoints.up("md")]: {
...theme.typography.body3,
...theme.typography.body2,
},
},
"& ul": {
Expand All @@ -66,7 +66,7 @@ export default function LongFormRichText({ content }: RichTextBlock) {
...theme.typography.body1,
mt: 1,
[theme.breakpoints.up("md")]: {
...theme.typography.body3,
...theme.typography.body2,
},
},
"& :last-child": {
Expand Down

0 comments on commit d87820b

Please sign in to comment.