Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Convert CommandBar to JSX
Browse files Browse the repository at this point in the history
  • Loading branch information
darkwing committed Aug 10, 2017
1 parent 6ebb3de commit d7e2ee4
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions src/components/SecondaryPanes/CommandBar.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// @flow
import { DOM as dom, Component, PropTypes } from "react";

import React, { Component, PropTypes } from "react";
import { connect } from "react-redux";
import { bindActionCreators } from "redux";
import classnames from "classnames";
import {
getPause,
getIsWaitingOnBreak,
Expand Down Expand Up @@ -68,20 +68,23 @@ function formatKey(action) {
}

function debugBtn(onClick, type, className, tooltip, disabled = false) {
className = `${type} ${className}`;
return dom.button(
{
onClick,
className,
key: type,
"aria-label": tooltip,
title: tooltip,
disabled
},
Svg(type)
const props = {
onClick,
key: type,
"aria-label": tooltip,
title: tooltip,
disabled
};

return (
<button className={classnames(type, className)} {...props}>
{Svg(type)}
</button>
);
}

debugBtn.displayName = "CommandBarButton";

class CommandBar extends Component {
props: {
sources: SourcesMap,
Expand Down Expand Up @@ -231,11 +234,12 @@ class CommandBar extends Component {
}

render() {
return dom.div(
{ className: "command-bar" },
this.renderPauseButton(),
this.renderStepButtons(),
this.renderPauseOnExceptions()
return (
<div className="command-bar">
{this.renderPauseButton()}
{this.renderStepButtons()}
{this.renderPauseOnExceptions()}
</div>
);
}
}
Expand Down

0 comments on commit d7e2ee4

Please sign in to comment.