Skip to content

Commit

Permalink
fix: make sheetCell always return a Span (#907)
Browse files Browse the repository at this point in the history
`<Tooltip />` now requires an element
  • Loading branch information
jkaster authored Nov 15, 2021
1 parent 2f10dd3 commit f1fe4f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions packages/hackathon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ application: hackathon {
"https://*.slack.com/*",
"https://*.git.luolix.top/*",
"https://*.youtube.com/*",
"https://*.youtu.be/*",
"https://*.vimeo.com/*"
]
use_form_submit: yes
Expand Down
12 changes: 6 additions & 6 deletions packages/hackathon/src/models/sheetUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/
import type { SheetValues } from '@looker/wholly-sheet'
import type { DataTableColumn, DataTableColumns } from '@looker/components'
import { Icon } from '@looker/components'
import { Span, Icon } from '@looker/components'
import { Done } from '@styled-icons/material/Done'
import React from 'react'

Expand Down Expand Up @@ -86,10 +86,10 @@ export const sheetHeader = (header: string[], row: any) => {
* @param value to convert to displayable actionitem
*/
export const sheetCell = (value: any) => {
if (typeof value === 'undefined') return ''
if (typeof value === 'undefined') return <Span></Span>

if (typeof value === 'boolean') {
return value ? <Icon size="small" icon={<Done />} /> : ''
return value ? <Icon size="small" icon={<Done />} /> : <Span></Span>
}

if (value instanceof Set) {
Expand All @@ -98,10 +98,10 @@ export const sheetCell = (value: any) => {
for (const v of value.values()) {
values.push(v.toString())
}
return values.join(', ')
return <Span>{values.join(', ')}</Span>
}
if (value instanceof Date) {
return value.toDateString()
return <Span>{value.toDateString()}</Span>
}
return value.toString()
return <Span>{value.toString()}</Span>
}

0 comments on commit f1fe4f5

Please sign in to comment.