mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
fixed node related item profile popout
This commit is contained in:
parent
8311d3d43d
commit
c0ece70f89
13 changed files with 106 additions and 186 deletions
26
src/components/common/Square/index.tsx
Normal file
26
src/components/common/Square/index.tsx
Normal file
|
@ -0,0 +1,26 @@
|
|||
import React, { forwardRef, ForwardRefRenderFunction, VFC } from 'react';
|
||||
import styles from './styles.module.scss';
|
||||
import { DivProps } from '~/utils/types';
|
||||
import classNames from 'classnames';
|
||||
|
||||
interface SquareProps extends DivProps {
|
||||
image: string;
|
||||
size?: number;
|
||||
}
|
||||
|
||||
const Square = forwardRef<HTMLDivElement, SquareProps>(({ image, size, ...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>
|
||||
);
|
||||
});
|
||||
|
||||
export { Square };
|
10
src/components/common/Square/styles.module.scss
Normal file
10
src/components/common/Square/styles.module.scss
Normal file
|
@ -0,0 +1,10 @@
|
|||
@import "src/styles/variables";
|
||||
|
||||
.svg {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
width: 100%;
|
||||
border-radius: $radius;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue