mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
cb447b28c4
* Add profile directory to web UI * Add a line of bio to the directory
36 lines
803 B
JavaScript
36 lines
803 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import classNames from 'classnames';
|
|
|
|
export default class RadioButton extends React.PureComponent {
|
|
|
|
static propTypes = {
|
|
value: PropTypes.string.isRequired,
|
|
checked: PropTypes.bool,
|
|
name: PropTypes.string.isRequired,
|
|
onChange: PropTypes.func.isRequired,
|
|
label: PropTypes.node.isRequired,
|
|
};
|
|
|
|
render () {
|
|
const { name, value, checked, onChange, label } = this.props;
|
|
|
|
return (
|
|
<label className='radio-button'>
|
|
<input
|
|
name={name}
|
|
type='radio'
|
|
value={value}
|
|
checked={checked}
|
|
onChange={onChange}
|
|
/>
|
|
|
|
<span className={classNames('radio-button__input', { checked })} />
|
|
|
|
<span>{label}</span>
|
|
</label>
|
|
);
|
|
}
|
|
|
|
}
|