Download wp-calypso/client/components/chart/label.jsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 553 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/chart/label.jsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/components/chart/label.jsx
-
curl -L -o label.jsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/chart/label.jsx
553 Bytes
| import PropTypes from 'prop-types'; | |
| import { PureComponent } from 'react'; | |
| export default class ChartLabel extends PureComponent { | |
| static propTypes = { | |
| isRtl: PropTypes.bool, | |
| label: PropTypes.string.isRequired, | |
| width: PropTypes.number.isRequired, | |
| x: PropTypes.number.isRequired, | |
| }; | |
| render() { | |
| const labelStyle = { | |
| [ this.props.isRtl ? 'right' : 'left' ]: this.props.x + 'px', | |
| width: this.props.width + 'px', | |
| }; | |
| return ( | |
| <div className="chart__x-axis-label" style={ labelStyle }> | |
| { this.props.label } | |
| </div> | |
| ); | |
| } | |
| } | |