accounts-frontend/packages/app/components/ui/loader/ComponentLoader.tsx
ErickSkrauch 8075192472 Split the AccountSwitcher component on 2 independent implementations
Improve auth's ChooseAccount visual behavior
Rework the ComponentLoader component. Make it more stylable
2020-10-26 22:09:01 +03:00

26 lines
719 B
TypeScript

import React, { ComponentType } from 'react';
import clsx from 'clsx';
import { Skin } from 'app/components/ui';
import styles from './componentLoader.scss';
// TODO: add mode to not show loader until first ~150ms
interface Props {
skin?: Skin;
className?: string;
}
const ComponentLoader: ComponentType<Props> = ({ skin = 'dark', className }) => (
<div className={clsx(styles.componentLoader, styles[`${skin}ComponentLoader`], className)}>
<div className={styles.spins}>
{new Array(5).fill(0).map((_, index) => (
<div className={clsx(styles.spin, styles[`spin${index}`])} key={index} />
))}
</div>
</div>
);
export default ComponentLoader;