Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feature) added women-only opportunities filter #271

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/Components/ViewOpportunity/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export function ViewOpportunity(props) {
const [imgSrc, setImgSrc] = useState();
const [filteredData, setFilteredData] = useState(data);
const [searchString, setSearchString] = useState('');
const [onlyForWomen, setOnlyForWomen] = useState(false);

React.useEffect(() => {
if (searchString?.length > 0) {
Expand Down Expand Up @@ -98,6 +99,15 @@ export function ViewOpportunity(props) {
return (
<>
<CommonComponents onSearchFinal={handleSearchString} />
<div className="container">
<input
type="checkbox"
id="women_opp"
checked={onlyForWomen}
onChange={(e) => setOnlyForWomen(e.target.checked)}
/>
<label for="women_opp">Only For Women</label>
</div>
<Jumbotron className={styles.opportunityBody}>
<Container>
{data_length === 0 ? (
Expand All @@ -110,6 +120,7 @@ export function ViewOpportunity(props) {
<Col md={1} sm={1} lg={1} xl={1} xs={0}></Col>
<Col md={10} sm={10} lg={10} xl={10} xs={12}>
{filteredData?.map((item) => {
if (onlyForWomen && !item.onlyForFemale) return;
return <OpportunityCard key={item.id} item={item} />;
})}
</Col>
Expand Down