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

added sample data to profile sidebar

This commit is contained in:
Fedor Katurov 2022-01-12 18:07:01 +07:00
parent 0c9d5467ed
commit 367ba0cc4d
4 changed files with 101 additions and 19 deletions

View file

@ -1,26 +1,29 @@
import React, { forwardRef, ForwardRefRenderFunction, VFC } from 'react';
import React, { forwardRef } from 'react';
import styles from './styles.module.scss';
import { DivProps } from '~/utils/types';
import classNames from 'classnames';
interface SquareProps extends DivProps {
image: string;
image?: string;
size?: number;
}
const Square = forwardRef<HTMLDivElement, SquareProps>(({ image, size, ...rest }, ref) => {
const backgroundImage = image ? `url('${image}')` : undefined;
const Square = forwardRef<HTMLDivElement, SquareProps>(
({ image, size, children, ...rest }, ref) => {
const backgroundImage = image ? `url('${image}')` : undefined;
return (
<div
{...rest}
className={classNames(styles.wrapper, rest.className)}
style={{ backgroundImage, width: size }}
ref={ref}
>
<svg className={styles.svg} viewBox="0 0 1 1" />
</div>
);
});
return (
<div
{...rest}
className={classNames(styles.wrapper, rest.className)}
style={{ backgroundImage, width: size }}
ref={ref}
>
<svg className={styles.svg} viewBox="0 0 1 1" />
{!!children && <div className={styles.content}>{children}</div>}
</div>
);
}
);
export { Square };

View file

@ -9,4 +9,13 @@
border-radius: $radius;
background-size: cover;
background-repeat: no-repeat;
position: relative;
}
.content {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}