Skip to content

Commit

Permalink
ES6ify StartOverButton
Browse files Browse the repository at this point in the history
  • Loading branch information
islemaster committed Sep 8, 2017
1 parent e01ed98 commit 681b66b
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions apps/src/publicKeyCryptography/StartOverButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,21 @@ import React, {PropTypes} from 'react';
import i18n from '@cdo/locale';
import Dialog from '../templates/Dialog';

const StartOverButton = React.createClass({
propTypes: {
export default class StartOverButton extends React.Component {
static propTypes = {
onClick: PropTypes.func.isRequired
},
};

getInitialState() {
return {confirming: false};
},
state = {confirming: false};

confirm() {
this.setState({confirming: true});
},
confirm = () => this.setState({confirming: true});

onConfirm() {
onConfirm = () => {
this.props.onClick();
this.setState({confirming: false});
},
};

onCancel() {
this.setState({confirming: false});
},
onCancel = () => this.setState({confirming: false});

render() {
return (
Expand All @@ -42,7 +36,7 @@ const StartOverButton = React.createClass({
onConfirm={this.onConfirm}
onCancel={this.onCancel}
/>
</span>);
</span>
);
}
});
export default StartOverButton;
}

0 comments on commit 681b66b

Please sign in to comment.