mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Remove unneccessary code
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
baf7bb41c3
commit
040120b0fb
@ -41,19 +41,10 @@ export const Badge = withTooltip(observer(({
|
||||
...elemProps
|
||||
}: BadgeProps) => {
|
||||
const elem = useRef<HTMLDivElement>(null);
|
||||
const elemHasBeenSet = useRef(false);
|
||||
const [isExpanded, setIsExpanded] = useState(false);
|
||||
const [isExpandable, setIsExpandable] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (elemHasBeenSet.current) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (elem.current) {
|
||||
elemHasBeenSet.current = true;
|
||||
}
|
||||
|
||||
const { clientWidth = 0, scrollWidth = 0 } = elem.current ?? {};
|
||||
|
||||
setIsExpandable(expandable && (clientWidth < scrollWidth));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user