Download wp-calypso/packages/components/src/spinner/index.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 690 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/components/src/spinner/index.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/packages/components/src/spinner/index.tsx
-
curl -L -o index.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/components/src/spinner/index.tsx
690 Bytes
| import clsx from 'clsx'; | |
| import { PureComponent } from 'react'; | |
| import './style.scss'; | |
| export class Spinner extends PureComponent< { | |
| className?: string; | |
| size?: number; | |
| baseClassName?: string; | |
| } > { | |
| static defaultProps = { | |
| size: 20, | |
| baseClassName: 'spinner', | |
| }; | |
| render() { | |
| const className = clsx( this.props.baseClassName, this.props.className ); | |
| const style = { | |
| width: this.props.size, | |
| height: this.props.size, | |
| fontSize: this.props.size, // allows border-width to be specified in em units | |
| }; | |
| return ( | |
| <div className={ className }> | |
| <div className="spinner__outer" style={ style }> | |
| <div className="spinner__inner" /> | |
| </div> | |
| </div> | |
| ); | |
| } | |
| } | |