From 050c9270ff32c6109d666d27528723631e94a8b3 Mon Sep 17 00:00:00 2001 From: Borghild Selle <104756130+BorghildSelle@users.noreply.github.com> Date: Fri, 1 Nov 2024 13:47:57 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20=20fix=20card=20and=20tsconfig?= =?UTF-8?q?=20#2616=20(#2625)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * :art: fix card and tsconfig * ✏️ Small card adjustment #2616 --------- Co-authored-by: Malin J. --- sanityv3/schemas/objects/card.tsx | 18 ++++++++---------- sanityv3/tsconfig.json | 5 +++++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/sanityv3/schemas/objects/card.tsx b/sanityv3/schemas/objects/card.tsx index d9a53d602..c789fdad6 100644 --- a/sanityv3/schemas/objects/card.tsx +++ b/sanityv3/schemas/objects/card.tsx @@ -1,23 +1,21 @@ /* eslint-disable react/display-name */ -import { forwardRef } from 'react' import { configureBlockContent } from '../editors' import type { PortableTextBlock } from 'sanity' -import { Stack, Text, Card } from '@sanity/ui' +import { Text, Card, Box } from '@sanity/ui' import blocksToText from '../../helpers/blocksToText' -const CardField = forwardRef((props: any) => { +const CardField = (props: any) => { + const { renderDefault } = props return ( - - - + + If only title are used it will render only title as statement. If content below are used, both title and content will be rendered. - - <>{props.renderDefault(props)} - + <>{renderDefault(props)} + ) -}) +} const blockConfig = { h2: false, diff --git a/sanityv3/tsconfig.json b/sanityv3/tsconfig.json index cac52d8e5..61c33dfa1 100644 --- a/sanityv3/tsconfig.json +++ b/sanityv3/tsconfig.json @@ -1,5 +1,10 @@ { "extends": "../tsconfig.base.json", + "compilerOptions": { + "paths": { + "react": ["./node_modules/@types/react"] + } + }, "include": ["**/*.ts", "**/*.tsx"], "exclude": ["node_modules"] }