@@ -7,15 +7,13 @@ export default class CommentEditToggle extends React.Component {
77
88 constructor ( props ) {
99 super ( props )
10- this . state = { isOpen : false }
1110 this . onEdit = this . onEdit . bind ( this )
1211 this . onDelete = this . onDelete . bind ( this )
1312 this . showDelete = this . showDelete . bind ( this )
1413 this . cancelDelete = this . cancelDelete . bind ( this )
1514 }
1615
1716 onEdit ( ) {
18- this . setState ( { isOpen : false } )
1917 this . props . onEdit ( )
2018 }
2119
@@ -24,16 +22,16 @@ export default class CommentEditToggle extends React.Component {
2422 }
2523
2624 cancelDelete ( ) {
27- this . setState ( { isOpen : false , showDeleteConfirm : false } )
25+ this . setState ( { showDeleteConfirm : false } )
2826 }
2927
3028 onDelete ( ) {
31- this . setState ( { isOpen : false , showDeleteConfirm : false } )
29+ this . setState ( { showDeleteConfirm : false } )
3230 this . props . onDelete ( )
3331 }
3432
3533 render ( ) {
36- const { isOpen , showDeleteConfirm } = this . state
34+ const { showDeleteConfirm } = this . state
3735 const editOptions = { label :this . props . forTopic ? 'Edit post' : 'Edit comment' , val :'1' }
3836 const deleteOptions = { label :this . props . forTopic ? 'Delete post' : 'Delete comment' , val :'2' }
3937 return (
@@ -44,39 +42,37 @@ export default class CommentEditToggle extends React.Component {
4442 < div className = "dropdown-menu-list down-layer" >
4543 < ul >
4644 < DropdownItem key = { 1 } item = { editOptions }
47- onItemClick = { this . onEdit }
48- currentSelection = ''
49- />
45+ onItemClick = { this . onEdit }
46+ currentSelection = ""
47+ />
5048 < DropdownItem key = { 2 } item = { deleteOptions }
51- onItemClick = { this . showDelete }
52- currentSelection = ''
53- />
49+ onItemClick = { this . showDelete }
50+ currentSelection = ""
51+ />
5452 </ ul >
5553 </ div >
56-
57-
58-
5954 </ Dropdown >
6055 < Modal
61- isOpen = { showDeleteConfirm }
62- className = "delete-post-dialog"
63- overlayClassName = "delete-post-dialog-overlay"
64- onRequestClose = { this . cancelDelete }
65- contentLabel = ""
66- >
67- < div className = "modal-title" >
68- Are you sure you want to delete this post?
69- </ div >
56+ isOpen = { showDeleteConfirm }
57+ className = "delete-post-dialog"
58+ overlayClassName = "delete-post-dialog-overlay"
59+ onRequestClose = { this . cancelDelete }
60+ contentLabel = ""
61+ >
62+
63+ < div className = "modal-title" >
64+ Are you sure you want to delete this post?
65+ </ div >
7066
71- < div className = "modal-body" >
72- This action cannot be undone.
73- </ div >
67+ < div className = "modal-body" >
68+ This action cannot be undone.
69+ </ div >
7470
75- < div className = "button-area flex center action-area" >
76- < button className = "tc-btn tc-btn-default tc-btn-sm action-btn btn-cancel" onClick = { this . cancelDelete } > Cancel</ button >
77- < button className = "tc-btn tc-btn-warning tc-btn-sm action-btn " onClick = { this . onDelete } > Delete Post</ button >
78- </ div >
79- </ Modal >
71+ < div className = "button-area flex center action-area" >
72+ < button className = "tc-btn tc-btn-default tc-btn-sm action-btn btn-cancel" onClick = { this . cancelDelete } > Cancel</ button >
73+ < button className = "tc-btn tc-btn-warning tc-btn-sm action-btn " onClick = { this . onDelete } > Delete Post</ button >
74+ </ div >
75+ </ Modal >
8076
8177 </ div >
8278
0 commit comments