Skip to content

Commit

Permalink
fix(component): dont attempt to access field in double column if it d…
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-nfc committed Nov 11, 2024
1 parent 619ceda commit 5bd3fca
Showing 1 changed file with 49 additions and 43 deletions.
92 changes: 49 additions & 43 deletions src/components/page/detail/DoubleColumn.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,50 +14,56 @@ const DoubleColumn = ({
return (
<div className="double">
<div className="column">
{left.map((field) => (
(
( ! textarea_fields.includes(String(metadata.fields[field].type).toLowerCase()) ) ?
<fieldset className="inline">
<label>
{
(
field in metadata.fields
) ?
metadata.fields[field].label
:
""
}
</label>
<span className="text">
<FieldData
metadata={metadata}
field_name={field}
data={data}
/>
</span>
</fieldset> :
{left.map((field) => {

<fieldset className="textarea">
<label>
{
(
field in metadata.fields
) ?
metadata.fields[field].label
:
""
}
</label>
<div className="markdown">
<FieldData
metadata={metadata}
field_name={field}
data={data}
/>
</div>
</fieldset>
)
))}
if( field in metadata.fields ) {

return (
(
( ! textarea_fields.includes(String(metadata.fields[field].type).toLowerCase()) ) ?
<fieldset className="inline">
<label>
{
(
field in metadata.fields
) ?
metadata.fields[field].label
:
""
}
</label>
<span className="text">
<FieldData
metadata={metadata}
field_name={field}
data={data}
/>
</span>
</fieldset> :

<fieldset className="textarea">
<label>
{
(
field in metadata.fields
) ?
metadata.fields[field].label
:
""
}
</label>
<div className="markdown">
<FieldData
metadata={metadata}
field_name={field}
data={data}
/>
</div>
</fieldset>
)
)
}
})}
</div>
<div className="column">
{right.map((field) => {
Expand Down

0 comments on commit 5bd3fca

Please sign in to comment.