ChatUpload: add blurhash

environments/review-chat-compo-mzhk1s/deployments/2500
Alex Gleason 2023-02-02 13:06:27 -06:00
rodzic 382bc6732d
commit ea8561ca19
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -1,5 +1,6 @@
import React from 'react';
import Blurhash from 'soapbox/components/blurhash';
import { Icon } from 'soapbox/components/ui';
import type { Attachment } from 'soapbox/types/entities';
@ -12,13 +13,15 @@ interface IChatUpload {
/** An attachment uploaded to the chat composer, before sending. */
const ChatUpload: React.FC<IChatUpload> = ({ attachment, onDelete }) => {
return (
<div className='relative inline-block'>
<div className='relative inline-block rounded-lg overflow-hidden isolate'>
<Blurhash hash={attachment.blurhash} className='absolute inset-0 w-full h-full -z-10' />
<div className='absolute right-[6px] top-[6px]'>
<RemoveButton onClick={onDelete} />
</div>
<img
className='w-24 h-24 rounded-lg'
className='w-24 h-24'
key={attachment.id}
src={attachment.url}
alt=''