64 lines
1.4 KiB
JavaScript
64 lines
1.4 KiB
JavaScript
class V2C_TabBarItem extends BDV2.reactComponent {
|
|
|
|
constructor(props) {
|
|
super(props);
|
|
this.setInitialState();
|
|
this.onClick = this.onClick.bind(this);
|
|
}
|
|
|
|
setInitialState() {
|
|
this.state = {
|
|
selected: this.props.selected || false
|
|
};
|
|
}
|
|
|
|
render() {
|
|
return BDV2.react.createElement(
|
|
"div",
|
|
{className: `ui-tab-bar-item${this.props.selected ? " selected" : ""}`, onClick: this.onClick},
|
|
this.props.text
|
|
);
|
|
}
|
|
|
|
onClick() {
|
|
if (this.props.onClick) {
|
|
this.props.onClick(this.props.id);
|
|
}
|
|
}
|
|
}
|
|
|
|
class V2C_TabBarSeparator extends BDV2.reactComponent {
|
|
constructor(props) {
|
|
super(props);
|
|
}
|
|
|
|
render() {
|
|
return BDV2.react.createElement("div", {className: "ui-tab-bar-separator margin-top-8 margin-bottom-8"});
|
|
}
|
|
}
|
|
|
|
class V2C_TabBarHeader extends BDV2.reactComponent {
|
|
constructor(props) {
|
|
super(props);
|
|
}
|
|
|
|
render() {
|
|
return BDV2.react.createElement(
|
|
"div",
|
|
{className: "ui-tab-bar-header"},
|
|
this.props.text
|
|
);
|
|
}
|
|
}
|
|
|
|
export default class V2Cs_TabBar {
|
|
static get Item() {
|
|
return V2C_TabBarItem;
|
|
}
|
|
static get Header() {
|
|
return V2C_TabBarHeader;
|
|
}
|
|
static get Separator() {
|
|
return V2C_TabBarSeparator;
|
|
}
|
|
} |