From d9d0fe5992671a7d3333b6311a5b8af3b24c0dcd Mon Sep 17 00:00:00 2001 From: Pontus Dreij Date: Thu, 19 Sep 2024 10:21:01 +0200 Subject: [PATCH] feat(SW-213): Use camelCase as prop --- components/Content/Blocks/TextCols/index.tsx | 4 ++-- components/Content/Blocks/index.tsx | 2 +- types/components/content/blocks.ts | 4 +++- types/trpc/routers/contentstack/contentPage.ts | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/components/Content/Blocks/TextCols/index.tsx b/components/Content/Blocks/TextCols/index.tsx index e61fe754f..9f339bc3c 100644 --- a/components/Content/Blocks/TextCols/index.tsx +++ b/components/Content/Blocks/TextCols/index.tsx @@ -7,10 +7,10 @@ import styles from "./textcols.module.css" import type { TextColsProps } from "@/types/components/content/blocks" -export default function TextCols({ text_cols }: TextColsProps) { +export default function TextCols({ textCols }: TextColsProps) { return (
- {text_cols.columns.map((col) => { + {textCols.columns.map((col) => { return (
{col.title} diff --git a/components/Content/Blocks/index.tsx b/components/Content/Blocks/index.tsx index fc162f590..77dabdfd1 100644 --- a/components/Content/Blocks/index.tsx +++ b/components/Content/Blocks/index.tsx @@ -40,7 +40,7 @@ export function Blocks({ blocks }: BlocksProps) { /> ) case ContentBlocksTypenameEnum.ContentPageBlocksTextCols: - return + return default: return null } diff --git a/types/components/content/blocks.ts b/types/components/content/blocks.ts index a9f27bafb..a29912359 100644 --- a/types/components/content/blocks.ts +++ b/types/components/content/blocks.ts @@ -18,7 +18,9 @@ export type CardsGridProps = Pick & { firstItem?: boolean } -export type TextColsProps = Pick +export type TextColsProps = { + textCols: TextCols["text_cols"] +} export type DynamicContentProps = { dynamicContent: DynamicContent["dynamic_content"] diff --git a/types/trpc/routers/contentstack/contentPage.ts b/types/trpc/routers/contentstack/contentPage.ts index 35bb9118f..29eaf983e 100644 --- a/types/trpc/routers/contentstack/contentPage.ts +++ b/types/trpc/routers/contentstack/contentPage.ts @@ -84,7 +84,7 @@ export type CardsRaw = CardsGrid["cards_grid"]["cards"][number] type TextColsRaw = z.infer export interface TextCols extends TextColsRaw { - text_cols: { + textCols: { columns: { title: string text: {