Skip to content

Commit 01ddf0a

Browse files
Sean PrashadSean Prashad
authored andcommitted
Use font-awesome icons for sorting arrows
1 parent cc5edfc commit 01ddf0a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

web/src/components/ReactTable/index.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import { Table } from 'reactstrap';
33
import { useTable, useSortBy } from 'react-table';
4+
import { FaArrowCircleUp, FaArrowCircleDown } from 'react-icons/fa';
45

56
function ReactTable({ columns, data }) {
67
const {
@@ -18,15 +19,24 @@ function ReactTable({ columns, data }) {
1819
);
1920

2021
return (
21-
<Table align="center" {...getTableProps()}>
22+
<Table align="center" striped hover {...getTableProps()}>
2223
<thead>
2324
{headerGroups.map(headerGroup => (
2425
<tr {...headerGroup.getHeaderGroupProps()}>
2526
{headerGroup.headers.map(column => (
2627
<th {...column.getHeaderProps(column.getSortByToggleProps())}>
2728
{column.render('Header')}
2829
<span>
29-
{column.isSorted ? (column.isSortedDesc ? ' 🔽' : ' 🔼') : ''}
30+
{' '}
31+
{column.isSorted ? (
32+
column.isSortedDesc ? (
33+
<FaArrowCircleDown />
34+
) : (
35+
<FaArrowCircleUp />
36+
)
37+
) : (
38+
''
39+
)}
3040
</span>
3141
</th>
3242
))}

0 commit comments

Comments
 (0)