Skip to content

Commit bdbb042

Browse files
authored
add back company filter (#227)
1 parent 2202aa4 commit bdbb042

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Diff for: src/components/Table/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ const Table = () => {
374374
</>
375375
);
376376
},
377-
accessor: 'companies',
377+
accessor: 'companyNames',
378378
sortType: (a, b) => {
379379
if (a.original.companies.length === b.original.companies.length) {
380380
return 0;
@@ -399,7 +399,7 @@ const Table = () => {
399399

400400
return <Row className="companies">{companies}</Row>;
401401
},
402-
disableFilters: true,
402+
Filter: SelectColumnFilter,
403403
},
404404
],
405405
},
@@ -436,8 +436,8 @@ const Table = () => {
436436
value: localStorage.getItem('pattern') || '',
437437
},
438438
{
439-
id: 'companies',
440-
value: localStorage.getItem('companies') || '',
439+
id: 'companyNames',
440+
value: localStorage.getItem('companyNames') || '',
441441
},
442442
],
443443
},

Diff for: src/data/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@ import questions from './questions.json';
33
const sortBy = { Easy: 0, Medium: 1, Hard: 2 };
44
const { updated, data } = questions;
55

6+
for (let i = 0; i < data.length; i += 1) {
7+
data[i].companyNames = data[i].companies.map(company => company.name);
8+
}
9+
610
export { updated };
711
export default data.sort((a, b) => sortBy[a.difficulty] - sortBy[b.difficulty]);

0 commit comments

Comments
 (0)