Cleanup
parent
9408057b7b
commit
bb7b29725a
|
@ -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>
|
||||
</>
|
||||
)
|
||||
|
|
|
@ -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,
|
||||
}))
|
||||
}
|
||||
|
||||
|
|
|
@ -68,6 +68,10 @@ $threesizer-handle: 30px;
|
|||
&.horizontal {
|
||||
cursor: row-resize;
|
||||
}
|
||||
&.disabled {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
color: $g16-pearl;
|
||||
background-color: $g5-pepper;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue