| } | } | ||||
| } | } | ||||
| .add-ad-btn { | |||||
| .add-ad-btn, | |||||
| .delete-filters-btn { | |||||
| display: flex; | display: flex; | ||||
| flex-direction: row; | flex-direction: row; | ||||
| justify-content: center; | justify-content: center; | ||||
| height: 51px; | height: 51px; | ||||
| background: #226cb0; | background: #226cb0; | ||||
| border-radius: 9px; | border-radius: 9px; | ||||
| margin-top: 9px; | |||||
| @include media-below($bp-xl) { | @include media-below($bp-xl) { | ||||
| width: 147px; | width: 147px; | ||||
| } | } |
| import React from "react"; | import React from "react"; | ||||
| import PropTypes from "prop-types"; | import PropTypes from "prop-types"; | ||||
| import logoReact from "../../assets/images/logo_react.png"; | |||||
| // import logoReact from "../../assets/images/logo_react.png"; | |||||
| import { useTheme } from "@emotion/react"; | import { useTheme } from "@emotion/react"; | ||||
| import { useMediaQuery } from "@mui/material"; | import { useMediaQuery } from "@mui/material"; | ||||
| import linkedin from "../../assets/images/linkedin.png"; | import linkedin from "../../assets/images/linkedin.png"; | ||||
| import facebook from "../../assets/images/facebook.png"; | import facebook from "../../assets/images/facebook.png"; | ||||
| import instagram from "../../assets/images/instagram.png"; | import instagram from "../../assets/images/instagram.png"; | ||||
| import { selectLogo } from "../../util/helpers/technologiesLogos"; | |||||
| const Ad = ({ | const Ad = ({ | ||||
| title, | title, | ||||
| </div> | </div> | ||||
| <div className="ad-card-logo"> | <div className="ad-card-logo"> | ||||
| <img src={logoReact} alt="logo-react" /> | |||||
| <img src={selectLogo(title)} alt="logo-react" /> | |||||
| </div> | </div> | ||||
| <div className="ad-card-experience"> | <div className="ad-card-experience"> |
| import { changeIsCheckedValue } from "../../store/actions/technologies/technologiesActions"; | import { changeIsCheckedValue } from "../../store/actions/technologies/technologiesActions"; | ||||
| import { useDispatch } from "react-redux"; | import { useDispatch } from "react-redux"; | ||||
| import { setFilteredAdsReq } from "../../store/actions/ads/adsAction"; | import { setFilteredAdsReq } from "../../store/actions/ads/adsAction"; | ||||
| import { useHistory } from "react-router-dom"; | |||||
| const AdFilters = ({ open, handleClose, technologies }) => { | const AdFilters = ({ open, handleClose, technologies }) => { | ||||
| const [sliderValue, setSliderValue] = useState([0, 10]); | const [sliderValue, setSliderValue] = useState([0, 10]); | ||||
| const [employmentType, setEmploymentType] = useState("Work"); | const [employmentType, setEmploymentType] = useState("Work"); | ||||
| const [workHour, setWorkHour] = useState("FullTime"); | const [workHour, setWorkHour] = useState("FullTime"); | ||||
| const dispatch = useDispatch(); | const dispatch = useDispatch(); | ||||
| const history = useHistory(); | |||||
| const handleSliderChange = (_, newValue) => { | const handleSliderChange = (_, newValue) => { | ||||
| setSliderValue(newValue); | setSliderValue(newValue); | ||||
| .filter((tech) => tech.isChecked === true) | .filter((tech) => tech.isChecked === true) | ||||
| .map((tech) => tech.name); | .map((tech) => tech.name); | ||||
| if(tech.length === 0) { | |||||
| return; | |||||
| } | |||||
| dispatch( | dispatch( | ||||
| setFilteredAdsReq({ | setFilteredAdsReq({ | ||||
| minExperience: sliderValue[0], | minExperience: sliderValue[0], | ||||
| }) | }) | ||||
| ); | ); | ||||
| let technologiesQuery = ""; | |||||
| for (let i = 0; i < tech.length; i++) { | |||||
| technologiesQuery += `technologies=${tech[i]}&`; | |||||
| } | |||||
| history.push({ | |||||
| pathname: "/ads", | |||||
| search: `?minExperience=${sliderValue[0]}&maxExperience=${sliderValue[1]}&workHour=${workHour}&employmentType=${employmentType}&${technologiesQuery}`, | |||||
| }); | |||||
| handleClose(); | handleClose(); | ||||
| }; | }; | ||||
| import React from "react"; | import React from "react"; | ||||
| import PropTypes from "prop-types"; | import PropTypes from "prop-types"; | ||||
| import net_icon from "../../assets/images/.net_icon.png"; | |||||
| import { selectLogo } from "../../util/helpers/technologiesLogos"; | |||||
| const ArchiveAd = ({ | const ArchiveAd = ({ | ||||
| className, | className, | ||||
| <h3>{title}</h3> | <h3>{title}</h3> | ||||
| </div> | </div> | ||||
| <div className="archive-ad-image"> | <div className="archive-ad-image"> | ||||
| <img src={net_icon} alt=".net icon" /> | |||||
| <img src={selectLogo(title)} alt=".net icon" /> | |||||
| </div> | </div> | ||||
| <div className="archive-ad-experience"> | <div className="archive-ad-experience"> | ||||
| {minimumExperience > 0 ? ( | {minimumExperience > 0 ? ( |
| import React, { useEffect, useRef } from "react"; | import React, { useEffect, useRef } from "react"; | ||||
| import { IconButton, useMediaQuery } from "@mui/material"; | import { IconButton, useMediaQuery } from "@mui/material"; | ||||
| import aspNetIcon from "../../assets/images/.net_icon.png"; | |||||
| // import aspNetIcon from "../../assets/images/.net_icon.png"; | |||||
| import { Link } from "react-router-dom"; | import { Link } from "react-router-dom"; | ||||
| import { useParams } from "react-router-dom"; | import { useParams } from "react-router-dom"; | ||||
| import { useDispatch, useSelector } from "react-redux"; | import { useDispatch, useSelector } from "react-redux"; | ||||
| import arrow_left from "../../assets/images/arrow_left.png"; | import arrow_left from "../../assets/images/arrow_left.png"; | ||||
| import arrow_right from "../../assets/images/arrow_right.png"; | import arrow_right from "../../assets/images/arrow_right.png"; | ||||
| import AdDetailsCandidateCard from "../../components/Ads/AdDetailsCandidateCard"; | import AdDetailsCandidateCard from "../../components/Ads/AdDetailsCandidateCard"; | ||||
| import { selectLogo } from "../../util/helpers/technologiesLogos"; | |||||
| const AdDetailsPage = () => { | const AdDetailsPage = () => { | ||||
| const theme = useTheme(); | const theme = useTheme(); | ||||
| settings: { | settings: { | ||||
| slidesToShow: 3, | slidesToShow: 3, | ||||
| slidesToScroll: 3, | slidesToScroll: 3, | ||||
| infinite: true, | |||||
| infinite: false, | |||||
| dots: false, | dots: false, | ||||
| }, | }, | ||||
| }, | }, | ||||
| <div className="ad-details-tech-logo"> | <div className="ad-details-tech-logo"> | ||||
| <div className="ad-details-tech-logo-title"> | <div className="ad-details-tech-logo-title"> | ||||
| <div className="ad-details-tech-logo-title-img"> | <div className="ad-details-tech-logo-title-img"> | ||||
| <img src={aspNetIcon} alt="asp-net-icon" /> | |||||
| <img src={selectLogo(ad.title)} alt="asp-net-icon" /> | |||||
| </div> | </div> | ||||
| <div className="ad-details-tech-logo-title-title"> | <div className="ad-details-tech-logo-title-title"> | ||||
| <h1>{ad.title}</h1> | <h1>{ad.title}</h1> |
| import AddAdModal from "../../components/Ads/AddAdModal"; | import AddAdModal from "../../components/Ads/AddAdModal"; | ||||
| import AdFilters from "../../components/Ads/AdFilters"; | import AdFilters from "../../components/Ads/AdFilters"; | ||||
| import { useDispatch } from "react-redux"; | import { useDispatch } from "react-redux"; | ||||
| import { setAdsReq } from "../../store/actions/ads/adsAction"; | |||||
| import { setAdsReq, setFilteredAdsReq } from "../../store/actions/ads/adsAction"; | |||||
| import { useSelector } from "react-redux"; | import { useSelector } from "react-redux"; | ||||
| import { selectAds } from "../../store/selectors/adsSelectors"; | import { selectAds } from "../../store/selectors/adsSelectors"; | ||||
| import { AD_DETAILS_PAGE } from "../../constants/pages"; | import { AD_DETAILS_PAGE } from "../../constants/pages"; | ||||
| import noActiveAds from "../../assets/images/no_active_ads.png"; | import noActiveAds from "../../assets/images/no_active_ads.png"; | ||||
| import { setTechnologiesReq } from "../../store/actions/technologies/technologiesActions"; | import { setTechnologiesReq } from "../../store/actions/technologies/technologiesActions"; | ||||
| import { selectTechnologies } from "../../store/selectors/technologiesSelectors"; | import { selectTechnologies } from "../../store/selectors/technologiesSelectors"; | ||||
| import { useLocation } from "react-router-dom"; | |||||
| const AdsPage = ({ history }) => { | const AdsPage = ({ history }) => { | ||||
| const theme = useTheme(); | const theme = useTheme(); | ||||
| const archiveAdsSliderRef = useRef(); | const archiveAdsSliderRef = useRef(); | ||||
| const { t } = useTranslation(); | const { t } = useTranslation(); | ||||
| const dispatch = useDispatch(); | const dispatch = useDispatch(); | ||||
| const { search } = useLocation(); | |||||
| useEffect(() => { | useEffect(() => { | ||||
| dispatch(setTechnologiesReq()); | dispatch(setTechnologiesReq()); | ||||
| dispatch(setAdsReq()); | |||||
| dispatch(setArchiveAdsReq()); | dispatch(setArchiveAdsReq()); | ||||
| }, []); | }, []); | ||||
| useEffect(() => { | |||||
| if (search) { | |||||
| // history.push("/ads"); | |||||
| const searchParams = search.split('?')[1] | |||||
| const technologyParams = searchParams.split('&').filter(x => x.includes('technologies')) | |||||
| const technologies = [] | |||||
| technologyParams.forEach(p => { | |||||
| const tech = p.split('=') | |||||
| technologies.push(tech[1]) | |||||
| }); | |||||
| const params = new URLSearchParams(search); | |||||
| dispatch( | |||||
| setFilteredAdsReq({ | |||||
| minExperience: params.get('minExperience'), | |||||
| maxExperience: params.get('maxExperience'), | |||||
| technologies, | |||||
| workHour: params.get('workHour'), | |||||
| employmentType: params.get('employmentType'), | |||||
| }) | |||||
| ); | |||||
| } else { | |||||
| dispatch(setAdsReq()); | |||||
| } | |||||
| }, []) | |||||
| const handleToggleFiltersDrawer = () => { | const handleToggleFiltersDrawer = () => { | ||||
| setToggleFiltersDrawer((oldState) => !oldState); | setToggleFiltersDrawer((oldState) => !oldState); | ||||
| }; | }; | ||||
| archiveAdsSliderRef.current.slickNext(); | archiveAdsSliderRef.current.slickNext(); | ||||
| }; | }; | ||||
| const deleteFiltersHandler = () => { | |||||
| history.push("/ads"); | |||||
| dispatch(setAdsReq()); | |||||
| }; | |||||
| const getDummyAds = (len) => { | const getDummyAds = (len) => { | ||||
| const ads = []; | const ads = []; | ||||
| Dodaj Oglas | Dodaj Oglas | ||||
| </IconButton> | </IconButton> | ||||
| </div> | </div> | ||||
| {search && ( | |||||
| <div> | |||||
| <IconButton | |||||
| className="c-btn c-btn--primary delete-filters-btn" | |||||
| onClick={deleteFiltersHandler} | |||||
| > | |||||
| Obrisite filtere | |||||
| </IconButton> | |||||
| </div> | |||||
| )} | |||||
| </div> | </div> | ||||
| )} | )} | ||||
| {archiveAds && archiveAds.length > 0 && ( | {archiveAds && archiveAds.length > 0 && ( |
| export const FETCH_ADS_REQ = 'FETCH_ADS_REQ'; | |||||
| export const FETCH_ADS_ERR = 'FETCH_ADS_ERR'; | |||||
| export const FETCH_ADS_SUCCESS = 'FETCH_ADS_SUCCESS'; | |||||
| import { | |||||
| createFetchType, | |||||
| createSuccessType, | |||||
| createErrorType, | |||||
| } from "../actionHelpers"; | |||||
| export const FETCH_FILTERED_ADS_REQ = 'FETCH_FILTERED_ADS_REQ'; | |||||
| export const FETCH_FILTERED_ADS_ERR = 'FETCH_FILTERED_ADS_ERR'; | |||||
| export const FETCH_FILTERED_ADS_SUCCESS = 'FETCH_FILTERED_ADS_SUCCESS'; | |||||
| const CREATE_AD_SCOPE = "FETCH_ADS"; | |||||
| export const FETCH_ADS_REQ = createFetchType(CREATE_AD_SCOPE); | |||||
| export const FETCH_ADS_ERR = createErrorType(CREATE_AD_SCOPE); | |||||
| export const FETCH_ADS_SUCCESS = createSuccessType(CREATE_AD_SCOPE); | |||||
| export const FETCH_FILTERED_ADS_REQ = "FETCH_FILTERED_ADS_REQ"; | |||||
| export const FETCH_FILTERED_ADS_ERR = "FETCH_FILTERED_ADS_ERR"; | |||||
| export const FETCH_FILTERED_ADS_SUCCESS = "FETCH_FILTERED_ADS_SUCCESS"; |
| import aspnet from "../../assets/images/.net_icon.png"; | |||||
| import backend from "../../assets/images/backend.png"; | |||||
| import dataanalyst from "../../assets/images/dataanalyst.png"; | |||||
| import devops from "../../assets/images/devops.png"; | |||||
| import qa from "../../assets/images/qa.png"; | |||||
| import logo_react from "../../assets/images/logo_react.png"; | |||||
| import hr from "../../assets/images/HR.png"; | |||||
| export const technologiesLogos = { | |||||
| '.net': aspnet, | |||||
| 'backend': backend, | |||||
| 'dataanalyst': dataanalyst, | |||||
| 'devops': devops, | |||||
| 'qa': qa, | |||||
| 'react': logo_react, | |||||
| 'hr': hr, | |||||
| }; | |||||
| const takeLogo = (title) => { | |||||
| if(!title) { | |||||
| return technologiesLogos['hr'] | |||||
| } | |||||
| switch(true) { | |||||
| case title.toLowerCase().includes('.net'): | |||||
| return technologiesLogos['.net']; | |||||
| case title.toLowerCase().includes('backend'): | |||||
| return technologiesLogos['backend']; | |||||
| case title.toLowerCase().includes('dataanalyst'): | |||||
| return technologiesLogos['dataanalyst']; | |||||
| case title.toLowerCase().includes('devops'): | |||||
| return technologiesLogos['devops']; | |||||
| case title.toLowerCase().includes('qa'): | |||||
| return technologiesLogos['qa']; | |||||
| case title.toLowerCase().includes('react'): | |||||
| return technologiesLogos['react']; | |||||
| default: | |||||
| return technologiesLogos['hr'] | |||||
| } | |||||
| } | |||||
| export const selectLogo = (title) => { | |||||
| return takeLogo(title) | |||||
| } |