1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
import React, { Component } from 'react'
import { Link } from 'react-router-dom'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import actions from '../../../actions'
import { Select, Checkbox } from '../../../common'
const thumbnailOptions = [
{ name: 'th', label: 'Thumbnails', },
{ name: 'sm', label: 'Small', },
{ name: 'md', label: 'Medium', },
{ name: 'lg', label: 'Large', },
{ name: 'orig', label: 'Original', },
]
const sortOptions = [
{ name: 'id-asc', label: 'Most recent' },
{ name: 'id-desc', label: 'Oldest first' },
{ name: 'username-asc', label: 'Username (A-Z)' },
{ name: 'username-desc', label: 'Username (Z-A)' },
// { name: '-asc', label: '' },
// { name: '-desc', label: '' },
// { name: '-asc', label: '' },
// { name: '-desc', label: '' },
// { name: '-asc', label: '' },
// { name: '-desc', label: '' },
]
class IndexOptions extends Component {
render() {
const { options, searchOptions } = this.props
return (
<div className='row menubar'>
<div />
<Select
name={'sort'}
options={sortOptions}
selected={options.sort}
onChange={actions.upload.updateOption}
/>
<Select
name={'thumbnailSize'}
options={thumbnailOptions}
selected={searchOptions.thumbnailSize}
onChange={actions.search.updateOption}
/>
</div>
)
}
}
const mapStateToProps = state => ({
options: state.upload.options,
searchOptions: state.search.options,
})
const mapDispatchToProps = dispatch => ({
})
export default connect(mapStateToProps, mapDispatchToProps)(IndexOptions)
|