1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

added hoverable hints

This commit is contained in:
Fedor Katurov 2022-12-14 16:18:36 +06:00
parent c888f13c60
commit f5ca735049
7 changed files with 278 additions and 29 deletions

View file

@ -2,6 +2,8 @@ import { FC } from 'react';
import classNames from 'classnames';
import { Hoverable } from '~/components/common/Hoverable';
import { Icon } from '~/components/input/Icon';
import { imagePresets } from '~/constants/urls';
import { IFile } from '~/types';
import { getURL } from '~/utils/dom';
@ -24,8 +26,13 @@ const CommentImageGrid: FC<CommentImageGridProps> = ({ files, onClick }) => {
[styles.multiple]: files.length > 1,
})}
>
{files.map((file, index) => (
<div key={file.id} onClick={() => onClick(file)}>
{files.map((file) => (
<Hoverable
key={file.id}
onClick={() => onClick(file)}
className={styles.item}
icon={<Icon icon="zoom" size={30} />}
>
<img
srcSet={getFileSrcSet(file)}
src={getURL(file, imagePresets['300'])}
@ -33,7 +40,7 @@ const CommentImageGrid: FC<CommentImageGridProps> = ({ files, onClick }) => {
className={styles.image}
sizes={files.length > 1 ? singleSrcSet : multipleSrcSet}
/>
</div>
</Hoverable>
))}
</div>
);

View file

@ -30,3 +30,7 @@
max-inline-size: 250px;
}
}
.item {
border-radius: $radius;
}