1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix snapshots

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-08-15 15:22:04 -04:00
parent 1bac2ce592
commit c9a59adf35
2 changed files with 10 additions and 12 deletions

View File

@ -4208,7 +4208,7 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
Kind:
</span>
<div
class="badge clickable interactive"
class="badge"
>
Namespace
</div>
@ -4216,7 +4216,7 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
Name:
</span>
<div
class="badge clickable interactive"
class="badge"
>
some-name
</div>
@ -4224,7 +4224,7 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
Namespace:
</span>
<div
class="badge clickable interactive"
class="badge"
>
default
</div>
@ -7856,7 +7856,7 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
Kind:
</span>
<div
class="badge clickable interactive"
class="badge"
>
Namespace
</div>
@ -7864,7 +7864,7 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
Name:
</span>
<div
class="badge clickable interactive"
class="badge"
>
some-name
</div>
@ -7872,7 +7872,7 @@ exports[`cluster/namespaces - edit namespace from new tab when navigating to nam
Namespace:
</span>
<div
class="badge clickable interactive"
class="badge"
>
default
</div>

View File

@ -43,7 +43,7 @@ export const Badge = withTooltip(observer(({
const elem = useRef<HTMLDivElement>(null);
const elemHasBeenSet = useRef(false);
const [isExpanded, setIsExpanded] = useState(false);
const [isExpandable, setIsExpandable] = useState(expandable);
const [isExpandable, setIsExpandable] = useState(false);
useEffect(() => {
if (elemHasBeenSet.current) {
@ -54,11 +54,9 @@ export const Badge = withTooltip(observer(({
elemHasBeenSet.current = true;
}
setIsExpandable((
expandable && elem.current
? elem.current.clientWidth < elem.current.scrollWidth
: false
));
const { clientWidth = 0, scrollWidth = 0 } = elem.current ?? {};
setIsExpandable(expandable && (clientWidth < scrollWidth));
}, [expandable, elem.current]);
const onMouseUp = action(() => {