forked from ddrilling/asb_cloud_front
Добавлена документация компонента LoaderPortal
This commit is contained in:
parent
bfd1e51cfa
commit
8f52066bce
@ -3,12 +3,19 @@ import { HTMLAttributes } from 'react'
|
|||||||
import { Loader } from '@components/icons'
|
import { Loader } from '@components/icons'
|
||||||
|
|
||||||
type LoaderPortalProps = HTMLAttributes<HTMLDivElement> & {
|
type LoaderPortalProps = HTMLAttributes<HTMLDivElement> & {
|
||||||
|
/** Показать ли загрузку */
|
||||||
show?: boolean,
|
show?: boolean,
|
||||||
|
/** Затемнять ли дочерний блок */
|
||||||
fade?: boolean,
|
fade?: boolean,
|
||||||
|
/** Параметры спиннера */
|
||||||
spinnerProps?: HTMLAttributes<HTMLDivElement>,
|
spinnerProps?: HTMLAttributes<HTMLDivElement>,
|
||||||
|
/** Заполнять ли контент на 100% */
|
||||||
fillContent?: boolean
|
fillContent?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description Добавляет оверлей загрузки над обёрнутым блоком
|
||||||
|
*/
|
||||||
export const LoaderPortal: React.FC<LoaderPortalProps> = ({ className = '', show, fade = true, children, spinnerProps, fillContent, ...other }) => (
|
export const LoaderPortal: React.FC<LoaderPortalProps> = ({ className = '', show, fade = true, children, spinnerProps, fillContent, ...other }) => (
|
||||||
<div className={`loader-container ${className}`} {...other}>
|
<div className={`loader-container ${className}`} {...other}>
|
||||||
<div className={`loader-content${fillContent ? ' loader-content-fill' : ''}`}>{children}</div>
|
<div className={`loader-content${fillContent ? ' loader-content-fill' : ''}`}>{children}</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user