pull/3374/head
Andrew Watkins 2018-05-03 14:59:22 -07:00
parent 9408057b7b
commit bb7b29725a
3 changed files with 11 additions and 15 deletions

View File

@ -9,7 +9,6 @@ const NOOP = () => {}
interface Props {
id: string
name?: string
minPixels: number
size: number
offset: number
activeHandleID: string
@ -26,25 +25,22 @@ class Division extends PureComponent<Props> {
}
public render() {
const {name, render, orientation} = this.props
const {name, render, orientation, draggable} = this.props
return (
<>
<div className={this.containerClass} style={this.containerStyle}>
<div
draggable={true}
className={this.className}
onDragStart={this.drag}
onDoubleClick={this.handleDoubleClick}
title={this.title}
draggable={draggable}
onDragStart={this.drag}
className={this.className}
onDoubleClick={this.handleDoubleClick}
>
<div className="threesizer--title">{name}</div>
</div>
<FancyScrollbar
className={`threesizer--contents ${orientation}`}
autoHide={true}
>
<div className={`threesizer--contents ${orientation}`}>
{render()}
</FancyScrollbar>
</div>
</div>
</>
)

View File

@ -30,13 +30,11 @@ interface State {
interface Division {
name?: string
render: () => ReactElement<any>
minPixels?: number
}
interface DivisionState extends Division {
id: string
size: number
minPixels?: number
}
interface Props {
@ -134,7 +132,6 @@ class Threesizer extends Component<Props, State> {
size={d.size}
offset={this.offset}
draggable={i > 0}
minPixels={d.minPixels}
orientation={orientation}
activeHandleID={activeHandleID}
onDoubleClick={this.handleDoubleClick}
@ -170,7 +167,6 @@ class Threesizer extends Component<Props, State> {
...d,
id: uuid.v4(),
size,
minPixels: d.minPixels || 0,
}))
}

View File

@ -68,6 +68,10 @@ $threesizer-handle: 30px;
&.horizontal {
cursor: row-resize;
}
&.disabled {
cursor: pointer;
}
color: $g16-pearl;
background-color: $g5-pepper;
}