Background name label fix

This commit is contained in:
Sean Edmunds
2025-07-10 14:59:56 -05:00
parent 1d13161e9a
commit facd80ce72

View File

@@ -39,7 +39,6 @@ function BackgroundModal({
inUseBackgrounds: string[]; inUseBackgrounds: string[];
}) { }) {
const { ref, width } = useElementSize(); const { ref, width } = useElementSize();
const [backgroundWidth, setBackgroundWidth] = useState<number>(width || 0);
const [background, setBackground] = useState<File | null>(null); const [background, setBackground] = useState<File | null>(null);
const [fileName, setFileName] = useState<string>(''); const [fileName, setFileName] = useState<string>('');
const [newFileName, setNewFileName] = useState<string>(''); const [newFileName, setNewFileName] = useState<string>('');
@@ -63,11 +62,7 @@ function BackgroundModal({
setIsLoading(false); setIsLoading(false);
} }
}, [debouncedSearch]); }, [debouncedSearch]);
useEffect(() => {
if (width) {
setBackgroundWidth(width);
}
}, [width]);
return ( return (
<Modal.Root <Modal.Root
size={'75%'} size={'75%'}
@@ -84,6 +79,7 @@ function BackgroundModal({
}} }}
fullScreen={isMobile} fullScreen={isMobile}
centered centered
keepMounted
> >
<Modal.Overlay /> <Modal.Overlay />
<Modal.Content> <Modal.Content>
@@ -206,7 +202,7 @@ function BackgroundModal({
textOverflow: 'ellipsis', textOverflow: 'ellipsis',
overflow: 'hidden', overflow: 'hidden',
whiteSpace: 'nowrap', whiteSpace: 'nowrap',
maxWidth: backgroundWidth, maxWidth: width,
}} }}
> >
{background} {background}
@@ -251,7 +247,7 @@ function BackgroundModal({
setConfirm(true); setConfirm(true);
}} }}
> >
<FiTrash /> <FiTrash color='black' />
</ActionIcon> </ActionIcon>
</Group> </Group>
))} ))}