From 5aa0e30c28ea60fe8fdaca0f4dd8daefc7fc1d16 Mon Sep 17 00:00:00 2001 From: ameer2468 <33054370+ameer2468@users.noreply.github.com> Date: Mon, 1 Apr 2024 21:31:52 +0300 Subject: [PATCH] [ENG-1704] Location fixed width sizing (#2268) Update ListItem.tsx --- .../settings/library/locations/ListItem.tsx | 99 +++++++++++-------- 1 file changed, 57 insertions(+), 42 deletions(-) diff --git a/interface/app/$libraryId/settings/library/locations/ListItem.tsx b/interface/app/$libraryId/settings/library/locations/ListItem.tsx index 721d06ded..ecc0f5b7f 100644 --- a/interface/app/$libraryId/settings/library/locations/ListItem.tsx +++ b/interface/app/$libraryId/settings/library/locations/ListItem.tsx @@ -1,6 +1,6 @@ import { Repeat, Trash } from '@phosphor-icons/react'; import clsx from 'clsx'; -import { useState } from 'react'; +import { useRef, useState } from 'react'; import { useNavigate } from 'react-router'; import { arraysEqual, @@ -11,7 +11,7 @@ import { } from '@sd/client'; import { Button, buttonStyles, Card, dialogManager, Tooltip } from '@sd/ui'; import { Icon } from '~/components'; -import { useLocale } from '~/hooks'; +import { useIsTextTruncated, useLocale } from '~/hooks'; import DeleteDialog from './DeleteDialog'; @@ -22,6 +22,8 @@ interface Props { export default ({ location }: Props) => { const navigate = useNavigate(); const [hide, setHide] = useState(false); + const sizeRef = useRef(null); + const isSizeTruncated = useIsTextTruncated(sizeRef); const { t } = useLocale(); @@ -55,46 +57,6 @@ export default ({ location }: Props) => {
- {/* This is a fake button, do not add disabled prop pls */} - -
-
- - {online ? t('connected') : t('disconnected')} - -
- - + + + + + {/* This is a fake button, do not add disabled prop pls */} + +
+
+ + {online ? t('connected') : t('disconnected')} + +
+ {/* */}