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) {
</tr>
</thead>
<tbody>
{items.map((item) => (
{items.map(item => (
<tr key={item['url']}>
{ columns.map(column => (
<td key={column} className={column}>
......
......@@ -73,25 +73,26 @@ body {
path {
pointer-events: auto;
fill: #fff;
opacity: 0.6;
}
}
.sort-button {
margin-right: 0.25em;
&.ascending path.asc { fill: #000; }
&.descending path.desc { fill: #000; }
&.ascending path.asc { opacity: 1; }
&.descending path.desc { opacity: 1; }
}
.filter-button {
margin-right: 0.5rem;
&.active path {
fill: #000;
opacity: 1;
}
}
}
tbody td {
padding: 0.5em;
border-bottom: 1px dashed #ccc;
......
......@@ -10,6 +10,17 @@ export const useSortableData = (items, filter, config = null) => {
}
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) {
sortableItems.sort((a, b) => {
if (a[sortConfig.key] < b[sortConfig.key]) {
......@@ -21,7 +32,9 @@ export const useSortableData = (items, filter, config = null) => {
return 0;
});
}
return sortableItems;
}, [items, filter, sortConfig]);
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