mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-29 05:00:43 +10:00
Rename FieldGroupCheckbox legend prop into label
This commit is contained in:
parent
20e00522c1
commit
e5c180fcf2
2 changed files with 6 additions and 6 deletions
|
|
@ -5,11 +5,11 @@ import FieldGroupCheckbox from './FieldGroupCheckbox';
|
|||
|
||||
const formName = 'Styleguide.FieldGroupCheckboxForm';
|
||||
|
||||
const legend = <h3>Amenities</h3>;
|
||||
const label = <h3>Amenities</h3>;
|
||||
|
||||
const componentProps = {
|
||||
id: `${formName}.amenities`,
|
||||
legend: legend,
|
||||
label: label,
|
||||
options: [
|
||||
{
|
||||
key: 'towels',
|
||||
|
|
|
|||
|
|
@ -15,14 +15,14 @@ import { FieldCheckbox } from '../../components';
|
|||
import css from './FieldGroupCheckbox.css';
|
||||
|
||||
const FieldGroupCheckbox = props => {
|
||||
const { rootClassName, className, id, legend, options, twoColumns } = props;
|
||||
const { rootClassName, className, id, label, options, twoColumns } = props;
|
||||
|
||||
const classes = classNames(rootClassName || css.root, className);
|
||||
const listClasses = twoColumns ? classNames(css.list, css.twoColumns) : css.list;
|
||||
|
||||
return (
|
||||
<fieldset className={classes}>
|
||||
{legend ? <legend>{legend}</legend> : null}
|
||||
{label ? <legend>{label}</legend> : null}
|
||||
<ul className={listClasses}>
|
||||
{options.map(option => {
|
||||
const fieldId = `${id}.${option.key}`;
|
||||
|
|
@ -40,7 +40,7 @@ const FieldGroupCheckbox = props => {
|
|||
FieldGroupCheckbox.defaultProps = {
|
||||
rootClassName: null,
|
||||
className: null,
|
||||
legend: null,
|
||||
label: null,
|
||||
twoColumns: false,
|
||||
};
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ FieldGroupCheckbox.propTypes = {
|
|||
rootClassName: string,
|
||||
className: string,
|
||||
id: string.isRequired,
|
||||
legend: node,
|
||||
label: node,
|
||||
options: arrayOf(
|
||||
shape({
|
||||
key: string.isRequired,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue