BetterDiscordApp-rauenzi/renderer/src/ui/settings/title.jsx

16 lines
753 B
React
Raw Normal View History

2019-05-30 07:06:17 +02:00
import {React} from "modules";
2019-05-28 23:27:25 +02:00
const className = "bd-settings-title";
const className2 = "bd-settings-title bd-settings-group-title";
2019-06-04 06:18:15 +02:00
export default class SettingsTitle extends React.Component {
2019-05-28 20:19:48 +02:00
render() {
2019-06-06 06:28:43 +02:00
const baseClass = this.props.isGroup ? className2 : className;
const titleClass = this.props.className ? `${baseClass} ${this.props.className}` : baseClass;
2019-06-04 21:17:23 +02:00
return <h2 className={titleClass} onClick={() => {this.props.onClick && this.props.onClick();}}>
{this.props.text}
2019-06-21 06:32:59 +02:00
{this.props.button && <button className="bd-button bd-button-title" onClick={this.props.button.onClick}>{this.props.button.title}</button>}
{this.props.otherChildren}
2019-06-04 21:17:23 +02:00
</h2>;
2019-05-28 20:19:48 +02:00
}
}