in website/src/components/Playground/src/YogaEnumSelect.js [66:106]
render() {
let {property, ...props} = this.props;
property = PROPERTY_LOOKUP[property];
const selected = this.values.find(
({key, value}) => value === this.props.value,
);
return this.values.length > 3 ? (
<div className="YogaEnumSelect">
<Dropdown
trigger={['click']}
disabled={props.disabled}
overlay={
<Menu onClick={this.handleMenuClick}>
{this.values.map(({key, value}) => (
<Menu.Item key={key} value={value}>
{this.getTitle(property, key)}
</Menu.Item>
))}
</Menu>
}>
<Button>
{selected ? this.getTitle(property, selected.key) : ''}
<Icon type="down" />
</Button>
</Dropdown>
</div>
) : (
<RadioGroup
{...props}
onChange={e => this.props.onChange(this.props.property, e.target.value)}
defaultValue="a"
className="YogaEnumSelect">
{this.values.map(({key, value}) => (
<RadioButton key={key} value={value}>
{this.getTitle(property, key)}
</RadioButton>
))}
</RadioGroup>
);
}