2019-01-30 20:15:07 +00:00
|
|
|
import React from 'react';
|
|
|
|
import classNames from 'classnames';
|
|
|
|
|
|
|
|
interface Props {
|
2019-03-13 20:38:28 +00:00
|
|
|
size: 'small' | 'mini' | 'normal';
|
2019-01-30 20:15:07 +00:00
|
|
|
direction?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Spinner extends React.Component<Props> {
|
|
|
|
public render() {
|
2019-03-13 20:38:28 +00:00
|
|
|
const { size, direction } = this.props;
|
2019-01-30 20:15:07 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div
|
|
|
|
className={classNames(
|
|
|
|
'module-spinner__container',
|
2019-03-13 20:38:28 +00:00
|
|
|
`module-spinner__container--${size}`,
|
2019-01-30 20:15:07 +00:00
|
|
|
direction ? `module-spinner__container--${direction}` : null,
|
2019-03-13 20:38:28 +00:00
|
|
|
direction ? `module-spinner__container--${size}-${direction}` : null
|
2019-01-30 20:15:07 +00:00
|
|
|
)}
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
className={classNames(
|
|
|
|
'module-spinner__circle',
|
2019-03-13 20:38:28 +00:00
|
|
|
`module-spinner__circle--${size}`,
|
2019-01-30 20:15:07 +00:00
|
|
|
direction ? `module-spinner__circle--${direction}` : null,
|
2019-03-13 20:38:28 +00:00
|
|
|
direction ? `module-spinner__circle--${size}-${direction}` : null
|
2019-01-30 20:15:07 +00:00
|
|
|
)}
|
|
|
|
/>
|
|
|
|
<div
|
|
|
|
className={classNames(
|
|
|
|
'module-spinner__arc',
|
2019-03-13 20:38:28 +00:00
|
|
|
`module-spinner__arc--${size}`,
|
2019-01-30 20:15:07 +00:00
|
|
|
direction ? `module-spinner__arc--${direction}` : null,
|
2019-03-13 20:38:28 +00:00
|
|
|
direction ? `module-spinner__arc--${size}-${direction}` : null
|
2019-01-30 20:15:07 +00:00
|
|
|
)}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|