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

made better flow cells

This commit is contained in:
Fedor Katurov 2021-10-07 18:03:16 +07:00
parent 7d6f35b0af
commit 95ec0f2e0e
21 changed files with 282 additions and 43 deletions

View file

@ -0,0 +1,18 @@
import React, { FC } from 'react';
import LazyLoad from 'react-lazyload';
import { IMGProps } from '~/utils/types';
import styles from './styles.module.scss';
import classNames from 'classnames';
interface Props extends IMGProps {
height?: number;
}
const FlowCellImage: FC<Props> = ({ className, children, ...rest }) => (
<LazyLoad once className={classNames(styles.wrapper, className)}>
<img {...rest} src={rest.src} alt="" />
{children}
</LazyLoad>
);
export { FlowCellImage };

View file

@ -0,0 +1,15 @@
.wrapper {
width: 100%;
height: 100%;
position: relative;
img {
position: absolute;
top: 50%;
left: 50%;
min-width: 100%;
min-height: 100%;
transform: translate(-50%, -50%);
object-fit: cover;
}
}