Skip to content

Commit d6a6fa3

Browse files
author
fangedShadow
committed
Merge remote-tracking branch 'origin/development' into bhavpreet_browse_lp
2 parents 3816949 + 9ec8333 commit d6a6fa3

20 files changed

Lines changed: 3749 additions & 1434 deletions

src/components/Collaboration/Collaboration.jsx

Lines changed: 158 additions & 344 deletions
Large diffs are not rendered by default.

src/components/Collaboration/Collaboration.module.css

Lines changed: 261 additions & 352 deletions
Large diffs are not rendered by default.
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
import React from 'react';
2+
import styles from './Collaboration.module.css';
3+
4+
function CollaborationJobFilters({
5+
query,
6+
handleSearch,
7+
handleSubmit,
8+
canReorderJobs,
9+
toggleReorderModal,
10+
showTooltip,
11+
tooltipPosition,
12+
dismissSearchTooltip,
13+
dismissCategoryTooltip,
14+
dropdownRef,
15+
isDropdownOpen,
16+
setIsDropdownOpen,
17+
categories,
18+
selectedCategories,
19+
toggleCategory,
20+
}) {
21+
return (
22+
<nav className={styles.jobNavbar}>
23+
<div className={styles.jobNavbarLeft}>
24+
<form className={styles.jobSearchForm} onSubmit={handleSubmit}>
25+
<input
26+
type="text"
27+
value={query}
28+
placeholder="Search by title..."
29+
onChange={handleSearch}
30+
/>
31+
32+
<button className="btn btn-secondary" type="submit">
33+
Go
34+
</button>
35+
36+
{canReorderJobs && (
37+
<button
38+
className={`btn btn-secondary ${styles.reorderButton}`}
39+
type="button"
40+
onClick={toggleReorderModal}
41+
>
42+
Edit to Reorder
43+
</button>
44+
)}
45+
</form>
46+
47+
{showTooltip && tooltipPosition === 'search' && (
48+
<div className={styles.jobTooltip}>
49+
<p>Use the search bar to refine your search further!</p>
50+
<button
51+
type="button"
52+
onClick={dismissSearchTooltip}
53+
className={styles.jobTooltipDismiss}
54+
>
55+
Got it
56+
</button>
57+
</div>
58+
)}
59+
</div>
60+
61+
<div className={styles.jobNavbarRight} ref={dropdownRef}>
62+
<button
63+
type="button"
64+
className={styles.dropdownButton}
65+
onClick={() => setIsDropdownOpen(prev => !prev)}
66+
>
67+
{selectedCategories.length === 0
68+
? 'Select Categories ▼'
69+
: `${selectedCategories.length} selected ▼`}
70+
</button>
71+
72+
{isDropdownOpen && (
73+
<div className={styles.dropdownMenu}>
74+
{categories.map(cat => (
75+
<label key={cat} className={styles.dropdownItem}>
76+
<input
77+
type="checkbox"
78+
checked={selectedCategories.includes(cat)}
79+
onChange={() => toggleCategory(cat)}
80+
/>
81+
{cat}
82+
</label>
83+
))}
84+
</div>
85+
)}
86+
87+
{showTooltip && tooltipPosition === 'category' && (
88+
<div className={`${styles.jobTooltip} ${styles.categoryTooltip}`}>
89+
<p>Use the categories to refine your search further!</p>
90+
<button
91+
type="button"
92+
className={styles.jobTooltipDismiss}
93+
onClick={dismissCategoryTooltip}
94+
>
95+
Got it
96+
</button>
97+
</div>
98+
)}
99+
</div>
100+
</nav>
101+
);
102+
}
103+
104+
export default CollaborationJobFilters;

0 commit comments

Comments
 (0)