1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00

fix hoverables

This commit is contained in:
Fedor Katurov 2023-12-26 11:18:45 +07:00
parent 32e7b5fd86
commit 21e8ecdc0c
3 changed files with 16 additions and 9 deletions

View file

@ -25,7 +25,7 @@
&:hover { &:hover {
z-index: 10; z-index: 10;
transition: all 100ms; transition: all 100ms;
transform: scale(1.025) translateY(-2%); transform: translateY(-2px);
box-shadow: rgba(0, 0, 0, 0.5) 0 10px 10px 5px; box-shadow: rgba(0, 0, 0, 0.5) 0 10px 10px 5px;
&::after { &::after {

View file

@ -2,6 +2,8 @@ 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';
@ -25,15 +27,20 @@ const CommentImageGrid: FC<CommentImageGridProps> = ({ files, onClick }) => {
})} })}
> >
{files.map((file) => ( {files.map((file) => (
<img <Hoverable
key={file.id} key={file.id}
className={styles.item}
onClick={() => onClick(file)} onClick={() => onClick(file)}
className={styles.item}
icon={<Icon icon="zoom" size={30} />}
>
<img
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>
); );

View file

@ -22,7 +22,7 @@
} }
.image { .image {
max-height: 400px; max-height: 500px;
border-radius: $radius; border-radius: $radius;
max-width: 100%; max-width: 100%;