|
1 | 1 | import React from 'react' |
2 | 2 | import PropTypes from 'prop-types' |
3 | | -import './style.css' |
| 3 | +import classNames from 'classnames' |
| 4 | +import styles from './style.module.css' |
4 | 5 |
|
5 | 6 | export default function DualRing({ color, className, style, size }) { |
6 | | - return ( |
7 | | - <div className={`lds-dual-ring ${className}`} style={{ width: size, height: size, ...style }}> |
8 | | - <div |
9 | | - className="lds-dual-ring-after" |
10 | | - style={{ |
11 | | - borderColor: `${color} transparent`, |
12 | | - borderWidth: size * 0.1, |
13 | | - width: size * 0.7 - 6, |
14 | | - height: size * 0.7 - 6, |
15 | | - }} |
16 | | - ></div> |
17 | | - </div> |
18 | | - ) |
| 7 | + return ( |
| 8 | + <div className={classNames(styles['lds-dual-ring'], className)} style={{ width: size, height: size, ...style }}> |
| 9 | + <div |
| 10 | + className={classNames(styles['lds-dual-ring-after'])} |
| 11 | + style={{ |
| 12 | + borderColor: `${color} transparent`, |
| 13 | + borderWidth: size * 0.1, |
| 14 | + width: size * 0.7 - 6, |
| 15 | + height: size * 0.7 - 6, |
| 16 | + }} |
| 17 | + ></div> |
| 18 | + </div> |
| 19 | + ) |
19 | 20 | } |
20 | 21 |
|
21 | 22 | DualRing.propTypes = { |
22 | | - /** hex color */ |
23 | | - color: PropTypes.string, |
24 | | - /** class name */ |
25 | | - className: PropTypes.string, |
26 | | - /** style object */ |
27 | | - style: PropTypes.object, |
28 | | - /** size in pixel */ |
29 | | - size: PropTypes.number, |
| 23 | + /** hex color */ |
| 24 | + color: PropTypes.string, |
| 25 | + /** class name */ |
| 26 | + className: PropTypes.string, |
| 27 | + /** style object */ |
| 28 | + style: PropTypes.object, |
| 29 | + /** size in pixel */ |
| 30 | + size: PropTypes.number, |
30 | 31 | } |
31 | 32 |
|
32 | 33 | DualRing.defaultProps = { |
33 | | - color: '#7f58af', |
34 | | - className: '', |
35 | | - style: {}, |
36 | | - size: 80, |
| 34 | + color: '#7f58af', |
| 35 | + className: '', |
| 36 | + style: {}, |
| 37 | + size: 80, |
37 | 38 | } |
0 commit comments