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

added request code dialog

This commit is contained in:
Fedor Katurov 2019-11-25 16:08:22 +07:00
parent c0c832d158
commit 6dcb21e9e4
18 changed files with 292 additions and 88 deletions

View file

@ -1,7 +1,8 @@
import React, { FC, MouseEventHandler, useEffect, useRef } from 'react';
import React, { FC, MouseEventHandler, useEffect, useRef, ReactElement } from 'react';
import * as styles from './styles.scss';
import { enableBodyScroll, disableBodyScroll } from 'body-scroll-lock';
import { Icon } from '~/components/input/Icon';
import { LoaderCircle } from '~/components/input/LoaderCircle';
interface IProps {
children: React.ReactChild;
@ -11,6 +12,8 @@ interface IProps {
size?: 'medium' | 'big';
width?: number;
error?: string;
is_loading?: boolean;
overlay?: ReactElement;
onOverlayClick?: MouseEventHandler<HTMLDivElement>;
onRefCapture?: (ref: any) => void;
@ -25,6 +28,8 @@ const BetterScrollDialog: FC<IProps> = ({
width = 600,
error,
onClose,
is_loading,
overlay = null,
}) => {
const ref = useRef(null);
@ -51,7 +56,15 @@ const BetterScrollDialog: FC<IProps> = ({
{error && <div className={styles.error}>{error}</div>}
</div>
{footer && <div className={styles.header}>{footer}</div>}
{!!is_loading && (
<div className={styles.shade}>
<LoaderCircle size={48} />
</div>
)}
{overlay}
{footer && <div className={styles.footer}>{footer}</div>}
</div>
</div>
);