Changeset 19398ad for jobvista-frontend/src/views
- Timestamp:
- 05/16/24 23:09:21 (6 months ago)
- Branches:
- main
- Children:
- 28b3398
- Parents:
- d8b6c91
- Location:
- jobvista-frontend/src/views
- Files:
-
- 10 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
jobvista-frontend/src/views/auth/SignInForm.js
rd8b6c91 r19398ad 70 70 <div className="d-grid mb-3"> 71 71 <button 72 className="btn btn-lg btn-primarytext-uppercase fw-bold mb-2"72 className="btn btn-lg auth-primary-btn text-uppercase fw-bold mb-2" 73 73 type="submit">Sign in 74 74 </button> … … 85 85 <div className="row"> 86 86 <div className="col-md-6"> 87 <Link to="/signup/recruiter" className="btn btn-outline-primarytext-uppercase fw-bold mb-2 w-100">SIGN UP AS RECRUITER</Link>87 <Link to="/signup/recruiter" className="btn auth-secondary-btn text-uppercase fw-bold mb-2 w-100">SIGN UP AS RECRUITER</Link> 88 88 </div> 89 89 <div className="col-md-6"> 90 <Link to="/signup/job-seeker" className="btn btn-outline-primarytext-uppercase fw-bold mb-2 w-100">SIGN UP AS JOB SEEKER</Link>90 <Link to="/signup/job-seeker" className="btn auth-secondary-btn text-uppercase fw-bold mb-2 w-100">SIGN UP AS JOB SEEKER</Link> 91 91 </div> 92 92 </div> -
jobvista-frontend/src/views/auth/SignUpJobSeekerForm.js
rd8b6c91 r19398ad 83 83 <div className="d-grid mb-3"> 84 84 <button 85 className="btn btn-lg btn-primarytext-uppercase fw-bold mb-2"85 className="btn btn-lg auth-primary-btn text-uppercase fw-bold mb-2" 86 86 type="submit">Submit 87 87 </button> -
jobvista-frontend/src/views/auth/SignUpRecruiterForm.js
rd8b6c91 r19398ad 80 80 <div className="d-grid mb-3"> 81 81 <button 82 className="btn btn-lg btn-primarytext-uppercase fw-bold mb-2"82 className="btn btn-lg auth-primary-btn text-uppercase fw-bold mb-2" 83 83 type="submit">Submit 84 84 </button> -
jobvista-frontend/src/views/auth/auth.css
rd8b6c91 r19398ad 3 3 padding: 5px 5px; 4 4 } 5 6 .form-container { 7 margin-bottom: 80px; 8 } 9 10 .auth-primary-btn{ 11 background-color: rgba(1,38,90,0.80); 12 //background-color: #a1c4fd ; 13 color: white; 14 } 15 .auth-primary-btn:hover { 16 background-color: rgba(1,38,90,1); 17 color: white; 18 } 19 20 .auth-secondary-btn { 21 border: 2px solid rgba(1,38,90,0.7); 22 color: midnightblue; 23 } 24 25 .auth-secondary-btn:hover { 26 background-color: rgba(1,38,90,0.8); 27 color: white; 28 } -
jobvista-frontend/src/views/dashboard/Dashboard.js
rd8b6c91 r19398ad 1 import "./Dashboard.css" 2 3 import {useDispatch, useSelector} from "react-redux"; 4 import {useEffect, useState} from "react"; 5 import {JobAdvertisementActions} from "../../redux/actions/jobAdvertisementActions"; 6 import {formatRelativeTime, sortElementsByDateCreated} from "../../utils/utils"; 7 import {dataRangeOptions, industryOptions, industryOptionsFilter, sortOptions} from "../selectOptions"; 8 import Select from "react-select"; 9 import Roles from "../../enumerations/Roles"; 10 import {Link} from "react-router-dom"; 11 import JobType from "../../enumerations/JobType"; 12 1 13 export const Dashboard = () => { 14 15 const dispatch = useDispatch(); 16 17 const [jobAdvertisements, setJobAdvertisements] = useState([]); 18 let jobAdvertisementsState = useSelector(state => state.jobAd.jobAdvertisements) 19 const auth = useSelector(state => state.auth.currentUser); 20 21 const [role, setRole] = useState(""); 22 const [sortOrder, setSortOrder] = useState("newest"); 23 const [selectedDateRange, setSelectedDateRange] = useState("all"); 24 const [searchTerm, setSearchTerm] = useState(""); 25 const [dispatched, setDispatched] = useState(false) 26 27 useEffect(() => { 28 if (auth) { 29 setRole(auth.role); 30 } 31 }, [auth]); 32 33 useEffect(() => { 34 if(!dispatched && jobAdvertisementsState.length == 0) { 35 dispatch(JobAdvertisementActions.fetchJobAdvertisements((success, response) => { 36 if (success && response.data.length > 0) { 37 setJobAdvertisements(sortElementsByDateCreated(response.data)) 38 } 39 setDispatched(true) 40 console.log("Fetch all job advertisements GET") 41 console.log(response.data) 42 })) 43 44 } else { 45 setJobAdvertisements(jobAdvertisementsState) 46 console.log("Fetch all job advertisements STATE") 47 } 48 }, []) 2 49 3 50 4 51 return ( 5 52 <div className="container"> 6 <div className="row justify-content"> 7 <div className="col-md-4"> 8 <div className="card"> 9 <h5 className="card-title">Job Listing Name</h5> 10 <p>Job Listing Data</p> 53 <div className="head-dashboard-box"> 54 <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> 58 <input 59 className="search-input" 60 type="text" 61 placeholder="Search job advertisement by title..." 62 //value={searchTerm} 63 //onChange={event => setSearchTerm(event.target.value)} 64 /> 65 </div> 11 66 </div> 12 </div> 13 <div className="col-md-4"> 14 <div className="card"> 15 <h5 className="card-title">Job Listing Name</h5> 16 <p>Job Listing Data</p> 17 </div> 18 </div> 19 <div className="col-md-4"> 20 <div className="card"> 21 <h5 className="card-title">Job Listing Name</h5> 22 <p>Job Listing Data</p> 67 <div className="col-md-9"> 68 <div className="sort-section item"> 69 <Select 70 defaultValue={{value: "all", label: "All industries"}} 71 //value={sortOrder.value} 72 //onChange ={option => setSortOrder(option.value)} 73 options={industryOptionsFilter} 74 className="sort-range sort" 75 /> 76 </div> 77 <div className="sort-section item"> 78 <Select 79 defaultValue={{value: "newest", label: "Date (Newest First)"}} 80 //value={sortOrder.value} 81 //onChange ={option => setSortOrder(option.value)} 82 options = {sortOptions} 83 className="sort-range sort" 84 /> 85 </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> 23 95 </div> 24 96 </div> 25 97 </div> 98 <div className="row row-cols-1 row-cols-md-4 g-4"> 26 99 100 {jobAdvertisements && 101 jobAdvertisements.map((jobAd, index) => ( 102 <div key={index} className="col"> 103 <div className="custom-card"> 104 <div className="card-head"> 105 <span className="hourly-salary"><b>${jobAd.startingSalary}/hr</b></span> 106 <span className="job-type"> {jobAd.jobType===JobType.JOB ? "Job" : "Internship"}</span> 107 {!jobAd.active && <span className="expired">Expired</span>} 108 </div> 109 <div className="card-body"> 110 <h5 className="card-title">{jobAd.title}</h5> 111 <span>{jobAd.industry} • <span style={{color: "black", fontWeight: "bold"}}>{formatRelativeTime(jobAd.postedOn)}</span></span> 112 <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/> 114 </div> 115 116 <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 } 124 </div> 125 126 </div> 127 </div> 128 </div> 129 ))} 130 131 </div> 27 132 </div> 28 133 ) -
jobvista-frontend/src/views/static/Header.js
rd8b6c91 r19398ad 5 5 import {AuthActions} from "../../redux/actions/authActions"; 6 6 import Roles from "../../enumerations/Roles"; 7 import {useNavigate} from "react-router"; 7 8 8 export const Header = ( ) => {9 export const Header = (props) => { 9 10 10 11 const auth = useSelector(state => state.auth.currentUser); 11 12 const dispatch = useDispatch(); 13 const navigator = useNavigate(); 12 14 13 const [role, setRole] = useState( null);14 const [username, setUsername] = useState( null);15 const [role, setRole] = useState(""); 16 const [username, setUsername] = useState(""); 15 17 16 18 const signOut = () => { … … 20 22 21 23 useEffect(() => { 22 23 24 if (auth) { 24 25 setRole(auth.role); … … 34 35 <div className="collapse navbar-collapse" id="navbarSupportedContent"> 35 36 <ul className="navbar-nav me-auto mb-2 mb-lg-0"> 36 <NavLink to="/" className="nav-item nav-link" activeClassName="active">Home</NavLink>37 <NavLink to="/" className="nav-item nav-link">Home</NavLink> 37 38 {role==Roles.JOBSEEKER && 38 39 <> 39 <NavLink to="/applications" className="nav-item nav-link" activeClassName="active">Applications</NavLink>40 <NavLink to="/favoritejobs" className="nav-item nav-link" activeClassName="active">Saved</NavLink>40 <NavLink to="/applications" className="nav-item nav-link" >Applications</NavLink> 41 <NavLink to="/favoritejobs" className="nav-item nav-link" >Saved</NavLink> 41 42 </> 42 43 … … 44 45 {role==Roles.RECRUITER && 45 46 <> 46 <NavLink to="/ jobadvertisements" className="nav-item nav-link" activeClassName="active">Job Advertisements</NavLink>47 <NavLink to="/favoritejobs" className="nav-item nav-link" activeClassName="active">Saved</NavLink>47 <NavLink to="/my-job-advertisements" className="nav-item nav-link" >Job Advertisements</NavLink> 48 <NavLink to="/favoritejobs" className="nav-item nav-link" >Saved</NavLink> 48 49 </> 49 50 } … … 61 62 62 63 63 <Link onClick={signOut} className="btn btn-outline-secondary">Log out</Link>64 <Link onClick={signOut} className="btn auth-secondary-btn">Log out</Link> 64 65 </> : 65 66 <> 66 <Link to="/signin" className="btn btn-outline-secondary">Sign in</Link>67 <Link to="/signin" className="btn auth-secondary-btn">Sign in</Link> 67 68 </> 68 69 }
Note:
See TracChangeset
for help on using the changeset viewer.