mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
fix hoverables on comments
This commit is contained in:
parent
da93d9380d
commit
b1fce38b8f
1 changed files with 7 additions and 14 deletions
|
@ -2,8 +2,6 @@ import { FC } from 'react';
|
||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import { Hoverable } from '~/components/common/Hoverable';
|
|
||||||
import { Icon } from '~/components/common/Icon';
|
|
||||||
import { imagePresets } from '~/constants/urls';
|
import { imagePresets } from '~/constants/urls';
|
||||||
import { IFile } from '~/types';
|
import { IFile } from '~/types';
|
||||||
import { getURL } from '~/utils/dom';
|
import { getURL } from '~/utils/dom';
|
||||||
|
@ -27,20 +25,15 @@ const CommentImageGrid: FC<CommentImageGridProps> = ({ files, onClick }) => {
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{files.map((file) => (
|
{files.map((file) => (
|
||||||
<Hoverable
|
|
||||||
key={file.id}
|
|
||||||
onClick={() => onClick(file)}
|
|
||||||
className={styles.item}
|
|
||||||
icon={<Icon icon="zoom" size={30} />}
|
|
||||||
>
|
|
||||||
<img
|
<img
|
||||||
|
key={file.id}
|
||||||
|
className={styles.item}
|
||||||
|
onClick={() => onClick(file)}
|
||||||
srcSet={getFileSrcSet(file)}
|
srcSet={getFileSrcSet(file)}
|
||||||
src={getURL(file, imagePresets['300'])}
|
src={getURL(file, imagePresets['300'])}
|
||||||
alt={file.name}
|
alt={file.name}
|
||||||
className={styles.image}
|
|
||||||
sizes={files.length > 1 ? singleSrcSet : multipleSrcSet}
|
sizes={files.length > 1 ? singleSrcSet : multipleSrcSet}
|
||||||
/>
|
/>
|
||||||
</Hoverable>
|
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue