You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
623 B
JavaScript
16 lines
623 B
JavaScript
import React, {PureComponent} from "react";
|
|
import style from "../../style";
|
|
|
|
export default class Toggle extends PureComponent {
|
|
render() {
|
|
return <span onClick={this.props.onClick} style={this.props.style.toggle.base}>
|
|
<span style={this.props.style.toggle.wrapper}>
|
|
<svg width={this.props.style.toggle.width} height={this.props.style.toggle.height} viewBox="-1 -1 12 12">
|
|
{this.props.terminal ? null :
|
|
<polygon points={this.props.node.toggled ? "0,0 10,0 5,10" : "0,0 10,5 0,10"} fill={style.colorAccent}/>
|
|
}
|
|
</svg>
|
|
</span>
|
|
</span>
|
|
}
|
|
} |