mirror of
https://github.com/maputnik/editor.git
synced 2025-12-25 23:50:02 +00:00
Restyle to use border box
This commit is contained in:
@@ -15,15 +15,30 @@ class InputBlock extends React.Component {
|
||||
return this.props.onChange(value === "" ? null: value)
|
||||
}
|
||||
|
||||
renderChildren() {
|
||||
return React.Children.map(this.props.children, child => {
|
||||
return React.cloneElement(child, {
|
||||
style: {
|
||||
...child.props.style,
|
||||
width: '50%',
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
return <div style={{
|
||||
display: 'block',
|
||||
marginTop: margins[2],
|
||||
marginBottom: margins[2],
|
||||
...input.property,
|
||||
...this.props.style,
|
||||
}}>
|
||||
<label style={input.label}>{this.props.label}</label>
|
||||
{this.props.children}
|
||||
<label
|
||||
style={{
|
||||
...input.label,
|
||||
width: '50%',
|
||||
}}>
|
||||
{this.props.label}
|
||||
</label>
|
||||
{this.renderChildren()}
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user