From 8619cbbc2f942126cb5cda181f09db90f80ab03e Mon Sep 17 00:00:00 2001 From: skanda1395 Date: Thu, 23 Dec 2021 23:56:00 +0530 Subject: [PATCH 1/2] (feature) added women-only opportunities filter --- src/Components/ViewOpportunity/index.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Components/ViewOpportunity/index.js b/src/Components/ViewOpportunity/index.js index 125e68a..4b07474 100644 --- a/src/Components/ViewOpportunity/index.js +++ b/src/Components/ViewOpportunity/index.js @@ -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) { @@ -98,6 +99,15 @@ export function ViewOpportunity(props) { return ( <> +
+ setOnlyForWomen(e.target.checked)} + /> + +
{data_length === 0 ? ( @@ -110,6 +120,7 @@ export function ViewOpportunity(props) { {filteredData?.map((item) => { + if (onlyForWomen && !item.onlyForFemale) return; return ; })} From d9030ad162e4ebd28c5300f3a53a18e306670c5a Mon Sep 17 00:00:00 2001 From: skanda1395 Date: Mon, 27 Dec 2021 21:34:47 +0530 Subject: [PATCH 2/2] cosmetic changes to dropdown & checkbox in view opportunities --- .../ViewOpportunity/CommonComponents.js | 38 +------------ src/Components/ViewOpportunity/index.js | 57 ++++++++++++++++++- 2 files changed, 58 insertions(+), 37 deletions(-) diff --git a/src/Components/ViewOpportunity/CommonComponents.js b/src/Components/ViewOpportunity/CommonComponents.js index 2d93970..361cf33 100644 --- a/src/Components/ViewOpportunity/CommonComponents.js +++ b/src/Components/ViewOpportunity/CommonComponents.js @@ -27,11 +27,11 @@ const mapUrlToName = { export default function CommonComponents({ onSearchFinal }) { const handleSearchString = (value) => { - onSearchFinal(value) - } + onSearchFinal(value); + }; return ( <> - + @@ -39,38 +39,6 @@ export default function CommonComponents({ onSearchFinal }) { - - - - - - {' '} Full Time Jobs{' '} - - - {' '} Hackathons{' '} - - - {' '} Scholarships{' '} - - - {' '} Coding Competitions{' '} - - - {' '} Tech Conferences{' '} - - - {' '} Internship Opportunities{' '} - - - - - - - ); } diff --git a/src/Components/ViewOpportunity/index.js b/src/Components/ViewOpportunity/index.js index 4b07474..eaef852 100644 --- a/src/Components/ViewOpportunity/index.js +++ b/src/Components/ViewOpportunity/index.js @@ -8,6 +8,7 @@ import { Jumbotron, Row, NavDropdown, + ToggleButton, } from 'react-bootstrap'; import styles from '../../CSS/Opportunity.module.css'; import Navbar from './Navbar'; @@ -99,7 +100,59 @@ export function ViewOpportunity(props) { return ( <> -
+ + + + + + + {' '} + Full Time Jobs{' '} + + + {' '} + Hackathons{' '} + + + {' '} + Scholarships{' '} + + + {' '} + Coding Competitions{' '} + + + {' '} + Tech Conferences{' '} + + + {' '} + Internship Opportunities{' '} + + + + + setOnlyForWomen(e.currentTarget.checked)} + > + Only For Women + + + + + + + {/*
setOnlyForWomen(e.target.checked)} /> -
+
*/} {data_length === 0 ? (