File tree Expand file tree Collapse file tree 6 files changed +58
-14
lines changed Expand file tree Collapse file tree 6 files changed +58
-14
lines changed Original file line number Diff line number Diff line change 3
3
"version" : " 0.1.0" ,
4
4
"private" : true ,
5
5
"dependencies" : {
6
+ "@fortawesome/fontawesome-svg-core" : " ^1.2.25" ,
7
+ "@fortawesome/free-solid-svg-icons" : " ^5.11.2" ,
6
8
"@fortawesome/react-fontawesome" : " ^0.1.7" ,
7
9
"bootstrap" : " ^4.3.1" ,
8
10
"react" : " ^16.10.2" ,
Original file line number Diff line number Diff line change 12
12
a {
13
13
color : # 333 ;
14
14
text-decoration : none;
15
+ }
16
+
17
+ .single-note {
18
+ width : '900px' ,
15
19
}
Original file line number Diff line number Diff line change 1
1
import React , { Component } from 'react' ;
2
2
import Navbar from './components/Navbar' ;
3
3
import Notes from './components/Notes' ;
4
+ import { Container , Row } from 'react-bootstrap'
4
5
import uuid from 'uuid' ;
5
6
import './App.css' ;
6
7
@@ -31,6 +32,10 @@ class App extends Component {
31
32
} ) ;
32
33
} ;
33
34
35
+ // editBtn = (id) => {
36
+ // console.log(id)
37
+ // };
38
+
34
39
deleteBtn = ( id ) => {
35
40
const notes = this . state . notes . filter ( ( note ) =>
36
41
note . id !== id
@@ -45,15 +50,16 @@ class App extends Component {
45
50
return (
46
51
< div className = "App" >
47
52
< Navbar addNote = { this . addNote } />
48
- < div className = "container" >
49
- < div className = "row" >
53
+ < Container >
54
+ < Row >
50
55
< Notes
51
56
notes = { this . state . notes }
52
57
handleDelete = { this . deleteBtn }
58
+ handleEdit = { this . editBtn }
53
59
addNote = { this . addNote }
54
60
/>
55
- </ div >
56
- </ div >
61
+ </ Row >
62
+ </ Container >
57
63
</ div >
58
64
)
59
65
}
Original file line number Diff line number Diff line change 1
1
import React , { Component } from 'react' ;
2
-
2
+ import { Col } from 'react-bootstrap'
3
+ import { faTrash , faWindowClose } from "@fortawesome/free-solid-svg-icons" ;
4
+ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" ;
3
5
4
6
class Note extends Component {
5
7
render ( ) {
6
8
return (
7
- < div className = "col-4 mb-3" >
8
- < div style = { noteStyle } className = "card" >
9
+ < Col >
10
+ < div style = { noteStyle } className = "card mb-3 " >
9
11
< div style = { cardHeader } className = "card-header bg-dark" > { this . props . note . title } </ div >
10
12
< div style = { cardBody } className = "card-body" > { this . props . note . body } </ div >
11
- < div className = "d-flex justify-content-between" >
12
- < button className = "btn btn-danger btn-sm" onClick = { ( ) => this . props . handleDelete ( this . props . note . id ) } > Del</ button >
13
- < button className = "btn btn-primary btn-sm" > Edit</ button >
13
+ < div className = "d-flex justify-content-flex-end ml-2 mb-2" >
14
+ < FontAwesomeIcon
15
+ icon = { faWindowClose }
16
+ style = { { fontSize : '20px' } }
17
+ className = "text-danger mr-3"
18
+ onClick = { ( ) => this . props . handleDelete ( this . props . note . id ) }
19
+ />
20
+ { /* <FontAwesomeIcon
21
+ icon={faEdit}
22
+ onClick={() => this.props.handleEdit(this.props.note.id)} /> */ }
14
23
</ div >
15
24
</ div >
16
- </ div >
25
+ </ Col >
17
26
)
18
27
}
19
28
}
20
29
21
30
const noteStyle = {
22
- width : '320px ' ,
31
+ width : '330px ' ,
23
32
height : '250px' ,
33
+ backgroundColor : '#FCFCFA' ,
24
34
} ;
25
35
26
36
const cardHeader = {
27
37
color : '#fff'
28
38
} ;
29
39
30
40
const cardBody = {
31
- overflow : 'visible ' ,
41
+ overflowY : 'auto ' ,
32
42
}
33
43
34
44
45
+
35
46
export default Note ;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ class Notes extends Component {
5
5
render ( ) {
6
6
return (
7
7
this . props . notes . map ( note =>
8
- < Note key = { note . id } note = { note } handleDelete = { this . props . handleDelete } />
8
+ < Note key = { note . id } note = { note } handleEdit = { this . props . handleEdit } handleDelete = { this . props . handleDelete } />
9
9
)
10
10
)
11
11
}
You can’t perform that action at this time.
0 commit comments