From 9306617fd4109b53ed21f6fa2881843fb66e39ea Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Sat, 22 Oct 2016 01:04:24 -0400 Subject: [PATCH] Simplify modal button logic --- js/component/modal.js | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/js/component/modal.js b/js/component/modal.js index b651bb40e..c22d074c9 100644 --- a/js/component/modal.js +++ b/js/component/modal.js @@ -30,21 +30,17 @@ var Modal = React.createClass({ props.onCloseRequested = props.onAborted || props.onConfirmed; - if (this.props.type == 'alert') { - var buttons = ( -
- -
- ); - } else if (this.props.type == 'confirm') { - var buttons = ( -
- - -
- ); - } else { + if (this.props.type == 'custom') { var buttons = null; + } else { + var buttons = ( +
+ {this.props.type == 'confirm' + ? + : null} + +
+ ); } return (