From 20c0cf5de58c0072fdb497be5a782db33c1b95ff Mon Sep 17 00:00:00 2001 From: alnasir7 Date: Sun, 28 Mar 2021 12:24:31 -0400 Subject: [PATCH] lint --- frontend/components/ModelForm.tsx | 5 +++-- frontend/components/common/Table.tsx | 15 ++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/frontend/components/ModelForm.tsx b/frontend/components/ModelForm.tsx index 5c42c1b15..f3cfa3ce2 100644 --- a/frontend/components/ModelForm.tsx +++ b/frontend/components/ModelForm.tsx @@ -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 diff --git a/frontend/components/common/Table.tsx b/frontend/components/common/Table.tsx index 8c28a7918..cff9bcdac 100644 --- a/frontend/components/common/Table.tsx +++ b/frontend/components/common/Table.tsx @@ -100,7 +100,6 @@ const GreyText = styled.span` color: ${LIGHT_GRAY}; ` - const Table = ({ columns, data, @@ -122,7 +121,7 @@ const Table = ({ return strings.some((string) => string.toLowerCase().startsWith(searchQuery.toLowerCase()), ) - } + } return false }) }) @@ -306,11 +305,13 @@ const Table = ({ {columns.map((column, i) => { return ( - { - column.render ? - (column.render(row.original.id) || (None)) - : (row.original[column.name] || (None)) -} + {column.render + ? column.render(row.original.id) || ( + None + ) + : row.original[column.name] || ( + None + )} ) })}