mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-29 14:46:41 +07:00
added placeholders
This commit is contained in:
parent
44ab426915
commit
b4b138e90f
16 changed files with 239 additions and 117 deletions
|
@ -1,14 +1,31 @@
|
|||
import React, { FC } from 'react';
|
||||
import styles from './styles.module.scss';
|
||||
import classNames from 'classnames';
|
||||
|
||||
interface IProps {
|
||||
export interface PlaceholderProps {
|
||||
width?: string;
|
||||
height?: number;
|
||||
color?: string;
|
||||
active?: boolean;
|
||||
loading?: boolean;
|
||||
}
|
||||
|
||||
const Placeholder: FC<IProps> = ({ width = '120px', height, color }) => (
|
||||
<div className={styles.placeholder} style={{ height, color, width }} />
|
||||
);
|
||||
const Placeholder: FC<PlaceholderProps> = ({
|
||||
width = '120px',
|
||||
height,
|
||||
color,
|
||||
active,
|
||||
children,
|
||||
loading = true,
|
||||
}) => {
|
||||
return active ? (
|
||||
<div
|
||||
className={classNames(styles.placeholder, { [styles.loading]: loading })}
|
||||
style={{ height, color, width }}
|
||||
/>
|
||||
) : (
|
||||
<>{children}</>
|
||||
);
|
||||
};
|
||||
|
||||
export { Placeholder };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue