Commit 93a43053 authored by alain's avatar alain 🐙
Browse files

filter/sort icons styling

parent 2bf5d6c7
...@@ -62,7 +62,7 @@ export default function Table(props) { ...@@ -62,7 +62,7 @@ export default function Table(props) {
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{items.map((item) => ( {items.map(item => (
<tr key={item['url']}> <tr key={item['url']}>
{ columns.map(column => ( { columns.map(column => (
<td key={column} className={column}> <td key={column} className={column}>
......
...@@ -73,21 +73,22 @@ body { ...@@ -73,21 +73,22 @@ body {
path { path {
pointer-events: auto; pointer-events: auto;
fill: #fff; fill: #fff;
opacity: 0.6;
} }
} }
.sort-button { .sort-button {
margin-right: 0.25em; margin-right: 0.25em;
&.ascending path.asc { fill: #000; } &.ascending path.asc { opacity: 1; }
&.descending path.desc { fill: #000; } &.descending path.desc { opacity: 1; }
} }
.filter-button { .filter-button {
margin-right: 0.5rem; margin-right: 0.5rem;
&.active path { &.active path {
fill: #000; opacity: 1;
} }
} }
} }
......
...@@ -10,6 +10,17 @@ export const useSortableData = (items, filter, config = null) => { ...@@ -10,6 +10,17 @@ export const useSortableData = (items, filter, config = null) => {
} }
return true; return true;
}); });
// let sortableItems = [...items].map(item => {
// item.disabled = false;
// delete filter.disabled;
// for (var key in filter) {
// //console.log(key, item['titel'])
// if(item[key].toUpperCase().includes(filter[key].toUpperCase()) === false) item.disabled = true;
// }
// return item;
// });
if (sortConfig !== null) { if (sortConfig !== null) {
sortableItems.sort((a, b) => { sortableItems.sort((a, b) => {
if (a[sortConfig.key] < b[sortConfig.key]) { if (a[sortConfig.key] < b[sortConfig.key]) {
...@@ -21,7 +32,9 @@ export const useSortableData = (items, filter, config = null) => { ...@@ -21,7 +32,9 @@ export const useSortableData = (items, filter, config = null) => {
return 0; return 0;
}); });
} }
return sortableItems; return sortableItems;
}, [items, filter, sortConfig]); }, [items, filter, sortConfig]);
const requestSort = (key) => { const requestSort = (key) => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment