zcash-grant-system/frontend/client/components/Loader/index.tsx

28 lines
577 B
TypeScript
Raw Normal View History

2019-01-23 07:15:59 -08:00
import React from 'react';
import { Icon } from 'antd';
2019-01-23 08:35:03 -08:00
import classnames from 'classnames';
2019-01-23 07:15:59 -08:00
import './index.less';
interface Props {
2019-01-23 08:35:03 -08:00
size?: 'large' | 'small';
2019-01-23 07:15:59 -08:00
inline?: boolean;
tip?: string;
overlay?: boolean;
2019-01-23 07:15:59 -08:00
}
const Loader: React.SFC<Props> = ({ inline, size, tip, overlay }) => (
<div
className={classnames(
'Loader',
size && `is-${size}`,
inline && 'is-inline',
overlay && 'is-overlay',
)}
>
2019-01-23 07:15:59 -08:00
<Icon type="loading" theme="outlined" />
{tip && <div className="Loader-tip">{tip}</div>}
</div>
);
export default Loader;