|
|
@@ -5,12 +5,13 @@ import {getCategory, request} from './Api';
|
|
|
import './Filters.css';
|
|
|
|
|
|
export const CATEGORIES = [{cat: 'artist', title: 'Artists'},
|
|
|
+ {cat: 'album', title: 'Album', hidden: true},
|
|
|
{cat: 'year', title: 'Years'},
|
|
|
{cat: 'genre', title: 'Genres'},
|
|
|
{cat: 'publisher', title: 'Labels'},
|
|
|
{cat: 'country', title: 'Countries'},
|
|
|
- {cat: 'type', title: 'Album types'},
|
|
|
- {cat: 'status', title: 'Album statuses'}];
|
|
|
+ {cat: 'type', title: 'Album types', hidden: true},
|
|
|
+ {cat: 'status', title: 'Album statuses', hidden: true}];
|
|
|
|
|
|
function handleLoadOptions(cat, q) {
|
|
|
const pageSize = 10000
|
|
|
@@ -38,7 +39,7 @@ export default function Filters({dispatch, filters, filter}) {
|
|
|
|
|
|
return (
|
|
|
<div className="Filters">
|
|
|
- {CATEGORIES.map(({cat, title}) => (
|
|
|
+ {CATEGORIES.map(({cat, title, hidden}) => (!hidden &&
|
|
|
<div className="section" key={cat}>
|
|
|
<h3>{title}</h3>
|
|
|
<AsyncSelect
|
|
|
@@ -53,6 +54,14 @@ export default function Filters({dispatch, filters, filter}) {
|
|
|
/>
|
|
|
</div>
|
|
|
))}
|
|
|
+ <div className="Filter">
|
|
|
+ <h3>Search</h3>
|
|
|
+ <input
|
|
|
+ type="text"
|
|
|
+ placeholder="Search albums"
|
|
|
+ value={filter || ''}
|
|
|
+ onChange={(e)=>handleFilterChange(dispatch, router, timeout, e.target.value)} />
|
|
|
+ </div>
|
|
|
<div>
|
|
|
<h3>Latest</h3>
|
|
|
<input className="Latest"
|
|
|
@@ -60,14 +69,6 @@ export default function Filters({dispatch, filters, filter}) {
|
|
|
checked={ !filters.alpha }
|
|
|
onChange={(e) => handleCategoryChange(router, 'alpha', !e.target.checked)} />
|
|
|
</div>
|
|
|
- <div>
|
|
|
- <h3>Search</h3>
|
|
|
- <input className="Filter"
|
|
|
- type="text"
|
|
|
- placeholder="Search albums"
|
|
|
- value={filter}
|
|
|
- onChange={(e)=>handleFilterChange(dispatch, router, timeout, e.target.value)} />
|
|
|
- </div>
|
|
|
</div>
|
|
|
);
|
|
|
}
|