mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix rendering of boolean values in CRDs (#1087)
* Fix rendering of boolean values in CRDs - add optional special casing for boolean values in DrawerItems and TableRows since React (imo annoying fashion) does not render boolean values by default. - add a spinner on the sidebar for when the CRD menu is expeanded but the entries have not been loaded yet. - Add ability to double click a Badge to expand, also make it so that Badges highligh all text on first click. Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
dd90dcb7f0
commit
a78bbb5f6c
15 files changed
+167
-101
No files matched your search
@@ -0,0 +1,15 @@
|
||||
import React from "react"
|
||||
|
||||
export function displayBooleans(shouldShow: boolean, from: React.ReactNode): React.ReactNode {
|
||||
if (shouldShow) {
|
||||
if (typeof from === "boolean") {
|
||||
return from.toString()
|
||||
}
|
||||
|
||||
if (Array.isArray(from)) {
|
||||
return from.map(node => displayBooleans(shouldShow, node))
|
||||
}
|
||||
}
|
||||
|
||||
return from
|
||||
}
|
||||
Reference in new issue
Block a user