chore: better names block image types
This commit is contained in:
@@ -13,7 +13,7 @@ const BlockSelection: React.FC<Props> = (props) => {
|
||||
} = props;
|
||||
|
||||
const {
|
||||
labels, slug, blockImage, blockImageAltText,
|
||||
labels, slug, imageURL, imageAltText,
|
||||
} = block;
|
||||
|
||||
const handleBlockSelection = () => {
|
||||
@@ -29,11 +29,11 @@ const BlockSelection: React.FC<Props> = (props) => {
|
||||
onClick={handleBlockSelection}
|
||||
>
|
||||
<div className={`${baseClass}__image`}>
|
||||
{blockImage
|
||||
{imageURL
|
||||
? (
|
||||
<img
|
||||
src={blockImage}
|
||||
alt={blockImageAltText}
|
||||
src={imageURL}
|
||||
alt={imageAltText}
|
||||
/>
|
||||
)
|
||||
: <DefaultBlockImage />}
|
||||
|
||||
@@ -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 (
|
||||
<span>{textToShow}</span>
|
||||
);
|
||||
|
||||
@@ -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 & {
|
||||
|
||||
Reference in New Issue
Block a user