1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-05-01 23:56:41 +07:00

fixed comment attachments click

This commit is contained in:
Fedor Katurov 2022-12-14 09:39:12 +06:00
parent 6957813cd0
commit dd8b4e9dcf
2 changed files with 10 additions and 6 deletions

View file

@ -11,12 +11,13 @@ import styles from './styles.module.scss';
interface CommentImageGridProps {
files: IFile[];
onClick: (file: IFile) => void;
}
const singleSrcSet = '(max-width: 1024px) 40vw, 20vw';
const multipleSrcSet = '(max-width: 1024px) 50vw, 20vw';
const CommentImageGrid: FC<CommentImageGridProps> = ({ files }) => {
const CommentImageGrid: FC<CommentImageGridProps> = ({ files, onClick }) => {
return (
<div
className={classNames(styles.images, {
@ -24,10 +25,7 @@ const CommentImageGrid: FC<CommentImageGridProps> = ({ files }) => {
})}
>
{files.map((file, index) => (
<div
key={file.id}
// onClick={() => onShowImageModal(groupped.image, index)}
>
<div key={file.id} onClick={() => onClick(file)}>
<img
srcSet={getFileSrcSet(file)}
src={getURL(file, imagePresets['300'])}