Skip to content

Commit fd0a242

Browse files
authored
Merge pull request #64 from stefanv/display-nr-of-filtered
Show number of filtered entries
2 parents 314d286 + c00af48 commit fd0a242

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/components/JobsFilter.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import filterJobs from '../filter-jobs.mjs';
1111

1212
const defaultFormValues = {
1313
fullTime: false,
14-
ossTimeGt: 0,
14+
ossTimeGt: "0",
1515
showExpired: false,
1616
remote: false
1717
};
@@ -24,6 +24,8 @@ const JobsFilter = () => {
2424

2525
const jobs = filterJobs(jobData, formData);
2626

27+
const isFiltered = JSON.stringify(formData) !== JSON.stringify(defaultFormValues);
28+
2729
return (
2830
<div className="jobsLayout">
2931
<div className="leftColumn">
@@ -74,6 +76,11 @@ const JobsFilter = () => {
7476
Reset
7577
</button>
7678
</form>
79+
{isFiltered && (
80+
<div className="count">
81+
Displaying {jobs.length} / {jobData.length} entries.
82+
</div>
83+
)}
7784
</div>
7885
<HowToPost/>
7986
</div>

src/styles/global.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ a {
7777
padding: 0.5rem 1rem 0.5rem 1rem;
7878
width: 100%;
7979
}
80+
.count {
81+
margin-top: 1rem;
82+
font-size: 0.8rem;
83+
color: #666;
84+
text-align: center;
85+
}
8086
.howToPost {
8187
background: #007d8a;
8288
color: white;

0 commit comments

Comments
 (0)