# HG changeset patch # User Alexandre Segura # Date 1498226255 -7200 # Node ID 6f2999873343c5149d9e63e4de88c9b26ce7e763 # Parent a6bd1aaddc341083e69a10adebe06299f1ff2d49 Add close icon when editing note. diff -r a6bd1aaddc34 -r 6f2999873343 client/src/App.scss --- a/client/src/App.scss Fri Jun 23 15:21:43 2017 +0200 +++ b/client/src/App.scss Fri Jun 23 15:57:35 2017 +0200 @@ -139,8 +139,8 @@ .note { display: flex; position: relative; - padding: 10px 10px 10px 80px; - margin-bottom: 20px; + padding: 20px 10px 20px 80px; + margin-bottom: 10px; cursor: pointer; min-height: ($line-height-computed * 4); border: 1px solid transparent; diff -r a6bd1aaddc34 -r 6f2999873343 client/src/components/Note.js --- a/client/src/components/Note.js Fri Jun 23 15:21:43 2017 +0200 +++ b/client/src/components/Note.js Fri Jun 23 15:57:35 2017 +0200 @@ -42,6 +42,13 @@ this.setState({ edit: false }) } + onClickClose = (e) => { + e.preventDefault(); + e.stopPropagation(); + + this.setState({ edit: false }) + } + renderNoteContent() { if (this.state.edit) { return ( @@ -58,6 +65,22 @@ ) } + renderNoteRight() { + if (this.state.edit) { + return ( + + close + + ); + } + + return ( + + delete + + ) + } + render() { return (
@@ -67,9 +90,7 @@
{ this.props.note.marginComment }
- - delete - + { this.renderNoteRight() }
); };