Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
alnasir7 committed Mar 28, 2021
1 parent c1f8e3f commit d554bd6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
5 changes: 3 additions & 2 deletions frontend/components/ModelForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,10 @@ export const ModelTable = ({
return {
...column,
render: (id) => {
const obj = objects?.filter(item => item.id === id)[0] || objects?.[id]
const obj =
objects?.filter((item) => item.id === id)[0] || objects?.[id]
const value = obj?.[column.name]
return (obj && value !== null) ? renderFunction(value, obj) : 'None'
return obj && value !== null ? renderFunction(value, obj) : 'None'
},
}
} else return column
Expand Down
15 changes: 8 additions & 7 deletions frontend/components/common/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ const GreyText = styled.span`
color: ${LIGHT_GRAY};
`


const Table = ({
columns,
data,
Expand All @@ -122,7 +121,7 @@ const Table = ({
return strings.some((string) =>
string.toLowerCase().startsWith(searchQuery.toLowerCase()),
)
}
}
return false
})
})
Expand Down Expand Up @@ -306,11 +305,13 @@ const Table = ({
{columns.map((column, i) => {
return (
<td key={i}>
{
column.render ?
(column.render(row.original.id) || (<GreyText>None</GreyText>))
: (row.original[column.name] || (<GreyText>None</GreyText>))
}
{column.render
? column.render(row.original.id) || (
<GreyText>None</GreyText>
)
: row.original[column.name] || (
<GreyText>None</GreyText>
)}
</td>
)
})}
Expand Down

0 comments on commit d554bd6

Please sign in to comment.