fix: empty cell data renders in list (#699)

This commit is contained in:
Dan Ribbens
2022-06-29 14:07:21 -04:00
committed by GitHub
parent 62bd2db5f9
commit b6b0ffb674
2 changed files with 2 additions and 4 deletions

View File

@@ -3,9 +3,7 @@ import React from 'react';
import './index.scss';
const CodeCell = ({ data }) => {
let textToShow = '';
if (data) textToShow = data.length > 100 ? `${data.substr(0, 100)}\u2026` : data;
const textToShow = data.length > 100 ? `${data.substring(0, 100)}\u2026` : data;
return (
<code className="code-cell">

View File

@@ -31,7 +31,7 @@ const DefaultCell: React.FC<Props> = (props) => {
wrapElementProps.to = `${admin}/collections/${slug}/${id}`;
}
const CellComponent = cellComponents[field.type];
const CellComponent = cellData && cellComponents[field.type];
if (!CellComponent) {
return (