Changeset 28b3398 for jobvista-frontend/src/views/dashboard
- Timestamp:
- 06/09/24 14:24:03 (5 months ago)
- Branches:
- main
- Children:
- b248810
- Parents:
- 19398ad
- Location:
- jobvista-frontend/src/views/dashboard
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
jobvista-frontend/src/views/dashboard/Dashboard.css
r19398ad r28b3398 11 11 } 12 12 13 14 .head-dashboard-box .head-component { 15 display: inline; 13 .head-dashboard-box .filter-container { 14 display: inline-flex; 15 justify-content: center; 16 gap: 10px; 16 17 } 17 18 … … 19 20 .head-dashboard-box .search-container { 20 21 position: relative; 21 float: left; 22 /*float: left;*/ 23 display: inline-block; 22 24 } 23 25 .head-dashboard-box .search-container .search-input { … … 26 28 padding: 5px 30px; 27 29 border-radius: 10px; 28 margin-right: 15px;30 /*margin-right: 15px;*/ 29 31 } 30 32 31 . search-container .search-input:focus {33 .head-dashboard-box .search-container .search-input:focus { 32 34 outline-color: #6367ef; 33 35 } 34 36 35 . search-container i {37 .head-dashboard-box .search-container i { 36 38 left: 10px; 37 39 position: absolute; … … 39 41 } 40 42 41 . item {42 width: 35%;43 .head-dashboard-box .item { 44 width: 20%; 43 45 display: inline-block; 44 margin-left: 10px;45 float: right;46 /*margin-left: 10px;*/ 47 /*float: left !important;*/ 46 48 } -
jobvista-frontend/src/views/dashboard/Dashboard.js
r19398ad r28b3398 20 20 21 21 const [role, setRole] = useState(""); 22 const [s ortOrder, setSortOrder] = useState("newest");23 const [selected DateRange, setSelectedDateRange] = useState("all");22 const [selectedSortOrder, setSelectedSortOrder] = useState("date_newest"); 23 const [selectedIndustry, setSelectedIndustry] = useState("all"); 24 24 const [searchTerm, setSearchTerm] = useState(""); 25 25 const [dispatched, setDispatched] = useState(false) … … 32 32 33 33 useEffect(() => { 34 if (!dispatched && jobAdvertisementsState.length == 0) {34 if (!dispatched && jobAdvertisementsState.length == 0) { 35 35 dispatch(JobAdvertisementActions.fetchJobAdvertisements((success, response) => { 36 36 if (success && response.data.length > 0) { … … 39 39 setDispatched(true) 40 40 console.log("Fetch all job advertisements GET") 41 console.log(response.data)42 41 })) 43 42 … … 46 45 console.log("Fetch all job advertisements STATE") 47 46 } 48 }, [ ])47 }, [jobAdvertisementsState]) 49 48 49 let filterJobAdvertisements = () => { 50 JobAdvertisementActions.filterJobAdvertisements( 51 { 52 searchTerm: searchTerm, 53 industry: selectedIndustry, 54 sortOrder: selectedSortOrder 55 }, (success, response) => { 56 if (success) { 57 setJobAdvertisements(response.data); 58 } 59 } 60 ) 61 } 50 62 51 63 return ( … … 53 65 <div className="head-dashboard-box"> 54 66 <div className="row"> 55 <div className="col-md- 3">56 <div className="search-container head-component">57 <i className="fa-solid fa-magnifying-glass blue-colored"></i>67 <div className="col-md-12 filter-container"> 68 <div className="search-container"> 69 <i className="fa-solid fa-magnifying-glass search-icon"></i> 58 70 <input 59 71 className="search-input" 60 72 type="text" 61 73 placeholder="Search job advertisement by title..." 62 //value={searchTerm}63 //onChange={event => setSearchTerm(event.target.value)}74 value={searchTerm} 75 onChange={event => setSearchTerm(event.target.value)} 64 76 /> 65 77 </div> 66 </div>67 <div className="col-md-9">68 78 <div className="sort-section item"> 69 79 <Select 70 80 defaultValue={{value: "all", label: "All industries"}} 71 //value={sortOrder.value}72 //onChange ={option => setSortOrder(option.value)}81 value={selectedIndustry.value} 82 onChange={option => setSelectedIndustry(option.value)} 73 83 options={industryOptionsFilter} 74 84 className="sort-range sort" … … 78 88 <Select 79 89 defaultValue={{value: "newest", label: "Date (Newest First)"}} 80 //value={sortOrder.value}81 //onChange ={option => setSortOrder(option.value)}82 options ={sortOptions}90 value={selectedSortOrder.value} 91 onChange={option => setSelectedSortOrder(option.value)} 92 options={sortOptions} 83 93 className="sort-range sort" 84 94 /> 85 95 </div> 86 <div className="date-range-section item"> 87 <Select 88 defaultValue={{value: "all", label: "Lifetime"}} 89 //value={selectedDateRange.value} 90 //onChange={option => setSelectedDateRange(option.value)} 91 options={dataRangeOptions} 92 className="date-range sort" 93 /> 94 </div> 96 <button onClick={filterJobAdvertisements} className="btn-open-modal">Find jobs</button> 95 97 </div> 98 {/*<div className="col-md-3">*/} 99 100 {/*<div className="date-range-section item">*/} 101 {/* <Select*/} 102 {/* defaultValue={{value: "all", label: "Lifetime"}}*/} 103 {/* //value={selectedDateRange.value}*/} 104 {/* //onChange={option => setSelectedDateRange(option.value)}*/} 105 {/* options={dataRangeOptions}*/} 106 {/* className="date-range sort"*/} 107 {/* />*/} 108 {/*</div>*/} 109 {/*</div>*/} 96 110 </div> 97 111 </div> … … 104 118 <div className="card-head"> 105 119 <span className="hourly-salary"><b>${jobAd.startingSalary}/hr</b></span> 106 <span className="job-type"> {jobAd.jobType===JobType.JOB ? "Job" : "Internship"}</span> 120 <span 121 className="job-type"> {jobAd.jobType === JobType.JOB ? "Job" : "Internship"}</span> 107 122 {!jobAd.active && <span className="expired">Expired</span>} 108 123 </div> 109 124 <div className="card-body"> 110 125 <h5 className="card-title">{jobAd.title}</h5> 111 <span>{jobAd.industry} • <span style={{color: "black", fontWeight: "bold"}}>{formatRelativeTime(jobAd.postedOn)}</span></span> 126 <span>{jobAd.industry} • <span style={{ 127 color: "black", 128 fontWeight: "bold" 129 }}>{formatRelativeTime(jobAd.postedOn)}</span></span> 112 130 <div className="card-info"> 113 <span><i className="fa-solid fa-building" style={{color: "#000000"}}></i> Company: <span style={{color: "black", fontWeight: "bold"}}>{jobAd.recruiterName}</span></span> <br/> 131 <span><i className="fa-solid fa-building" 132 style={{color: "#000000"}}></i> Company: <span style={{ 133 color: "black", 134 fontWeight: "bold" 135 }}>{jobAd.recruiterName}</span></span> <br/> 114 136 </div> 115 137 116 138 <div className="aligned"> 117 <Link to={`/job-advertisements/view/${jobAd.id}`} className="card-button">Read more</Link> 118 {role===Roles.JOBSEEKER && 119 <> 120 {jobAd.active && <button className="card-button">Apply now</button> } 121 {!jobAd.active && <button className="card-button disabled">Apply now</button> } 122 </> 123 } 139 <Link to={`/job-advertisements/${jobAd.id}`} className="card-button">Read 140 more</Link> 124 141 </div> 125 142
Note:
See TracChangeset
for help on using the changeset viewer.