Web: Components: RadioButtonGroup: add text label
This commit is contained in:
parent
227821700b
commit
99c441688d
@ -2,6 +2,7 @@ import React from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import RadioButton from "../radio-button";
|
||||
import StyledDiv from "./styled-radio-button-group";
|
||||
import Text from "../text";
|
||||
|
||||
class RadioButtonGroup extends React.Component {
|
||||
constructor(props) {
|
||||
@ -36,6 +37,12 @@ class RadioButtonGroup extends React.Component {
|
||||
width={this.props.width}
|
||||
>
|
||||
{options.map((option) => {
|
||||
if (option.type === "text")
|
||||
return (
|
||||
<Text key="radio-text" className="subtext">
|
||||
{option.label}
|
||||
</Text>
|
||||
);
|
||||
return (
|
||||
<RadioButton
|
||||
key={option.value}
|
||||
|
@ -5,6 +5,11 @@ import styled, { css } from "styled-components";
|
||||
const ClearDiv = ({ orientation, width, ...props }) => <div {...props} />;
|
||||
|
||||
const StyledDiv = styled(ClearDiv)`
|
||||
.subtext {
|
||||
margin-top: 16px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
${(props) =>
|
||||
(props.orientation === "horizontal" &&
|
||||
css`
|
||||
|
Loading…
Reference in New Issue
Block a user