fix: properly label arrays/blocks with plural and singular

This commit is contained in:
Elliot DeNolf
2021-04-19 22:58:54 -04:00
committed by Elliot DeNolf
parent f25e9aca61
commit fa49811377
5 changed files with 151 additions and 38 deletions

View File

@@ -241,9 +241,7 @@ const RenderBlocks = React.memo((props: RenderBlockProps) => {
<Banner type="error">
This field requires at least
{' '}
{minRows
? `${minRows} ${labels.plural}`
: `1 ${labels.singular}`}
{`${minRows} ${minRows === 1 ? labels.singular : labels.plural}`}
</Banner>
)}
{(rows.length === 0 && readOnly) && (