]> cat aescling's git repositories - mastodon.git/blob - app/javascript/mastodon/components/radio_button.js
Add profile directory to web UI (#11688)
[mastodon.git] / app / javascript / mastodon / components / radio_button.js
1 import React from 'react';
2 import PropTypes from 'prop-types';
3 import classNames from 'classnames';
4
5 export default class RadioButton extends React.PureComponent {
6
7 static propTypes = {
8 value: PropTypes.string.isRequired,
9 checked: PropTypes.bool,
10 name: PropTypes.string.isRequired,
11 onChange: PropTypes.func.isRequired,
12 label: PropTypes.node.isRequired,
13 };
14
15 render () {
16 const { name, value, checked, onChange, label } = this.props;
17
18 return (
19 <label className='radio-button'>
20 <input
21 name={name}
22 type='radio'
23 value={value}
24 checked={checked}
25 onChange={onChange}
26 />
27
28 <span className={classNames('radio-button__input', { checked })} />
29
30 <span>{label}</span>
31 </label>
32 );
33 }
34
35 }
This page took 0.129356 seconds and 4 git commands to generate.