From ffa0ea475655a1d52d80fd35f71ea4937b8b1b28 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 31 Dec 2020 09:30:25 -0500 Subject: [PATCH] chore: better names block image types --- .../Blocks/BlockSelector/BlockSelection/index.tsx | 8 ++++---- .../collections/List/Cell/field-types/Richtext/index.tsx | 2 +- src/fields/config/types.ts | 5 ++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/admin/components/forms/field-types/Blocks/BlockSelector/BlockSelection/index.tsx b/src/admin/components/forms/field-types/Blocks/BlockSelector/BlockSelection/index.tsx index 42891ecc6c..43577379b4 100644 --- a/src/admin/components/forms/field-types/Blocks/BlockSelector/BlockSelection/index.tsx +++ b/src/admin/components/forms/field-types/Blocks/BlockSelector/BlockSelection/index.tsx @@ -13,7 +13,7 @@ const BlockSelection: React.FC = (props) => { } = props; const { - labels, slug, blockImage, blockImageAltText, + labels, slug, imageURL, imageAltText, } = block; const handleBlockSelection = () => { @@ -29,11 +29,11 @@ const BlockSelection: React.FC = (props) => { onClick={handleBlockSelection} >
- {blockImage + {imageURL ? ( {blockImageAltText} ) : } diff --git a/src/admin/components/views/collections/List/Cell/field-types/Richtext/index.tsx b/src/admin/components/views/collections/List/Cell/field-types/Richtext/index.tsx index 7cf4601c54..72eb218945 100644 --- a/src/admin/components/views/collections/List/Cell/field-types/Richtext/index.tsx +++ b/src/admin/components/views/collections/List/Cell/field-types/Richtext/index.tsx @@ -2,7 +2,7 @@ import React from 'react'; const RichTextCell = ({ data }) => { const flattenedText = data?.map((i) => i?.children?.map((c) => c.text)).join(' '); - const textToShow = flattenedText.length > 100 ? `${flattenedText.slice(0, 100)}\u2026` : flattenedText; + const textToShow = flattenedText?.length > 100 ? `${flattenedText.slice(0, 100)}\u2026` : flattenedText; return ( {textToShow} ); diff --git a/src/fields/config/types.ts b/src/fields/config/types.ts index 313061b999..e68a6e3ee7 100644 --- a/src/fields/config/types.ts +++ b/src/fields/config/types.ts @@ -44,7 +44,6 @@ export type Option = OptionObject | string export interface FieldBase { name?: string; label?: string; - slug?: string; required?: boolean; unique?: boolean; index?: boolean; @@ -203,8 +202,8 @@ export type Block = { slug: string, labels: Labels fields: Field[], - blockImage?: string - blockImageAltText?: string + imageURL?: string + imageAltText?: string } export type BlockField = FieldBase & {