ChatUpload: add blurhash
This commit is contained in:
parent
382bc6732d
commit
ea8561ca19
1 changed files with 5 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
import Blurhash from 'soapbox/components/blurhash';
|
||||||
import { Icon } from 'soapbox/components/ui';
|
import { Icon } from 'soapbox/components/ui';
|
||||||
|
|
||||||
import type { Attachment } from 'soapbox/types/entities';
|
import type { Attachment } from 'soapbox/types/entities';
|
||||||
|
@ -12,13 +13,15 @@ interface IChatUpload {
|
||||||
/** An attachment uploaded to the chat composer, before sending. */
|
/** An attachment uploaded to the chat composer, before sending. */
|
||||||
const ChatUpload: React.FC<IChatUpload> = ({ attachment, onDelete }) => {
|
const ChatUpload: React.FC<IChatUpload> = ({ attachment, onDelete }) => {
|
||||||
return (
|
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]'>
|
<div className='absolute right-[6px] top-[6px]'>
|
||||||
<RemoveButton onClick={onDelete} />
|
<RemoveButton onClick={onDelete} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<img
|
<img
|
||||||
className='w-24 h-24 rounded-lg'
|
className='w-24 h-24'
|
||||||
key={attachment.id}
|
key={attachment.id}
|
||||||
src={attachment.url}
|
src={attachment.url}
|
||||||
alt=''
|
alt=''
|
||||||
|
|
Loading…
Reference in a new issue