Фикс плавающей иконки

This commit is contained in:
RoyceDa
2026-02-18 20:23:17 +02:00
parent 6670956a51
commit 782f156070

View File

@@ -55,7 +55,7 @@ export function MessageImage(props: AttachmentProps) {
return;
}
}
console.info(downloadStatus);
return (
<AspectRatio onClick={onClick} ref={mainRef} style={{
minWidth: 200,
@@ -76,7 +76,7 @@ export function MessageImage(props: AttachmentProps) {
border: '1px solid ' + colors.borderColor,
display: loadedImage ? 'block' : 'none'
}} src={blob} onLoad={() => setLoadedImage(true)}></img>)}
{((downloadStatus != DownloadStatus.DOWNLOADED && downloadStatus != DownloadStatus.PENDING) || !loadedImage) && preview.length >= 20 && (
{((downloadStatus == DownloadStatus.NOT_DOWNLOADED) || !loadedImage) && preview.length >= 20 && (
<>
<img style={{
minHeight: 220,
@@ -85,8 +85,8 @@ export function MessageImage(props: AttachmentProps) {
objectFit: 'cover',
border: '1px solid ' + colors.borderColor
}} src={/*block render???*/blurhashToBase64Image(preview, 200, 220)}></img>
<Portal target={mainRef.current!}>
<Flex direction={'column'} pos={'absolute'} justify={'center'} top={0} h={'100%'} align={'center'} gap={'xs'}>
<Overlay center h={'100%'} radius={8} opacity={1} color="transparent">
<Flex direction={'column'} pos={'absolute'} top={0} justify={'center'} h={'100%'} align={'center'} gap={'xs'}>
{!error && (
<Box style={{
backgroundColor: 'rgba(0, 0, 0, 0.3)',
@@ -122,7 +122,7 @@ export function MessageImage(props: AttachmentProps) {
</Box>
)}
</Flex>
</Portal>
</Overlay>
</>
)}