mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-13 18:50:29 +03:00
Fix RadioButton style
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
parent
0f963a93f1
commit
7750366654
2 changed files with 17 additions and 13 deletions
|
|
@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
|||
import './RadioButton.scss';
|
||||
|
||||
function RadioButton({ isActive, onToggle }) {
|
||||
if (onToggle === null) return <span className={`radio-btn${isActive ? ' radio-btn--active' : ''}`} />;
|
||||
return (
|
||||
// eslint-disable-next-line jsx-a11y/control-has-associated-label
|
||||
<button
|
||||
|
|
@ -15,11 +16,12 @@ function RadioButton({ isActive, onToggle }) {
|
|||
|
||||
RadioButton.defaultProps = {
|
||||
isActive: false,
|
||||
onToggle: null,
|
||||
};
|
||||
|
||||
RadioButton.propTypes = {
|
||||
isActive: PropTypes.bool,
|
||||
onToggle: PropTypes.func.isRequired,
|
||||
onToggle: PropTypes.func,
|
||||
};
|
||||
|
||||
export default RadioButton;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue