File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,6 @@ import React from 'react';
2
2
import ReactDOM from 'react-dom' ;
3
3
import './index.css' ;
4
4
import App from './App' ;
5
- import { rateColor , removeColor } from './actions' ;
6
- import { sortFunction } from 'lib/array-helpers' ;
7
5
import * as serviceWorker from './serviceWorker' ;
8
6
9
7
const colors = {
Original file line number Diff line number Diff line change
1
+ import PropTypes from 'prop-types'
2
+ import '../../../stylesheets/Menu.scss'
3
+
4
+ const options = {
5
+ date : "SORTED_BY_DATE" ,
6
+ title : "SORTED_BY_TITLE" ,
7
+ rating : "SORTED_BY_RATING"
8
+ }
9
+
10
+ const SortMenu = ( { sort= "SORTED_BY_DATE" , onSelect= f => f } ) =>
11
+ < nav className = "menu" >
12
+ < h1 > Sort Colors</ h1 >
13
+ { Object . keys ( options ) . map ( ( item , i ) =>
14
+ < a key = { i }
15
+ href = "#"
16
+ className = { ( sort === options [ item ] ) ? "selected" : null }
17
+ onClick = { e => {
18
+ e . preventDefault ( )
19
+ onSelect ( options [ item ] )
20
+ } } > { item } </ a >
21
+ ) }
22
+ </ nav >
23
+
24
+ SortMenu . propTypes = {
25
+ sort : PropTypes . string ,
26
+ onSelect : PropTypes . func
27
+ }
28
+
29
+ export default SortMenu
You can’t perform that action at this time.
0 commit comments