@@ -3,16 +3,16 @@ import {v4} from 'uuid'
3
3
import AddColorForm from './AddColorForm' ;
4
4
import StarRating from './StarRating' ;
5
5
import PropTypes from 'prop-types' ;
6
+ import SortMenu from './sortMenu' ;
6
7
import Color from './Color' ;
7
8
import { rateColor , removeColor } from './actions' ;
8
- import { sortFunction } from 'lib/array-helpers' ;
9
-
9
+ import { sortFunction } from './lib/array-helpers' ;
10
10
11
11
12
12
const ColorList = ( { store} ) => {
13
13
const { colors, sort} = store . getState ( ) ;
14
14
const sortedColors = [ ...colors ] . sort ( sortFunction ( sort ) ) ;
15
- < div className = "color-list" >
15
+ return ( < div className = "color-list" >
16
16
{ ( colors . length === 0 ) ?
17
17
< p > 색이 없습니다. 색을 추가해주세요</ p > :
18
18
sortedColors . map ( color =>
@@ -22,7 +22,7 @@ const ColorList = ({store}) => {
22
22
onRemove = { ( ) => store . dispatch ( removeColor ( color . id ) ) } />
23
23
)
24
24
}
25
- </ div >
25
+ </ div > )
26
26
}
27
27
28
28
@@ -32,13 +32,15 @@ class App extends Component {
32
32
this . state = {
33
33
colors : [ ]
34
34
}
35
+
35
36
this . addColor = this . addColor . bind ( this ) ;
36
37
this . rateColor = this . rateColor . bind ( this ) ;
37
38
this . removeColor = this . removeColor . bind ( this ) ;
38
39
}
39
40
render ( ) {
40
41
const { addColor, rateColor, removeColor } = this ;
41
42
const { colors } = this . state ;
43
+ const store = this . props . store ;
42
44
return (
43
45
< div className = "app" >
44
46
< SortMenu store = { store } />
0 commit comments