Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,7 @@ function ListTable ({
}) {
const list = useList(listKey)
const { query } = useRouter()
const shouldShowLinkIcon =
!list.fields[selectedFields.keys().next().value].views.Cell.supportsLinkTo
const shouldShowLinkIcon = selectedFields.keys().some((k, i) => !list.fields[k].views.Cell.supportsLinkTo && i === 0)
return (
<Box paddingBottom="xlarge">
<TableContainer>
Expand Down Expand Up @@ -620,9 +619,7 @@ function ListTable ({
{shouldShowLinkIcon && <TableHeaderCell />}
{[...selectedFields].map(path => {
const label = list.fields[path].label
if (!orderableFields.has(path)) {
return <TableHeaderCell key={path}>{label}</TableHeaderCell>
}
if (!orderableFields.has(path)) return <TableHeaderCell key={path}>{label}</TableHeaderCell>
return (
<TableHeaderCell key={path}>
<Link
Expand Down Expand Up @@ -706,11 +703,9 @@ function ListTable ({
)}
{[...selectedFields].map((path, i) => {
const field = list.fields[path]
let { Cell } = list.fields[path].views
const { Cell } = list.fields[path].views
const itemForField: Record<string, any> = {}
for (const graphqlField of getRootGraphQLFieldsFromFieldController(
field.controller
)) {
for (const graphqlField of getRootGraphQLFieldsFromFieldController(field.controller)) {
const fieldGetter = itemGetter.get(graphqlField)
if (fieldGetter.errors) {
const errorMessage = fieldGetter.errors[0].message
Expand Down Expand Up @@ -759,7 +754,7 @@ function ListTable ({
)
}

const TableContainer = ({ children }: { children: ReactNode }) => {
function TableContainer ({ children }: { children: ReactNode }) {
return (
<table
css={{
Expand All @@ -775,15 +770,15 @@ const TableContainer = ({ children }: { children: ReactNode }) => {
)
}

const TableHeaderRow = ({ children }: { children: ReactNode }) => {
function TableHeaderRow ({ children }: { children: ReactNode }) {
return (
<thead>
<tr>{children}</tr>
</thead>
)
}

const TableHeaderCell = (props: HTMLAttributes<HTMLElement>) => {
function TableHeaderCell (props: HTMLAttributes<HTMLElement>) {
const { colors, spacing, typography } = useTheme()
return (
<th
Expand All @@ -803,7 +798,7 @@ const TableHeaderCell = (props: HTMLAttributes<HTMLElement>) => {
)
}

const TableBodyCell = (props: HTMLAttributes<HTMLElement>) => {
function TableBodyCell (props: HTMLAttributes<HTMLElement>) {
const { colors, typography } = useTheme()
return (
<td
Expand Down
Loading
Loading